Mantis 402.
[profile.git] / opt / bin / became
index 245f75b..694810d 100755 (executable)
@@ -1,11 +1,8 @@
 #!/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
+file="${TMPDIR:-/tmp}/$SUDO_USER.became.$USER.$RANDOM.$$"
+( umask 077; cat > "$file"; echo "/bin/rm -f '$file'" >> "$file" )
+exec </dev/tty /bin/bash --rcfile "$file"
 # Fall back to the shell.
-  exec </dev/tty /bin/bash
-fi
+exec </dev/tty /bin/bash
 exit 111