CGI Programming on the World Wide WebBy Shishir Gundavaram1st Edition March 1996 This book is out of print, but it has been made available online through the O'Reilly Open Books Project. |
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 noneThe -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 120This will create a C executable with the specified UID and GID bits set, that will, in turn, run the CGI script.
Back to: CGI Programming on the World Wide Web
© 2001, O'Reilly & Associates, Inc.