Commit Graph

35 Commits

Author SHA1 Message Date
Todd C. Miller
7a06f32cbb Preserve SHELL variable for "sudo -s". Otherwise we can end up
with a situation where the SHELL variable and the actual shell being
run do not match.
2011-06-13 07:20:28 -04:00
Todd C. Miller
42a3966a88 Minor warning/error cleanup 2011-05-18 13:44:36 -04:00
Todd C. Miller
b643b190a7 Prepare sudoers module messages for translation. 2011-05-16 16:32:05 -04:00
Todd C. Miller
53da5e8cdf Update copyright years. 2011-03-11 15:34:35 -05:00
Todd C. Miller
a092d2fdcf Move noexec handling to sudo front-end where it is documented as being. 2011-03-10 15:11:49 -05:00
Todd C. Miller
4527bdd9b4 Use %u to print uid/gid, not %lu and adjust casts to match. 2010-11-30 15:21:36 -05:00
Todd C. Miller
614e2a642c Preserve ODMDIR environment variable by default on AIX. 2010-09-27 14:08:54 -04:00
Todd C. Miller
ed45e68da9 Take MODE_LOGIN_SHELL into account when initially setting reset_home
instead of special-casing it later.
2010-09-14 11:44:33 -04:00
Todd C. Miller
ce942f18c0 Reset HOME for "sudo -i" even if HOME was listed in env_keep. 2010-09-14 11:28:40 -04:00
Todd C. Miller
1b9ca115b7 Make -H flag work when HOME is listed in env_keep. Also makes
"set_home" and "always_set_home" override override HOME in env_keep.
2010-09-09 16:16:39 -04:00
Todd C. Miller
3d48cae18c Set dupcheck to TRUE when setting new HOME value if !env_reset but
always_set_home is true.  Prevents a duplicate HOME in the environment
(old value plus the new one) introduced in f421f8827340.
2010-08-18 15:26:26 -04:00
Todd C. Miller
ee7221f1fe Reset HOME when env_reset is enabled unless it is in env_keep 2010-07-19 15:35:47 -04:00
Todd C. Miller
2eb1879fd7 Add PYTHONUSERBASE to initial_badenv_table 2010-07-19 12:54:01 -04:00
Todd C. Miller
69ecb34581 If env_reset is enabled, set the MAIL environment variable based
on the target user unless MAIL is explicitly preserved in sudoers.
2010-07-19 12:50:59 -04:00
Todd C. Miller
5b9e39ac87 Use _PATH_STDPATH instead of _PATH_DEFPATH 2010-07-12 18:07:52 -04:00
Todd C. Miller
d9de7b5f8e Add support for a sudo-i pam.d file to be used for "sudo -i".
Adapted from a RedHat patch.
2010-07-12 17:57:53 -04:00
Todd C. Miller
6229c0e206 Now that sudoers is a dynamically loaded module we cannot override
the libc environment functions because the symbols may already have
been resolved via libc.  Remove getenv/putenv/setenv/unsetenv
replacements from sudoers and add replacements for setenv/unsetenv
for systems that lack them.
2010-07-06 16:44:33 -04:00
Todd C. Miller
30fe4a067c Set usrinfo for AIX
Set adminstrative domain for the process when looking up user's
    password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
    different things.  Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
862d1675cc Do not rely on env.env_len when unsetting a variable, just use the
NULL terminator.
2010-06-29 09:26:55 -04:00
Todd C. Miller
0c0a02dfd1 In unsetenv() check for NULL or empty name as per POSIX 1003.1-2008 2010-06-29 09:10:43 -04:00
Todd C. Miller
39e072c713 Make env_init() void as it never fails. 2010-06-08 10:23:35 -04:00
Todd C. Miller
280afece30 No longer use _NSGetEnviron so don't need crt_externs.h 2010-06-08 09:55:36 -04:00
Todd C. Miller
26b5014238 Remove unused VNULL define 2010-06-08 09:44:19 -04:00
Todd C. Miller
c31ed2cd22 Handle duplicate variables in the environment. For unsetenv(),
keep looking even after remove the first instance.  For sudo_putenv(),
check for and remove dupes after we replace an existing value.
2010-05-28 09:42:50 -04:00
Todd C. Miller
832ce341e4 Add version of getenv(3) that uses our own environ pointer. 2010-05-13 10:20:40 -04:00
Todd C. Miller
754c1a16dd Initialize env_len in env_init() 2010-05-12 08:31:29 -04:00
Todd C. Miller
ac06e777fa Add missing check for NULL in validate_env_vars 2010-04-26 21:38:43 -04:00
Todd C. Miller
b041c91caf Re-enable environment files and setting environment variables on the
command line.
2010-04-26 17:14:11 -04:00
Todd C. Miller
257133328d Ansify env.c 2010-04-17 13:28:36 -04:00
Todd C. Miller
0df204052f Remove remaining references to the environ pointer. 2010-04-17 13:26:03 -04:00
Todd C. Miller
b71844daf7 Don't change the environ directly in the sudoers plugin 2010-04-16 07:56:16 -04:00
Todd C. Miller
fb87c040cc Add workaround for the lack of the environ pointer on Mac OS X
in dlopen()ed modules.  Use of environ in the sudoers plugin should
ultimately be removed but this will do for the moment.
2010-04-14 06:38:32 -04:00
Todd C. Miller
d5ae4c7d87 Kill __P in sudoers 2010-03-17 19:56:27 -04:00
Todd C. Miller
9b0205846b Initial bits of sudoers plugin; still needs work. 2010-03-14 19:58:47 -04:00
Todd C. Miller
e90fa482f9 Rework source layout in preparation for modular sudo. 2010-02-20 09:14:01 -05:00