author | Michael Krelin <hacker@klever.net> | 2007-07-28 19:23:02 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-28 19:23:02 (UTC) |
commit | 14d8413448409518ec967b895290dbbb5cc0e7f3 (patch) (side-by-side diff) | |
tree | 415348e580b591957a0d7ed4c14e3d2cf27f58e2 /net-im/jabberd/files | |
parent | 2046805030295f646052c635e525a4ae2ec787cc (diff) | |
download | misc-14d8413448409518ec967b895290dbbb5cc0e7f3.zip misc-14d8413448409518ec967b895290dbbb5cc0e7f3.tar.gz misc-14d8413448409518ec967b895290dbbb5cc0e7f3.tar.bz2 |
net-im/jabberd: added ssl fix to the patch.
Signed-off-by: Michael Krelin <hacker@klever.net>
-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 @@ -171,39 +171,49 @@ index 06f9e6e..5abf065 100644 } - pool_cleanup(p, free, zitem->jid); + pool_cleanup(p, jid_free, zitem->jid); log_debug(ZONE, "jid item with value '%s'", jid_full(zitem->jid)); diff --git a/storage/authreg_pgsql.c b/storage/authreg_pgsql.c -index 1f15e83..cb68e7d 100644 +index 1f15e83..5f1583d 100644 --- a/storage/authreg_pgsql.c +++ b/storage/authreg_pgsql.c -@@ -304,7 +304,7 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) { +@@ -302,9 +302,13 @@ int _ar_pgsql_check_sql( authreg_t ar, char * sql, char * types ) { + return 1; + } ++#ifdef HAVE_SSL ++extern int sx_openssl_initialized; ++#endif ++ /** start me up */ int ar_init(authreg_t ar) { - char *host, *port, *dbname, *user, *pass; + char *host, *port, *dbname, *user, *pass, *conninfo; char *create, *select, *setpassword, *delete; char *table, *username, *realm; char *template; -@@ -391,15 +391,22 @@ int ar_init(authreg_t ar) { +@@ -391,15 +395,26 @@ int ar_init(authreg_t ar) { free(setpassword); free(delete); - host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0); - port = config_get_one(ar->c2s->config, "authreg.pgsql.port", 0); - dbname = config_get_one(ar->c2s->config, "authreg.pgsql.dbname", 0); - user = config_get_one(ar->c2s->config, "authreg.pgsql.user", 0); - pass = config_get_one(ar->c2s->config, "authreg.pgsql.pass", 0); - - log_debug( ZONE, "pgsql connecting as '%s' to database '%s' on %s:%s", user, dbname, host, port ); ++#ifdef HAVE_SSL ++ if(sx_openssl_initialized) ++ PQinitSSL(0); ++#endif + conninfo = config_get_one(ar->c2s->config,"authreg.pgsql.conninfo",0); + if(conninfo) { + /* don't log connection info for it can contain password */ + log_debug( ZONE, "pgsql connecting to the databse"); + conn = PQconnectdb(conninfo); + }else{ + /* compatibility settings */ + host = config_get_one(ar->c2s->config, "authreg.pgsql.host", 0); @@ -234,16 +244,38 @@ index 69eeec2..0036c0f 100644 @@ -350,6 +351,7 @@ static void _sx_sasl_client_process(sx_t s, sx_plugin_t p, Gsasl_session *sd, ch if(ret != GSASL_OK && ret != GSASL_NEEDS_MORE) { _sx_debug(ZONE, "gsasl_step failed, no sasl for this conn; (%d): %s", ret, gsasl_strerror(ret)); _sx_nad_write(s, _sx_sasl_failure(s, _sasl_err_MALFORMED_REQUEST), 0); + if(buf != NULL) free(buf); return; } +diff --git a/sx/ssl.c b/sx/ssl.c +index 62c4258..9359f4d 100644 +--- a/sx/ssl.c ++++ b/sx/ssl.c +@@ -628,6 +628,8 @@ static void _sx_ssl_unload(sx_plugin_t p) { + SSL_CTX_free((SSL_CTX *) p->private); + } + ++int sx_openssl_initialized = 0; ++ + /** args: pemfile */ + int sx_ssl_init(sx_env_t env, sx_plugin_t p, va_list args) { + char *pemfile, *cachain; +@@ -653,6 +655,8 @@ int sx_ssl_init(sx_env_t env, sx_plugin_t p, va_list args) { + SSL_library_init(); + SSL_load_error_strings(); + ++ sx_openssl_initialized = 1; ++ + /* create the context */ + ctx = SSL_CTX_new(SSLv23_method()); + if(ctx == NULL) { diff --git a/util/jid.c b/util/jid.c index 695b15f..f4b0021 100644 --- a/util/jid.c +++ b/util/jid.c @@ -332,7 +332,7 @@ static jid_t jid_reset_components_internal(jid_t jid, const unsigned char *node, else { /* allocate new data buffer */ jid->jid_data_len = node_l+domain_l+resource_l+3; |