#!/usr/bin/perl # prenviron - print the script's Unix running environment; CGI # Steve Kinzler, kinzler@cs.indiana.edu, Sep 94/Aug 00 # http://www.cs.indiana.edu/~kinzler/home.html#webadm if (0) { $out = "/tmp/prenviron$$"; open(OUT, "> $out"); select OUT; $seefile = "See $out"; } print STDOUT "Content-type: text/plain\n\n$seefile"; print $0; ($arg = shift) =~ s/'/'\\''/g, print " '$arg'" while @ARGV; print "\n"; chop($cwd = `pwd`); $umask = sprintf("%03o", umask); $ruser = (getpwuid($<))[0] || $<; $euser = ($> == $<) ? $ruser : (getpwuid($>))[0] || $>; $rgroups = &gids2groups($(); $egroups = &gids2groups($)); print "\n", <