OpenPKG CVS Repository
http://cvs.openpkg.org/
____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall
Root: /v/openpkg/cvs Email: [EMAIL PROTECTED]
Module: openpkg-src Date: 04-Sep-2007 19:09:58
Branch: HEAD Handle: 2007090418095401
Modified files:
openpkg-src/dbmail dbmail-setup.sh dbmail.spec
Log:
try to fix the PostgreSQL password reading issue inside a FreeBSD jail
(where /dev/tty cannot be opened by psql and hence stdin is used which
in turn fails): ask for the password manually and pass it to psql with
the PGPASSWORD variable
Summary:
Revision Changes Path
1.9 +4 -4 openpkg-src/dbmail/dbmail-setup.sh
1.24 +1 -0 openpkg-src/dbmail/dbmail.spec
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: openpkg-src/dbmail/dbmail-setup.sh
============================================================================
$ cvs diff -u -r1.8 -r1.9 dbmail-setup.sh
--- openpkg-src/dbmail/dbmail-setup.sh 27 Aug 2007 19:00:08 -0000
1.8
+++ openpkg-src/dbmail/dbmail-setup.sh 4 Sep 2007 17:09:54 -0000
1.9
@@ -1,4 +1,4 @@
-#!/bin/sh
[EMAIL PROTECTED]@
##
## dbmail-setup.sh -- DBMail RDBMS Setup Utility
##
@@ -33,7 +33,7 @@
sed -e 's;^password[^=]*= *;;' -e 's; *$;;'`
elif [ ".$db_type" = .pgsql ]; then
db_suser="postgresql"
- db_spass="" # has to be interactive
+ read -s -p "Password for PostgreSQL user \"$db_suser\": " db_spass
fi
# dispatch operation
@@ -63,7 +63,7 @@
( echo "CREATE ROLE $db_user LOGIN ENCRYPTED PASSWORD '$db_pass'
NOCREATEDB NOCREATEUSER;"
echo "CREATE TABLESPACE $db_name OWNER $db_user LOCATION
'$db_dir';"
echo "CREATE DATABASE $db_name OWNER $db_user TABLESPACE
$db_name;"
- ) | @l_prefix@/bin/psql -q -W -U "$db_suser" -d template1 -f-
+ ) | PGPASSWORD="$db_spass" @l_prefix@/bin/psql -q -U "$db_suser"
-d template1 -f-
PGPASSWORD="$db_pass" @l_prefix@/bin/psql -q -U "$db_user" -d
"$db_name" -f- <$db_script
fi
;;
@@ -78,7 +78,7 @@
( echo "DROP DATABASE $db_name;"
echo "DROP TABLESPACE $db_name;"
echo "DROP ROLE $db_user;"
- ) | @l_prefix@/bin/psql -q -W -U "$db_suser" -d template1 -f-
+ ) | PGPASSWORD="$db_spass" @l_prefix@/bin/psql -q -U "$db_suser"
-d template1 -f-
fi
;;
esac
@@ .
patch -p0 <<'@@ .'
Index: openpkg-src/dbmail/dbmail.spec
============================================================================
$ cvs diff -u -r1.23 -r1.24 dbmail.spec
--- openpkg-src/dbmail/dbmail.spec 3 Sep 2007 23:21:13 -0000 1.23
+++ openpkg-src/dbmail/dbmail.spec 4 Sep 2007 17:09:55 -0000 1.24
@@ -206,6 +206,7 @@
%{l_shtool} install -c -m 644 \
$db_script $RPM_BUILD_ROOT%{l_prefix}/share/dbmail/dbmail-setup.sql
%{l_shtool} install -c -m 755 %{l_value -s -a} \
+ -e "s;@l_bash@;%{l_bash};g" \
-e "s;@db_type@;$db_type;g" \
%{SOURCE dbmail-setup.sh}
$RPM_BUILD_ROOT%{l_prefix}/sbin/dbmail-setup
@@ .
______________________________________________________________________
OpenPKG http://openpkg.org
CVS Repository Commit List [email protected]