diff options
author | Tavis Ormandy <taviso@gentoo.org> | 2004-11-11 23:25:15 +0000 |
---|---|---|
committer | Tavis Ormandy <taviso@gentoo.org> | 2004-11-11 23:25:15 +0000 |
commit | 9ddd1e1f598e77087bb0c02ba4b100b098329ce2 (patch) | |
tree | 1732cf298d97f21989097d5fdfe6817e9b263de8 /app-admin/sudo | |
parent | fix typo (Manifest recommit) (diff) | |
download | gentoo-2-9ddd1e1f598e77087bb0c02ba4b100b098329ce2.tar.gz gentoo-2-9ddd1e1f598e77087bb0c02ba4b100b098329ce2.tar.bz2 gentoo-2-9ddd1e1f598e77087bb0c02ba4b100b098329ce2.zip |
strip bash functions from environment
Diffstat (limited to 'app-admin/sudo')
-rw-r--r-- | app-admin/sudo/files/sudo-strip-bash-functions.diff | 44 | ||||
-rw-r--r-- | app-admin/sudo/sudo-1.6.8_p1-r2.ebuild | 3 |
2 files changed, 46 insertions, 1 deletions
diff --git a/app-admin/sudo/files/sudo-strip-bash-functions.diff b/app-admin/sudo/files/sudo-strip-bash-functions.diff new file mode 100644 index 000000000000..1bd6d6483508 --- /dev/null +++ b/app-admin/sudo/files/sudo-strip-bash-functions.diff @@ -0,0 +1,44 @@ +Index: env.c +=================================================================== +RCS file: /home/cvs/courtesan/sudo/env.c,v +retrieving revision 1.42 +retrieving revision 1.43 +diff -u -r1.42 -r1.43 +--- env.c 8 Sep 2004 15:57:49 -0000 1.42 ++++ env.c 11 Nov 2004 16:20:59 -0000 1.43 +@@ -52,7 +52,7 @@ + #include "sudo.h" + + #ifndef lint +-static const char rcsid[] = "$Sudo: env.c,v 1.42 2004/09/08 15:57:49 millert Exp $"; ++static const char rcsid[] = "$Sudo: env.c,v 1.43 2004/11/11 16:20:59 millert Exp $"; + #endif /* lint */ + + /* +@@ -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) { diff --git a/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild b/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild index 3749a8dba87c..f4f6b8e2e133 100644 --- a/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild +++ b/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild,v 1.1 2004/11/11 23:15:15 taviso Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.6.8_p1-r2.ebuild,v 1.2 2004/11/11 23:25:15 taviso Exp $ inherit gnuconfig eutils @@ -29,6 +29,7 @@ src_unpack() { epatch ${FILESDIR}/${P}-suid_fix.patch use skey && epatch ${FILESDIR}/${PN}-skeychallengeargs.diff + epatch ${FILESDIR}/sudo-strip-bash-functions.diff } src_compile() { |