ALT Linux repos
S: | 1.9.14p1-alt2.1 |
5.0: | 1.6.8p12-alt5 |
4.1: | 1.6.8p12-alt5.M41.1 |
4.0: | 1.6.8p12-alt5 |
+updates: | 1.6.8p12-alt5 |
3.0: | 1.6.7p5-alt5 |
Group :: System/Base
RPM: sudo
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: sudo-1.6.7p5-cvs-rebuild_env.patch
Download
Download
--- sudo-1.6.7p5/env.c.orig 2003-05-06 04:32:22 +0000
+++ sudo-1.6.7p5/env.c 2005-06-21 16:12:48 +0000
@@ -99,6 +99,7 @@
*/
static const char *initial_badenv_table[] = {
"IFS",
+ "CDPATH",
"LOCALDOMAIN",
"RES_OPTIONS",
"HOSTALIASES",
@@ -296,6 +297,13 @@ rebuild_env(sudo_mode, envp)
/* Pull in vars we want to keep from the old environment. */
for (ep = envp; *ep; ep++) {
keepit = 0;
+
+ /* Skip variables with values beginning with () (bash functions) */
+ if ((cp = strchr(*ep, '=')) != NULL) {
+ if (strncmp(cp, "=() ", 3) == 0)
+ continue;
+ }
+
for (cur = def_list(I_ENV_KEEP); cur; cur = cur->next) {
len = strlen(cur->value);
/* Deal with '*' wildcard */
@@ -370,6 +378,12 @@ rebuild_env(sudo_mode, envp)
for (ep = envp; *ep; ep++) {
okvar = 1;
+ /* Skip variables with values beginning with () (bash functions) */
+ if ((cp = strchr(*ep, '=')) != NULL) {
+ if (strncmp(cp, "=() ", 3) == 0)
+ continue;
+ }
+
/* Skip anything listed in env_delete. */
for (cur = def_list(I_ENV_DELETE); cur && okvar; cur = cur->next) {
len = strlen(cur->value);