Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Previous Chapter 12
Debugging and Testing CGI Applications
Next
 

12.6 Set UID/GID Wrapper

Now that we have a debugging/lint tool for CGI programs, how do we set this up so that it executes as the same UID as that of the Web server? If the Web server runs with your own UID, then you do not have to do anything. But, if it runs as some other UID, say "nobody" or "www," then you have to ask the system administrator to run a script called wrapper, which sets the UID/GID bits. Let's quickly look at this script.

The wrapper is based on a program in the book Programming Perl by Larry Wall and Randal Schwartz (two of the most knowledgable Perl gurus around). Here is the format for the wrapper command:

% wrapper -f /usr/local/bin/CGI_Lint -u nobody -g none

The -f switch specifies the filename to use, while the -u and the -g switches set the UID and GID, respectively. You could also use numerical identification numbers:

% wrapper -f /usr/local/bin/CGI_Lint -u 628120 -g 120

This will create a C executable with the specified UID and GID bits set, that will, in turn, run the CGI script.


Previous Home Next
CGI Lint--A Debugging/Testing Tool Book Index Perl CGI Programming FAQ

 
 
  Published under free license. Design by Interspire