From: Iain Patterson Date: Thu, 18 Mar 2010 22:23:05 +0000 (+0000) Subject: Don't leak file descriptor. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=500ba2b170e6f1bfad014c9bca55e19225a9bbe8;p=profile.git Don't leak file descriptor. --- diff --git a/opt/bin/become b/opt/bin/become index db45e55..875bd0b 100755 --- a/opt/bin/become +++ b/opt/bin/become @@ -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"