Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf7c4ec5

Browse files
committed
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.
1 parent36c1895 commitf7c4ec5

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

‎src/bin/createuser/createuser.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.10 1998/08/22 05:19:17 momjian Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.11 1999/01/31 05:04:25 scrappy Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -74,7 +74,7 @@ PARGS="-tq $AUTHOPT $PGHOSTOPT $PGPORTOPT"
7474
PSQL="psql$PARGS"
7575

7676
#
77-
# see if user $USER isallowed to create new users
77+
# see if user $USER isa superuser
7878
#
7979

8080
QUERY="select usesuper from pg_user where usename = '$USER'"
@@ -203,7 +203,7 @@ then
203203

204204
while ["$yn"!= y-a"$yn"!= n ]
205205
do
206-
echo PG_OPT_DASH_N_PARAM"Is user\"$NEWUSER\"allowed to add users? (y/n) PG_OPT_BACKSLASH_C_PARAM"
206+
echo PG_OPT_DASH_N_PARAM"Is user\"$NEWUSER\"a superuser? (y/n) PG_OPT_BACKSLASH_C_PARAM"
207207
read yn
208208
done
209209

@@ -234,6 +234,14 @@ else
234234
echo"$CMDNAME:$NEWUSER was successfully added"
235235
if ["$CANCREATE"= f ]
236236
then
237-
echo"don't forget to create a database for$NEWUSER"
238-
fi
237+
echo PG_OPT_DASH_N_PARAM"Shall I create a database for\"$NEWUSER\" (y/n) PG_OPT_BACKSLASH_C_PARAM"
238+
read yn
239+
240+
if ["$yn"= y ]
241+
then
242+
createdb$NEWUSER
243+
else
244+
echo"don't forget to create a database for$NEWUSER"
245+
fi
246+
fi
239247
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp