Commit e94fffc1 authored by Bruce Momjian's avatar Bruce Momjian

This patch improves the destroyuser script's behaviour in checking whether

the user is allowed to detroy users.  It also allows for a possible incorrect
empty reply to a yes/no question.


Oliver Elphick
parent f45ec44c
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.10 1998/09/01 15:57:00 thomas Exp $ # $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.11 1999/03/14 16:00:55 momjian Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
...@@ -79,9 +79,10 @@ then ...@@ -79,9 +79,10 @@ then
exit 1 exit 1
fi fi
if [ $ADDUSER != "t" ] if [ x$ADDUSER != xt ]
then then
echo "$CMDNAME: $USER cannot delete users." echo "$CMDNAME: $USER cannot delete users."
exit 1
fi fi
# #
...@@ -152,7 +153,7 @@ then ...@@ -152,7 +153,7 @@ then
# #
yn=f yn=f
while [ $yn != y -a $yn != n ] while [ "$yn" != y -a "$yn" != n ]
do do
echo PG_OPT_DASH_N_PARAM "Deleting user $DELUSER will destroy them. Continue (y/n)? PG_OPT_BACKSLASH_C_PARAM" echo PG_OPT_DASH_N_PARAM "Deleting user $DELUSER will destroy them. Continue (y/n)? PG_OPT_BACKSLASH_C_PARAM"
read yn read yn
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment