Download | Plain Text | Line Numbers
--- support/suexec.c.orig Wed Jul 12 09:40:55 2006
+++ support/suexec.c Sat May 12 01:42:34 2007
@@ -228,6 +228,18 @@
environ = cleanenv;
}
+static void addto_env(char *name, char *value)
+{
+ char envbuf[512];
+ int idx;
+
+ sprintf(envbuf, "%s=%s", name, value);
+ for(idx = 0; environ[idx]; idx++);
+ environ[idx] = strdup(envbuf);
+ idx++;
+ environ[idx] = NULL;
+}
+
int main(int argc, char *argv[])
{
int userdir = 0; /* ~userdir flag */
@@ -595,6 +607,7 @@
/*
* Execute the command, replacing our image with its own.
*/
+ addto_env("USER", actual_uname);
#ifdef NEED_HASHBANG_EMUL
/* We need the #! emulation when we want to execute scripts */
{