You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Jason A. Dour" <ja...@bcc.louisville.edu> on 1996/09/05 18:42:16 UTC

Change to cgi-bin/printenv

-----BEGIN PGP SIGNED MESSAGE-----

Below you'll find the text of an altered cgi-bin/printenv I'v worked up
for use while developing suEXEC with Randy.

Are there any objections to using this in place of the current
cgi-bin/printenv?  It will allow people installing suEXEC to determine if
their suEXEC layer is working properly without having to write their own
program.  The output is altered minimally.  Please review and recommend
any changes you see that need to be made.

Yes, I know the code isn't that pretty or documented, but neither was the
original.  8)  I especially need this for the documentation I'm writing on
how to install and use suEXEC safely and effectively.

Thanks,
Jason
+ Jason A. Dour                       jad@bcc.louisville.edu               +
| Programmer Analyst II               http://www.louisville.edu/~jadour01/ |
| Dept. of Radiation Oncology         Finger for Geek Code, PGP Public Key,|
+ University of Louisville            PJ Harvey info, and other stuff...   +

- -----SNIP!-----
#!/usr/local/bin/perl

print "Content-type: text/html\n\n";

print "<STRONG>User/Group Info</STRONG><BR>\n";
print "<EM>Effective NAME/UID </EM>: ",(getpwuid($<))[0],"/$<<BR>\n";
print "<EM>Actual NAME/UID </EM>: ",(getpwuid($>))[0],"/$><BR>\n";
print "<EM>Effective GROUPS/GIDS </EM>: ";
foreach $group (split(/ /,$()) {
	print "",((getgrgid($group))[0]),"/$group ";
}
print "<BR>\n";
print "<EM>Actual GROUPS/GIDS </EM>: ";
foreach $group (split(/ /,$))) {
	print "",((getgrgid($group))[0]),"/$group ";
}
print "<BR>\n";

print "<STRONG>Environment Variables</STRONG><BR>\n";
while (($key, $val) = each %ENV) {
	print "<EM>$key</EM> = $val<BR>\n";
}



-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMi8C65o1JaC71RLxAQHWIQQAmZiTAkyEJWqr3ewxoH6l0GzbMDtOYzlP
e3iVcP9PUBi/1eqTbqYQ7bDjai6rKqgJRDCBnkq3ast7Ez8j+BUiqKMd2xAn/v31
hUT6okGkMl7Aq8gbWnlD9fH2xUigR86IDYLLiNqoE86urCw5TDJdKJH2iYGIt3+e
zw5zF6wAM3E=
=sHIb
-----END PGP SIGNATURE-----