=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/env.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/sudo/Attic/env.c 2004/09/28 15:10:51 1.9 +++ src/usr.bin/sudo/Attic/env.c 2004/11/12 16:37:38 1.10 @@ -323,6 +323,13 @@ /* 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_env_keep; cur; cur = cur->next) { len = strlen(cur->value); /* Deal with '*' wildcard */ @@ -404,6 +411,12 @@ */ 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_env_delete; cur && okvar; cur = cur->next) {