From 09eb9824be8828dfcd52a679e85007388c098688 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Wed, 17 Mar 2010 13:28:57 +0000 Subject: [PATCH] Exploit bash POSIXLY_CORRECT mode. Avoid ugly --rcfile lines in ps output by exploiting the fact that a POSIX mode bash will read startup commands from the file specified in ENV. Set ENV and POSIXLY_CORRECT for startup, unsetting them and disabling POSIX mode as the first actions in the new shell. --- opt/bin/became | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opt/bin/became b/opt/bin/became index 694810d..ca1a523 100755 --- a/opt/bin/became +++ b/opt/bin/became @@ -1,8 +1,8 @@ #!/bin/bash file="${TMPDIR:-/tmp}/$SUDO_USER.became.$USER.$RANDOM.$$" -( umask 077; cat > "$file"; echo "/bin/rm -f '$file'" >> "$file" ) -exec "$file"; cat >> "$file"; echo "/bin/rm -f '$file'" >> "$file" ) +exec