summaryrefslogtreecommitdiff
path: root/net-im/jabberd
Unidiff
Diffstat (limited to 'net-im/jabberd') (more/less context) (ignore whitespace changes)
-rw-r--r--net-im/jabberd/files/jabberd-2.1.11-r1.patch20
1 files changed, 18 insertions, 2 deletions
diff --git a/net-im/jabberd/files/jabberd-2.1.11-r1.patch b/net-im/jabberd/files/jabberd-2.1.11-r1.patch
index 441163c..6eba147 100644
--- a/net-im/jabberd/files/jabberd-2.1.11-r1.patch
+++ b/net-im/jabberd/files/jabberd-2.1.11-r1.patch
@@ -90,12 +90,28 @@ index 099aec9..29dca26 100644
90 + AC_MSG_ERROR([PostgreSQL support requested, but headers/libraries not found.]) 90 + AC_MSG_ERROR([PostgreSQL support requested, but headers/libraries not found.])
91 + fi 91 + fi
92 +fi 92 +fi
93 fi 93 fi
94 AC_SUBST(PGSQL_CFLAGS) 94 AC_SUBST(PGSQL_CFLAGS)
95 AC_SUBST(PGSQL_LIBS) 95 AC_SUBST(PGSQL_LIBS)
96diff --git a/etc/c2s.xml.dist.in b/etc/c2s.xml.dist.in
97index 873a133..0589ada 100644
98--- a/etc/c2s.xml.dist.in
99+++ b/etc/c2s.xml.dist.in
100@@ -325,6 +325,11 @@
101
102 <!-- PostgreSQL module configuration -->
103 <pgsql>
104+ <!-- PostgreSQL connection info -->
105+ <conninfo>dbname=jabberd2 user=jabberd2 password=secret</conninfo>
106+
107+ <!-- The rest of connection settings are used only in absence of 'conninfo' -->
108+
109 <!-- Database server host and port -->
110 <host>localhost</host>
111 <port>5432</port>
96diff --git a/mio/mio_impl.h b/mio/mio_impl.h 112diff --git a/mio/mio_impl.h b/mio/mio_impl.h
97index 6f72a5c..cabdc67 100644 113index 6f72a5c..cabdc67 100644
98--- a/mio/mio_impl.h 114--- a/mio/mio_impl.h
99+++ b/mio/mio_impl.h 115+++ b/mio/mio_impl.h
100@@ -226,8 +226,12 @@ static void _mio_run(mio_t m, int timeout) 116@@ -226,8 +226,12 @@ static void _mio_run(mio_t m, int timeout)
101 { 117 {
@@ -157,13 +173,13 @@ index 06f9e6e..5abf065 100644
157- pool_cleanup(p, free, zitem->jid); 173- pool_cleanup(p, free, zitem->jid);
158+ pool_cleanup(p, jid_free, zitem->jid); 174+ pool_cleanup(p, jid_free, zitem->jid);
159 175
160 log_debug(ZONE, "jid item with value '%s'", jid_full(zitem->jid)); 176 log_debug(ZONE, "jid item with value '%s'", jid_full(zitem->jid));
161 177
162diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c 178diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c
163index 1f15e83..8d3cf88 100644 179index 1f15e83..cb68e7d 100644
164--- a/storage/authreg_pgsql.c 180--- a/storage/authreg_pgsql.c
165+++ b/storage/authreg_pgsql.c 181+++ b/storage/authreg_pgsql.c
166@@ -304,7 +304,7 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) { 182@@ -304,7 +304,7 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) {
167 183
168 /** start me up */ 184 /** start me up */
169 int ar_init(authreg_t ar) { 185 int ar_init(authreg_t ar) {
@@ -182,15 +198,15 @@ index 1f15e83..8d3cf88 100644
182- user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0); 198- user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0);
183- pass = config_get_one(ar->c2s->config, "authreg.pgsql.pass", 0); 199- pass = config_get_one(ar->c2s->config, "authreg.pgsql.pass", 0);
184- 200-
185- log_debug( ZONE, "pgsql connecting as '%s' to database '%s' on %s:%s", user, dbname, host, port ); 201- log_debug( ZONE, "pgsql connecting as '%s' to database '%s' on %s:%s", user, dbname, host, port );
186+ conninfo = config_get_one(ar->c2s->config,"authreg.pgsql.conninfo",0); 202+ conninfo = config_get_one(ar->c2s->config,"authreg.pgsql.conninfo",0);
187+ if(conninfo) { 203+ if(conninfo) {
188 +conn = PQconnect(conninfo);
189 +/* don't log connection info for it can contain password */ 204 +/* don't log connection info for it can contain password */
190 +log_debug( ZONE, "pgsql connecting to the databse"); 205 +log_debug( ZONE, "pgsql connecting to the databse");
206 +conn = PQconnectdb(conninfo);
191+ }else{ 207+ }else{
192 +/* compatibility settings */ 208 +/* compatibility settings */
193 +host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0); 209 +host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0);
194 +port = config_get_one(ar->c2s->config, "authreg.pgsql.port", 0); 210 +port = config_get_one(ar->c2s->config, "authreg.pgsql.port", 0);
195 +dbname = config_get_one(ar->c2s->config, "authreg.pgsql.dbname", 0); 211 +dbname = config_get_one(ar->c2s->config, "authreg.pgsql.dbname", 0);
196 +user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0); 212 +user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0);