Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e94fffc

Browse files
committed
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
1 parent f45ec44 commit e94fffc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/bin/destroyuser/destroyuser.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.10 1998/09/01 15:57:00 thomas Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.11 1999/03/14 16:00:55 momjian Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -79,9 +79,10 @@ then
7979
exit 1
8080
fi
8181

82-
if [ $ADDUSER != "t" ]
82+
if [ x$ADDUSER != xt ]
8383
then
8484
echo "$CMDNAME: $USER cannot delete users."
85+
exit 1
8586
fi
8687

8788
#
@@ -152,7 +153,7 @@ then
152153
#
153154

154155
yn=f
155-
while [ $yn != y -a $yn != n ]
156+
while [ "$yn" != y -a "$yn" != n ]
156157
do
157158
echo PG_OPT_DASH_N_PARAM "Deleting user $DELUSER will destroy them. Continue (y/n)? PG_OPT_BACKSLASH_C_PARAM"
158159
read yn

0 commit comments

Comments
 (0)