updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / libnss-pgsql / fallback.patch
blobd1bbaf56ff7806c12fb59fb6c3db2cec83881590
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) {
5 ++_shadowisopen;
6 } else {
7 - print_msg("\nCould not connect to database (shadow)\n");
8 + _conn = PQconnectdb(getcfg("shadowconnectionstring2"));
9 + if(PQstatus(_shadowconn) == CONNECTION_OK) {
10 + ++_shadowisopen;
11 + } else {
12 + print_msg("\nCould not connect to database (shadow)\n");
13 + }
17 @@ -105,7 +110,12 @@ int backend_open(char type)
18 if(PQstatus(_conn) == CONNECTION_OK) {
19 ++_isopen;
20 } else {
21 - print_msg("\nCould not connect to database\n");
22 + _conn = PQconnectdb(getcfg("connectionstring2"));
23 + if(PQstatus(_conn) == CONNECTION_OK) {
24 + ++_isopen;
25 + } else {
26 + print_msg("\nCould not connect to database\n");
27 + }
30 return (_isopen > 0);
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
33 @@ -11,6 +11,7 @@
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
43 @@ -2,6 +2,7 @@
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