Commit 4699d81d authored by Bruce Momjian's avatar Bruce Momjian

Add ENCRYPTED/UNENCRYPTED control in createuser script.

parent 0927d992
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.17 2001/05/02 14:46:33 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v 1.18 2001/08/25 17:46:11 momjian Exp $
Postgres documentation Postgres documentation
--> -->
...@@ -132,6 +132,26 @@ Postgres documentation ...@@ -132,6 +132,26 @@ Postgres documentation
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>--encrypted</term>
<listitem>
<para>
Encrypts the user's password stored in the database. If not
specified, the default is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>--unencrypted</term>
<listitem>
<para>
Does not encrypt the user's password stored in the database. If
not specified, the default is used.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term><replaceable class="parameter">username</replaceable></term> <term><replaceable class="parameter">username</replaceable></term>
<listitem> <listitem>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.17 2001/02/18 18:34:01 momjian Exp $ # $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.18 2001/08/25 17:46:11 momjian Exp $
# #
# Note - this should NOT be setuid. # Note - this should NOT be setuid.
# #
...@@ -25,6 +25,7 @@ CanCreateDb= ...@@ -25,6 +25,7 @@ CanCreateDb=
PwPrompt= PwPrompt=
Password= Password=
PSQLOPT= PSQLOPT=
Encrypted= # blank uses default
# Check for echo -n vs echo \c # Check for echo -n vs echo \c
...@@ -103,6 +104,12 @@ do ...@@ -103,6 +104,12 @@ do
--sysid=*) --sysid=*)
SysID=`echo "$1" | sed 's/^--sysid=//'` SysID=`echo "$1" | sed 's/^--sysid=//'`
;; ;;
--encrypted)
Encrypted=t
;;
--unencrypted)
Encrypted=f
;;
-i*) -i*)
SysID=`echo "$1" | sed 's/^-i//'` SysID=`echo "$1" | sed 's/^-i//'`
;; ;;
...@@ -226,6 +233,8 @@ SUBQUERY= ...@@ -226,6 +233,8 @@ SUBQUERY=
[ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB" [ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
[ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER" [ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER"
[ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER" [ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER"
[ "$Encrypted" = t ] && QUERY="$QUERY ENCRYPTED"
[ "$Encrypted" = f ] && QUERY="$QUERY UNENCRYPTED"
${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT ${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
......
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