-rw-r--r-- | net-im/jabberd/files/digest-jabberd-2.1.11-r2 (renamed from net-im/jabberd/files/digest-jabberd-2.1.11-r1) | 0 | ||||
-rw-r--r-- | net-im/jabberd/files/jabberd-2.1.11-r2.patch (renamed from net-im/jabberd/files/jabberd-2.1.11-r1.patch) | 38 |
2 files changed, 35 insertions, 3 deletions
diff --git a/net-im/jabberd/files/digest-jabberd-2.1.11-r1 b/net-im/jabberd/files/digest-jabberd-2.1.11-r2 index ae7be5e..ae7be5e 100644 --- a/net-im/jabberd/files/digest-jabberd-2.1.11-r1 +++ b/net-im/jabberd/files/digest-jabberd-2.1.11-r2 | |||
diff --git a/net-im/jabberd/files/jabberd-2.1.11-r1.patch b/net-im/jabberd/files/jabberd-2.1.11-r2.patch index 6eba147..dbf441a 100644 --- a/net-im/jabberd/files/jabberd-2.1.11-r1.patch +++ b/net-im/jabberd/files/jabberd-2.1.11-r2.patch | |||
@@ -173,35 +173,45 @@ index 06f9e6e..5abf065 100644 | |||
173 | - pool_cleanup(p, free, zitem->jid); | 173 | - pool_cleanup(p, free, zitem->jid); |
174 | + pool_cleanup(p, jid_free, zitem->jid); | 174 | + pool_cleanup(p, jid_free, zitem->jid); |
175 | 175 | ||
176 | 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)); |
177 | 177 | ||
178 | diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c | 178 | diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c |
179 | index 1f15e83..cb68e7d 100644 | 179 | index 1f15e83..5f1583d 100644 |
180 | --- a/storage/authreg_pgsql.c | 180 | --- a/storage/authreg_pgsql.c |
181 | +++ b/storage/authreg_pgsql.c | 181 | +++ b/storage/authreg_pgsql.c |
182 | @@ -304,7 +304,7 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) { | 182 | @@ -302,9 +302,13 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) { |
183 | return 1; | ||
184 | } | ||
183 | 185 | ||
186 | +#ifdef HAVE_SSL | ||
187 | +extern int sx_openssl_initialized; | ||
188 | +#endif | ||
189 | + | ||
184 | /** start me up */ | 190 | /** start me up */ |
185 | int ar_init(authreg_t ar) { | 191 | int ar_init(authreg_t ar) { |
186 | - char *host, *port, *dbname, *user, *pass; | 192 | - char *host, *port, *dbname, *user, *pass; |
187 | + char *host, *port, *dbname, *user, *pass, *conninfo; | 193 | + char *host, *port, *dbname, *user, *pass, *conninfo; |
188 | char *create, *select, *setpassword, *delete; | 194 | char *create, *select, *setpassword, *delete; |
189 | char *table, *username, *realm; | 195 | char *table, *username, *realm; |
190 | char *template; | 196 | char *template; |
191 | @@ -391,15 +391,22 @@ int ar_init(authreg_t ar) { | 197 | @@ -391,15 +395,26 @@ int ar_init(authreg_t ar) { |
192 | free(setpassword); | 198 | free(setpassword); |
193 | free(delete); | 199 | free(delete); |
194 | 200 | ||
195 | - host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0); | 201 | - host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0); |
196 | - port = config_get_one(ar->c2s->config, "authreg.pgsql.port", 0); | 202 | - port = config_get_one(ar->c2s->config, "authreg.pgsql.port", 0); |
197 | - dbname = config_get_one(ar->c2s->config, "authreg.pgsql.dbname", 0); | 203 | - dbname = config_get_one(ar->c2s->config, "authreg.pgsql.dbname", 0); |
198 | - user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0); | 204 | - user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0); |
199 | - pass = config_get_one(ar->c2s->config, "authreg.pgsql.pass", 0); | 205 | - pass = config_get_one(ar->c2s->config, "authreg.pgsql.pass", 0); |
200 | - | 206 | - |
201 | - log_debug( ZONE, "pgsql connecting as '%s' to database '%s' on %s:%s", user, dbname, host, port ); | 207 | - log_debug( ZONE, "pgsql connecting as '%s' to database '%s' on %s:%s", user, dbname, host, port ); |
208 | +#ifdef HAVE_SSL | ||
209 | + if(sx_openssl_initialized) | ||
210 | +PQinitSSL(0); | ||
211 | +#endif | ||
202 | + conninfo = config_get_one(ar->c2s->config,"authreg.pgsql.conninfo",0); | 212 | + conninfo = config_get_one(ar->c2s->config,"authreg.pgsql.conninfo",0); |
203 | + if(conninfo) { | 213 | + if(conninfo) { |
204 | +/* don't log connection info for it can contain password */ | 214 | +/* don't log connection info for it can contain password */ |
205 | +log_debug( ZONE, "pgsql connecting to the databse"); | 215 | +log_debug( ZONE, "pgsql connecting to the databse"); |
206 | +conn = PQconnectdb(conninfo); | 216 | +conn = PQconnectdb(conninfo); |
207 | + }else{ | 217 | + }else{ |
@@ -236,12 +246,34 @@ index 69eeec2..0036c0f 100644 | |||
236 | _sx_debug(ZONE, "gsasl_step failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); | 246 | _sx_debug(ZONE, "gsasl_step failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); |
237 | _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MALFORMED_REQUEST), 0); | 247 | _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MALFORMED_REQUEST), 0); |
238 | + if(buf != NULL) free(buf); | 248 | + if(buf != NULL) free(buf); |
239 | return; | 249 | return; |
240 | } | 250 | } |
241 | 251 | ||
252 | diff --git a/sx/ssl.c b/sx/ssl.c | ||
253 | index 62c4258..9359f4d 100644 | ||
254 | --- a/sx/ssl.c | ||
255 | +++ b/sx/ssl.c | ||
256 | @@ -628,6 +628,8 @@ static void _sx_ssl_unload(sx_plugin_t p) { | ||
257 | SSL_CTX_free((SSL_CTX *) p->private); | ||
258 | } | ||
259 | |||
260 | +int sx_openssl_initialized = 0; | ||
261 | + | ||
262 | /** args: pemfile */ | ||
263 | int sx_ssl_init(sx_env_t env, sx_plugin_t p, va_list args) { | ||
264 | char *pemfile, *cachain; | ||
265 | @@ -653,6 +655,8 @@ int sx_ssl_init(sx_env_t env, sx_plugin_t p, va_list args) { | ||
266 | SSL_library_init(); | ||
267 | SSL_load_error_strings(); | ||
268 | |||
269 | + sx_openssl_initialized = 1; | ||
270 | + | ||
271 | /* create the context */ | ||
272 | ctx = SSL_CTX_new(SSLv23_method()); | ||
273 | if(ctx == NULL) { | ||
242 | diff --git a/util/jid.c b/util/jid.c | 274 | diff --git a/util/jid.c b/util/jid.c |
243 | index 695b15f..f4b0021 100644 | 275 | index 695b15f..f4b0021 100644 |
244 | --- a/util/jid.c | 276 | --- a/util/jid.c |
245 | +++ b/util/jid.c | 277 | +++ b/util/jid.c |
246 | @@ -332,7 +332,7 @@ static jid_t jid_reset_components_internal(jid_t jid, const unsigned char *node, | 278 | @@ -332,7 +332,7 @@ static jid_t jid_reset_components_internal(jid_t jid, const unsigned char *node, |
247 | else { | 279 | else { |