aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1999-01-31 05:04:25 +0000
committerMarc G. Fournier <scrappy@hub.org>1999-01-31 05:04:25 +0000
commitf7c4ec5085b1fe2ae9e5d924702a502748c41acc (patch)
treeda0c5feec38b36d068815b43cf0e90843acf1bf1 /src
parent36c18955330e8bbc4f49c5bf89540eff3f4bb377 (diff)
downloadpostgresql-f7c4ec5085b1fe2ae9e5d924702a502748c41acc.tar.gz
postgresql-f7c4ec5085b1fe2ae9e5d924702a502748c41acc.zip
From: D'Arcy J.M. Cain <darcy@druid.net>
The following patch does two things. - Clarifies what the effect of allowing users to add new users (Thet become super-users.) - Makes the default database for the new user if they are not allowed to and the user agrees to create it.
Diffstat (limited to 'src')
-rw-r--r--src/bin/createuser/createuser.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/bin/createuser/createuser.sh b/src/bin/createuser/createuser.sh
index 49e8aeed5be..8d3fc90fe1e 100644
--- a/src/bin/createuser/createuser.sh
+++ b/src/bin/createuser/createuser.sh
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.10 1998/08/22 05:19:17 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.11 1999/01/31 05:04:25 scrappy Exp $
#
# Note - this should NOT be setuid.
#
@@ -74,7 +74,7 @@ PARGS="-tq $AUTHOPT $PGHOSTOPT $PGPORTOPT"
PSQL="psql $PARGS"
#
-# see if user $USER is allowed to create new users
+# see if user $USER is a superuser
#
QUERY="select usesuper from pg_user where usename = '$USER' "
@@ -203,7 +203,7 @@ then
while [ "$yn" != y -a "$yn" != n ]
do
- echo PG_OPT_DASH_N_PARAM "Is user \"$NEWUSER\" allowed to add users? (y/n) PG_OPT_BACKSLASH_C_PARAM"
+ echo PG_OPT_DASH_N_PARAM "Is user \"$NEWUSER\" a superuser? (y/n) PG_OPT_BACKSLASH_C_PARAM"
read yn
done
@@ -234,6 +234,14 @@ else
echo "$CMDNAME: $NEWUSER was successfully added"
if [ "$CANCREATE" = f ]
then
- echo "don't forget to create a database for $NEWUSER"
- fi
+ echo PG_OPT_DASH_N_PARAM "Shall I create a database for \"$NEWUSER\" (y/n) PG_OPT_BACKSLASH_C_PARAM"
+ read yn
+
+ if [ "$yn" = y ]
+ then
+ createdb $NEWUSER
+ else
+ echo "don't forget to create a database for $NEWUSER"
+ fi
+ fi
fi