--- sudo-1.6.7p5/env.c.expansion	2005-07-07 12:02:52.000000000 -0500
+++ sudo-1.6.7p5/env.c	2005-07-07 12:03:51.000000000 -0500
@@ -296,6 +296,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_list(I_ENV_KEEP); cur; cur = cur->next) {
 		len = strlen(cur->value);
 		/* Deal with '*' wildcard */
@@ -370,6 +377,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_list(I_ENV_DELETE); cur && okvar; cur = cur->next) {
 		len = strlen(cur->value);
