Comment 6 for bug 982684

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Sudo already parses /etc/environment when used with the -i option. If our goal is to have it always parse /etc/environment, how about simply doing the following?

Index: sudo-1.8.3p1/plugins/sudoers/sudoers.c
===================================================================
--- sudo-1.8.3p1.orig/plugins/sudoers/sudoers.c 2011-10-25 10:08:12.000000000 -0400
+++ sudo-1.8.3p1/plugins/sudoers/sudoers.c 2012-05-15 20:40:38.997780972 -0400
@@ -581,12 +581,12 @@
      NewArgv[0] = NewArgv[1];
      NewArgv[1] = "--login";
  }
+ }

 #if defined(__linux__) || defined(_AIX)
  /* Insert system-wide environment variables. */
  read_env_file(_PATH_ENVIRONMENT, TRUE);
 #endif
- }

     /* Insert system-wide environment variables. */
     if (def_env_file)

I still need to think about the security ramifications in doing so though.