Bug #744: initdb --pwprompt=????

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #744: initdb --pwprompt=????
Date: 2002-08-22 14:46:30
Message-ID: 20020822144630.B60EA475EBB@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Przemyslaw Sztoch (psztoch(at)interia(dot)pl) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
initdb --pwprompt=????

Long Description
I propose add to initdb --pwprompt= parameters with password argument.

Sample Code
--- initdb-orig 2002-08-21 17:41:35.000000000 +0200
+++ initdb 2002-08-08 18:41:26.000000000 +0200
@@ -221,6 +221,11 @@
--pwprompt|-W)
PwPrompt=1
;;
+# The default password of the database superuser.
+ --pwprompt=*)
+ FirstPw=`echo $1 | sed 's/^--pwprompt=//'`
+ PwPrompt=1
+ ;;
# Directory where to install the data. No default, unless the environment
# variable PGDATA is set.
--pgdata|-D)
@@ -520,19 +525,22 @@

# set up password
if [ "$PwPrompt" ]; then
- $ECHO_N "Enter new superuser password: "$ECHO_C
- stty -echo > /dev/null 2>&1
- read FirstPw
- stty echo > /dev/null 2>&1
- echo
- $ECHO_N "Enter it again: "$ECHO_C
- stty -echo > /dev/null 2>&1
- read SecondPw
- stty echo > /dev/null 2>&1
- echo
- if [ "$FirstPw" != "$SecondPw" ]; then
- echo "Passwords didn't match." 1>&2
- exit_nicely
+ if [ "$FirstPw" ]; then
+ else
+ $ECHO_N "Enter new superuser password: "$ECHO_C
+ stty -echo > /dev/null 2>&1
+ read FirstPw
+ stty echo > /dev/null 2>&1
+ echo
+ $ECHO_N "Enter it again: "$ECHO_C
+ stty -echo > /dev/null 2>&1
+ read SecondPw
+ stty echo > /dev/null 2>&1
+ echo
+ if [ "$FirstPw" != "$SecondPw" ]; then
+ echo "Passwords didn't match." 1>&2
+ exit_nicely
+ fi
fi
$ECHO_N "setting password... "$ECHO_C
"$PGPATH"/postgres $PGSQL_OPT template1 >/dev/null <<EOF

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Philip Warner 2002-08-22 14:49:47 Re: Bug #743: pg_dump -a -c without DELETE FROM
Previous Message pgsql-bugs 2002-08-22 14:40:24 Bug #743: pg_dump -a -c without DELETE FROM