bail out if we're another user but our env is still from olduser - prevent clobbering our db file
This commit is contained in:
1 parent
84837e575f
commit
d96f3c99ec
1 file changed
+3
@@ -24,6 +24,9 @@ z() {
|
|||||||
|
|
||||||
local datafile="$HOME/.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
|
# add entries
|
||||||
if [ "$1" = "--add" ]; then
|
if [ "$1" = "--add" ]; then
|
||||||
shift
|
shift
|
||||||
|
|||||||
Reference in new issue
Block a user