Don't leak file descriptor.
authorIain Patterson <me@iain.cx>
Thu, 18 Mar 2010 22:23:05 +0000 (22:23 +0000)
committerIain Patterson <me@iain.cx>
Thu, 18 Mar 2010 22:23:05 +0000 (22:23 +0000)
opt/bin/become

index db45e55..875bd0b 100755 (executable)
@@ -68,6 +68,7 @@ echo >&3 ". $HOME/.bash_profile"
 [ -f "$BECOME/all" ] && cat >&3 2>/dev/null "$BECOME/all"
 [ -f "$BECOME/$user" ] && cat >&3 2>/dev/null "$BECOME/$user"
 
+exec 3>&-
 dir=$(dirname "$0")
 [ "$dir" = "." ] && dir="$PWD"
 exec sudo -H -u "$user" "$dir/became"