Encryption addition to createuser - Mailing list pgsql-patches

From Bruce Momjian
Subject Encryption addition to createuser
Date
Msg-id 200108251745.f7PHjuJ05984@candle.pha.pa.us
Whole thread Raw
List pgsql-patches
Attached is a patch that allows ENCRYPTED/UNENCRYPTED control in the
createuser script.

Applied.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
Index: doc/src/sgml/ref/createuser.sgml
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v
retrieving revision 1.17
diff -c -r1.17 createuser.sgml
*** doc/src/sgml/ref/createuser.sgml    2001/05/02 14:46:33    1.17
--- doc/src/sgml/ref/createuser.sgml    2001/08/25 17:35:48
***************
*** 133,138 ****
--- 133,158 ----
       </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>
        <term><replaceable class="parameter">username</replaceable></term>
        <listitem>
         <para>
Index: src/bin/scripts/createuser
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/bin/scripts/createuser,v
retrieving revision 1.17
diff -c -r1.17 createuser
*** src/bin/scripts/createuser    2001/02/18 18:34:01    1.17
--- src/bin/scripts/createuser    2001/08/25 17:35:49
***************
*** 25,30 ****
--- 25,31 ----
  PwPrompt=
  Password=
  PSQLOPT=
+ Encrypted=    # blank uses default

  # Check for echo -n vs echo \c

***************
*** 103,108 ****
--- 104,115 ----
          --sysid=*)
                  SysID=`echo "$1" | sed 's/^--sysid=//'`
                  ;;
+         --encrypted)
+         Encrypted=t
+         ;;
+         --unencrypted)
+         Encrypted=f
+         ;;
          -i*)
                  SysID=`echo "$1" | sed 's/^-i//'`
                  ;;
***************
*** 226,231 ****
--- 233,240 ----
  [ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
  [ "$CanAddUser" = t ] &&  QUERY="$QUERY CREATEUSER"
  [ "$CanAddUser" = f ] &&  QUERY="$QUERY NOCREATEUSER"
+ [ "$Encrypted" = t ] &&   QUERY="$QUERY ENCRYPTED"
+ [ "$Encrypted" = f ] &&   QUERY="$QUERY UNENCRYPTED"

  ${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT
  if [ $? -ne 0 ]; then
Index: doc/src/sgml/ref/createuser.sgml
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/doc/src/sgml/ref/createuser.sgml,v
retrieving revision 1.17
diff -c -r1.17 createuser.sgml
*** doc/src/sgml/ref/createuser.sgml    2001/05/02 14:46:33    1.17
--- doc/src/sgml/ref/createuser.sgml    2001/08/25 17:35:48
***************
*** 133,138 ****
--- 133,158 ----
       </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>
        <term><replaceable class="parameter">username</replaceable></term>
        <listitem>
         <para>
Index: src/bin/scripts/createuser
===================================================================
RCS file: /home/projects/pgsql/cvsroot/pgsql/src/bin/scripts/createuser,v
retrieving revision 1.17
diff -c -r1.17 createuser
*** src/bin/scripts/createuser    2001/02/18 18:34:01    1.17
--- src/bin/scripts/createuser    2001/08/25 17:35:49
***************
*** 25,30 ****
--- 25,31 ----
  PwPrompt=
  Password=
  PSQLOPT=
+ Encrypted=    # blank uses default

  # Check for echo -n vs echo \c

***************
*** 103,108 ****
--- 104,115 ----
          --sysid=*)
                  SysID=`echo "$1" | sed 's/^--sysid=//'`
                  ;;
+         --encrypted)
+         Encrypted=t
+         ;;
+         --unencrypted)
+         Encrypted=f
+         ;;
          -i*)
                  SysID=`echo "$1" | sed 's/^-i//'`
                  ;;
***************
*** 226,231 ****
--- 233,240 ----
  [ "$CanCreateDb" = f ] && QUERY="$QUERY NOCREATEDB"
  [ "$CanAddUser" = t ] &&  QUERY="$QUERY CREATEUSER"
  [ "$CanAddUser" = f ] &&  QUERY="$QUERY NOCREATEUSER"
+ [ "$Encrypted" = t ] &&   QUERY="$QUERY ENCRYPTED"
+ [ "$Encrypted" = f ] &&   QUERY="$QUERY UNENCRYPTED"

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

pgsql-patches by date:

Previous
From: Vsevolod Lobko
Date:
Subject: Re: Patch for pl/tcl Tcl_ExternalToUtf and Tcl_UtfToExternal support
Next
From: Rene Pijlman
Date:
Subject: Fix for compile error clog.c