version 1.1.1.4, 2013/07/22 10:46:12
|
version 1.1.1.5, 2013/10/14 07:56:34
|
Line 366 sudo_putenv(char *str, bool dupcheck, bool overwrite)
|
Line 366 sudo_putenv(char *str, bool dupcheck, bool overwrite)
|
if (env.envp[env.env_len] != NULL) |
if (env.envp[env.env_len] != NULL) |
fatalx(_("sudo_putenv: corrupted envp, length mismatch")); |
fatalx(_("sudo_putenv: corrupted envp, length mismatch")); |
#endif |
#endif |
fatalx(NULL); | fatal(NULL); |
} |
} |
debug_return_int(rval); |
debug_return_int(rval); |
} |
} |
Line 545 sudo_getenv(const char *name)
|
Line 545 sudo_getenv(const char *name)
|
} |
} |
|
|
/* |
/* |
* Merge another environment with our private copy. |
|
*/ |
|
void |
|
env_merge(char * const envp[], bool overwrite) |
|
{ |
|
char * const *ep; |
|
debug_decl(env_merge, SUDO_DEBUG_ENV) |
|
|
|
for (ep = envp; *ep != NULL; ep++) |
|
sudo_putenv(*ep, true, overwrite); |
|
|
|
debug_return; |
|
} |
|
|
|
/* |
|
* Check the env_delete blacklist. |
* Check the env_delete blacklist. |
* Returns true if the variable was found, else false. |
* Returns true if the variable was found, else false. |
*/ |
*/ |
Line 693 env_should_keep(const char *var)
|
Line 678 env_should_keep(const char *var)
|
sudo_debug_printf(SUDO_DEBUG_INFO, "keep %s: %s", |
sudo_debug_printf(SUDO_DEBUG_INFO, "keep %s: %s", |
var, keepit ? "YES" : "NO"); |
var, keepit ? "YES" : "NO"); |
debug_return_bool(keepit == true); |
debug_return_bool(keepit == true); |
|
} |
|
|
|
/* |
|
* Merge another environment with our private copy. |
|
* Only overwrite an existing variable if it is not |
|
* being preserved from the user's environment. |
|
*/ |
|
void |
|
env_merge(char * const envp[]) |
|
{ |
|
char * const *ep; |
|
debug_decl(env_merge, SUDO_DEBUG_ENV) |
|
|
|
for (ep = envp; *ep != NULL; ep++) |
|
sudo_putenv(*ep, true, !env_should_keep(*ep)); |
|
|
|
debug_return; |
} |
} |
|
|
static void |
static void |