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

Commit 4699d81

Browse files
committed
Add ENCRYPTED/UNENCRYPTED control in createuser script.
1 parent 0927d99 commit 4699d81

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

doc/src/sgml/ref/createuser.sgml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.17 2001/05/02 14:46:33 momjian Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.18 2001/08/25 17:46:11 momjian Exp $
33
Postgres documentation
44
-->
55

@@ -132,6 +132,26 @@ Postgres documentation
132132
</listitem>
133133
</varlistentry>
134134

135+
<varlistentry>
136+
<term>--encrypted</term>
137+
<listitem>
138+
<para>
139+
Encrypts the user's password stored in the database. If not
140+
specified, the default is used.
141+
</para>
142+
</listitem>
143+
</varlistentry>
144+
145+
<varlistentry>
146+
<term>--unencrypted</term>
147+
<listitem>
148+
<para>
149+
Does not encrypt the user's password stored in the database. If
150+
not specified, the default is used.
151+
</para>
152+
</listitem>
153+
</varlistentry>
154+
135155
<varlistentry>
136156
<term><replaceable class="parameter">username</replaceable></term>
137157
<listitem>

src/bin/scripts/createuser

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
#
1111
# IDENTIFICATION
12-
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.17 2001/02/18 18:34:01 momjian Exp $
12+
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.18 2001/08/25 17:46:11 momjian Exp $
1313
#
1414
# Note - this should NOT be setuid.
1515
#
@@ -25,6 +25,7 @@ CanCreateDb=
2525
PwPrompt=
2626
Password=
2727
PSQLOPT=
28+
Encrypted= # blank uses default
2829

2930
# Check for echo -n vs echo \c
3031

@@ -103,6 +104,12 @@ do
103104
--sysid=*)
104105
SysID=`echo "$1" | sed 's/^--sysid=//'`
105106
;;
107+
--encrypted)
108+
Encrypted=t
109+
;;
110+
--unencrypted)
111+
Encrypted=f
112+
;;
106113
-i*)
107114
SysID=`echo "$1" | sed 's/^-i//'`
108115
;;
@@ -226,6 +233,8 @@ SUBQUERY=
226233
[ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
227234
[ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER"
228235
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
236+
[ "$Encrypted" = t ] && QUERY="$QUERY ENCRYPTED"
237+
[ "$Encrypted" = f ] && QUERY="$QUERY UNENCRYPTED"
229238

230239
${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
231240
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)