1 --- libnss-pgsql-1.5.0-beta/src/backend.c.org 2010-10-24 17:31:49.876094000 +0200
2 +++ libnss-pgsql-1.5.0-beta/src/backend.c 2010-10-24 17:37:28.251898000 +0200
3 @@ -87,7 +87,12 @@ int backend_open(char type)
4 if(PQstatus(_shadowconn) == CONNECTION_OK) {
7 - print_msg("\nCould not connect to database (shadow)\n");
8 + _conn = PQconnectdb(getcfg("shadowconnectionstring2"));
9 + if(PQstatus(_shadowconn) == CONNECTION_OK) {
12 + print_msg("\nCould not connect to database (shadow)\n");
17 @@ -105,7 +110,12 @@ int backend_open(char type)
18 if(PQstatus(_conn) == CONNECTION_OK) {
21 - print_msg("\nCould not connect to database\n");
22 + _conn = PQconnectdb(getcfg("connectionstring2"));
23 + if(PQstatus(_conn) == CONNECTION_OK) {
26 + print_msg("\nCould not connect to database\n");
31 --- libnss-pgsql-1.5.0-beta/conf/nss-pgsql.conf.org 2010-10-24 17:39:28.847977000 +0200
32 +++ libnss-pgsql-1.5.0-beta/conf/nss-pgsql.conf 2010-10-24 17:40:23.086867000 +0200
34 # another entrance into libnss-pgsql which results in a hang while waiting
35 # for the (already owned) lock.
36 connectionstring = hostaddr=127.0.0.1 dbname=nss user=nss password=nss connect_timeout=1 sslmode=disable
37 +connectionstring2 = hostaddr=127.0.0.1 dbname=nss user=nss password=nss connect_timeout=1 sslmode=disable
39 # you can use anything postgres accepts as table expression
41 --- libnss-pgsql-1.5.0-beta/conf/nss-pgsql-root.conf.org 2010-10-24 17:40:36.919216000 +0200
42 +++ libnss-pgsql-1.5.0-beta/conf/nss-pgsql-root.conf 2010-10-24 17:40:52.133161000 +0200
44 # this file must be readable for root only
46 shadowconnectionstring = hostaddr=127.0.0.1 dbname=nss user=nss connect_timeout=1 sslmode=disable
47 +shadowconnectionstring2 = hostaddr=127.0.0.1 dbname=nss user=nss connect_timeout=1 sslmode=disable
49 #Query in the following format
50 #shadow_name, shadow_passwd, shadow_lstchg, shadow_min, shadow_max, shadow_warn, shadow_inact, shadow_expire, shadow_flag