Download | Plain Text | No Line Numbers


  1. --- support/suexec.c.orig Wed Jul 12 09:40:55 2006
  2. +++ support/suexec.c Sat May 12 01:42:34 2007
  3. @@ -228,6 +228,18 @@
  4. environ = cleanenv;
  5. }
  6.  
  7. +static void addto_env(char *name, char *value)
  8. +{
  9. + char envbuf[512];
  10. + int idx;
  11. +
  12. + sprintf(envbuf, "%s=%s", name, value);
  13. + for(idx = 0; environ[idx]; idx++);
  14. + environ[idx] = strdup(envbuf);
  15. + idx++;
  16. + environ[idx] = NULL;
  17. +}
  18. +
  19. int main(int argc, char *argv[])
  20. {
  21. int userdir = 0; /* ~userdir flag */
  22. @@ -595,6 +607,7 @@
  23. /*
  24. * Execute the command, replacing our image with its own.
  25. */
  26. + addto_env("USER", actual_uname);
  27. #ifdef NEED_HASHBANG_EMUL
  28. /* We need the #! emulation when we want to execute scripts */
  29. {
  30.