Module: ngircd.git
Branch: master
Commit: 849f85a05c17828c592bed26bd99707f211fad1c
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=849f85a0…
Author: Alexander Barton <alex(a)barton.de>
Date: Sun Sep 15 14:09:31 2013 +0200
ConnSSL_InitLibrary(): Code cleanup
---
src/ngircd/conn-ssl.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/ngircd/conn-ssl.c b/src/ngircd/conn-ssl.c
index 096ff95..595cb61 100644
--- a/src/ngircd/conn-ssl.c
+++ b/src/ngircd/conn-ssl.c
@@ -285,8 +285,10 @@ ConnSSL_InitLibrary( void )
if (!RAND_status()) {
Log(LOG_ERR, "OpenSSL PRNG not seeded: /dev/urandom missing?");
/*
- * it is probably best to fail and let the user install EGD or a similar program if no kernel random device is available.
- * According to OpenSSL RAND_egd(3): "The automatic query of /var/run/egd-pool et al was added in OpenSSL 0.9.7";
+ * it is probably best to fail and let the user install EGD or
+ * a similar program if no kernel random device is available.
+ * According to OpenSSL RAND_egd(3): "The automatic query of
+ * /var/run/egd-pool et al was added in OpenSSL 0.9.7";
* so it makes little sense to deal with PRNGD seeding ourselves.
*/
array_free(&Conf_SSLOptions.ListenPorts);
@@ -305,7 +307,8 @@ ConnSSL_InitLibrary( void )
SSL_CTX_set_options(newctx, SSL_OP_SINGLE_DH_USE|SSL_OP_NO_SSLv2);
SSL_CTX_set_mode(newctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
- SSL_CTX_set_verify(newctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE, Verify_openssl);
+ SSL_CTX_set_verify(newctx, SSL_VERIFY_PEER|SSL_VERIFY_CLIENT_ONCE,
+ Verify_openssl);
SSL_CTX_free(ssl_ctx);
ssl_ctx = newctx;
Log(LOG_INFO, "%s initialized.", SSLeay_version(SSLEAY_VERSION));
@@ -318,12 +321,17 @@ out:
#ifdef HAVE_LIBGNUTLS
int err;
static bool initialized;
- if (initialized) /* TODO: cannot reload gnutls keys: can't simply free x509 context -- it may still be in use */
+
+ if (initialized) {
+ /* TODO: cannot reload gnutls keys: can't simply free x509
+ * context -- it may still be in use */
return false;
+ }
err = gnutls_global_init();
if (err) {
- Log(LOG_ERR, "Failed to initialize GnuTLS: %s", gnutls_strerror(err));
+ Log(LOG_ERR, "Failed to initialize GnuTLS: %s",
+ gnutls_strerror(err));
array_free(&Conf_SSLOptions.ListenPorts);
return false;
}
Module: ngircd.git
Branch: master
Commit: a98bbc8e0b937f4fedf7ad852eaf109c6a9c5b8f
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=a98bbc8e…
Author: Federico G. Schwindt <fgsch(a)lodoss.net>
Date: Thu Sep 5 10:46:13 2013 +0100
Correct numeric returned by whois
As per RFC whois should return 431 if no nick is provided. While
here convert upper check to use irc-macros. As a bonus we get to set
the penalty for free.
---
src/ngircd/irc-info.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index 3d77237..6013fa0 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -1211,11 +1211,12 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
IRC_SetPenalty(Client, 1);
- /* Bad number of parameters? */
- if (Req->argc < 1 || Req->argc > 2)
- return IRC_WriteErrClient(Client, ERR_NEEDMOREPARAMS_MSG,
- Client_ID(Client), Req->command);
+ /* Wrong number of parameters? */
+ if (Req->argc < 1)
+ return IRC_WriteErrClient(Client, ERR_NONICKNAMEGIVEN_MSG,
+ Client_ID(Client));
+ _IRC_ARGC_LE_OR_RETURN_(Client, Req, 2)
_IRC_GET_SENDER_OR_RETURN_(from, Req, Client)
/* Get target server for this command */