bail out if we're another user but our env is still from olduser - prevent clobbering our db file

This commit is contained in:
rupa committed 2011-04-14 08:28:08 -04:00
1 parent 84837e575f
commit d96f3c99ec
1 file changed
+3
+3
View File
@@ -24,6 +24,9 @@ z() {
local datafile="$HOME/.z"
# bail out if we don't own ~/.z (we're another user but our ENV is still set)
[ "$(ls -l "$datafile" | cut -d' ' -f 3)" = "$USER" ] || return
# add entries
if [ "$1" = "--add" ]; then
shift