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

Поиск
Список
Период
Сортировка
От pgsql-bugs@postgresql.org
Тема Bug #744: initdb --pwprompt=????
Дата
Msg-id 20020822144630.B60EA475EBB@postgresql.org
обсуждение исходный текст
Ответы Re: Bug #744: initdb --pwprompt=????  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
Przemyslaw Sztoch (psztoch@interia.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



В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #743: pg_dump -a -c without DELETE FROM
Следующее
От: Philip Warner
Дата:
Сообщение: Re: Bug #743: pg_dump -a -c without DELETE FROM