Kubernetes stuff.
[profile.git] / opt / bin / became
index 245f75b..7f7abf1 100755 (executable)
@@ -1,11 +1,6 @@
 #!/bin/bash
 
-file="$(mktemp)"
-if [ -n "$file" ]; then
-  ( umask 077; cat > "$file"; echo "/bin/rm -f '$file'" >> "$file" )
-  exec </dev/tty /bin/bash --rcfile "$file"
-else
-# Fall back to the shell.
-  exec </dev/tty /bin/bash
-fi
+file="${TMPDIR:-/tmp}/$SUDO_USER.became.$USER.$RANDOM.$$"
+( builtin umask 077; echo "unset ENV POSIXLY_CORRECT; set +o posix" > "$file"; cat >> "$file"; echo "/bin/rm -f '$file'" >> "$file" )
+exec </dev/tty env ENV="$file" POSIXLY_CORRECT=1 /bin/bash
 exit 111