about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/client.c10
-rw-r--r--src/ngircd/client.h5
-rw-r--r--src/ngircd/conf.c6
-rw-r--r--src/ngircd/conn.c2
-rw-r--r--src/ngircd/defines.h6
-rw-r--r--src/ngircd/lists.c3
-rw-r--r--src/ngircd/numeric.c52
7 files changed, 42 insertions, 42 deletions
diff --git a/src/ngircd/client.c b/src/ngircd/client.c
index 9795662e..07d448fd 100644
--- a/src/ngircd/client.c
+++ b/src/ngircd/client.c
@@ -427,7 +427,7 @@ Client_SetOrigUser(CLIENT UNUSED *Client, const char UNUSED *User)
 	assert(Client != NULL);
 	assert(User != NULL);
 
-#if defined(PAM) && defined(IDENTAUTH)
+#if defined(PAM)
 	strlcpy(Client->orig_user, User, sizeof(Client->orig_user));
 #endif
 } /* Client_SetOrigUser */
@@ -731,15 +731,7 @@ Client_User( CLIENT *Client )
  */
 GLOBAL char *
 Client_OrigUser(CLIENT *Client) {
-#ifndef IDENTAUTH
-	char *user = Client->user;
-
-	if (user[0] == '~')
-		user++;
-	return user;
-#else
 	return Client->orig_user;
-#endif
 } /* Client_OrigUser */
 
 #endif
diff --git a/src/ngircd/client.h b/src/ngircd/client.h
index c6fcec07..4185d217 100644
--- a/src/ngircd/client.h
+++ b/src/ngircd/client.h
@@ -52,8 +52,9 @@ typedef struct _CLIENT
 	char *cloaked;			/* cloaked hostname of the client */
 	char *ipa_text;			/* textual representaton of IP address */
 	char user[CLIENT_USER_LEN];	/* user name ("login") */
-#if defined(PAM) && defined(IDENTAUTH)
-	char orig_user[CLIENT_USER_LEN];/* user name supplied by USER command */
+#if defined(PAM)
+	char orig_user[CLIENT_AUTHUSER_LEN];
+					/* original user name supplied by USER command */
 #endif
 	char info[CLIENT_INFO_LEN];	/* long user name (user) / info text (server) */
 	char modes[CLIENT_MODE_LEN];	/* client modes */
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 2f234dad..5f8c3929 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -88,10 +88,10 @@ static void Init_Server_Struct PARAMS(( CONF_SERVER *Server ));
 #endif
 
 #ifdef HAVE_LIBSSL
-#define DEFAULT_CIPHERS		"HIGH:!aNULL:@STRENGTH"
+#define DEFAULT_CIPHERS		"HIGH:!aNULL:@STRENGTH:!SSLv3"
 #endif
 #ifdef HAVE_LIBGNUTLS
-#define DEFAULT_CIPHERS		"SECURE128"
+#define DEFAULT_CIPHERS		"SECURE128:-VERS-SSL3.0"
 #endif
 
 #ifdef SSL_SUPPORT
@@ -806,8 +806,8 @@ Set_Defaults(bool InitServers)
 	Conf_PAM = false;
 #endif
 	Conf_PAMIsOptional = false;
-#ifdef SYSLOG
 	Conf_ScrubCTCP = false;
+#ifdef SYSLOG
 #ifdef LOG_LOCAL5
 	Conf_SyslogFacility = LOG_LOCAL5;
 #else
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c
index 5c175dfd..62561544 100644
--- a/src/ngircd/conn.c
+++ b/src/ngircd/conn.c
@@ -1904,7 +1904,7 @@ Check_Servers(void)
 	for (i = 0; i < MAX_SERVERS; i++) {
 		if (Conf_Server[i].conn_id != NONE)
 			continue;	/* Already establishing or connected */
-		if (!Conf_Server[i].host[0] || !Conf_Server[i].port > 0)
+		if (!Conf_Server[i].host[0] || Conf_Server[i].port <= 0)
 			continue;	/* No host and/or port configured */
 		if (Conf_Server[i].flags & CONF_SFLAG_DISABLED)
 			continue;	/* Disabled configuration entry */
diff --git a/src/ngircd/defines.h b/src/ngircd/defines.h
index 4acdc477..456c4c93 100644
--- a/src/ngircd/defines.h
+++ b/src/ngircd/defines.h
@@ -53,7 +53,7 @@
 /* Size of structures */
 
 /** Max. count of configurable servers. */
-#define MAX_SERVERS 16
+#define MAX_SERVERS 64
 
 /** Max. number of WHOWAS list items that can be stored. */
 #define MAX_WHOWAS 64
@@ -109,6 +109,10 @@
 #else
 # define CLIENT_USER_LEN 10
 #endif
+/** Max. length of user names saved for authentication (used by PAM) */
+#ifdef PAM
+# define CLIENT_AUTHUSER_LEN 64
+#endif
 
 /** Max. length of "real names" (including NULL). */
 #define CLIENT_NAME_LEN 32
diff --git a/src/ngircd/lists.c b/src/ngircd/lists.c
index 563dfa47..247344e5 100644
--- a/src/ngircd/lists.c
+++ b/src/ngircd/lists.c
@@ -285,6 +285,7 @@ Lists_MakeMask(const char *Pattern, char *mask, size_t len)
 		strlcpy(mask, Pattern, len - 5);
 		strlcat(mask, "!*@", len);
 		strlcat(mask, at, len);
+		at--; *at = '@';
 	} else {
 		/* All parts (nick, user and domain name) are given */
 		strlcpy(mask, Pattern, len);
@@ -325,7 +326,7 @@ Lists_CheckReason(struct list_head *h, CLIENT *Client, char *reason, size_t len)
 
 	while (e) {
 		next = e->next;
-		if (Match(e->mask, Client_MaskCloaked(Client))) {
+		if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client))) {
 			if (len && e->reason)
 				strlcpy(reason, e->reason, len);
 			if (e->valid_until == 1) {
diff --git a/src/ngircd/numeric.c b/src/ngircd/numeric.c
index da863e4d..b0ceeef8 100644
--- a/src/ngircd/numeric.c
+++ b/src/ngircd/numeric.c
@@ -145,7 +145,27 @@ Announce_Server(CLIENT * Client, CLIENT * Server)
 #ifdef IRCPLUS
 
 /**
- * Synchronize invite, ban, G- and K-Line lists between servers.
+ * Send a specific list to a remote server.
+ */
+static bool
+Send_List(CLIENT *Client, CHANNEL *Chan, struct list_head *Head, char Type)
+{
+	struct list_elem *elem;
+
+	elem = Lists_GetFirst(Head);
+	while (elem) {
+		if (!IRC_WriteStrClient(Client, "MODE %s +%c %s",
+					Channel_Name(Chan), Type,
+					Lists_GetMask(elem))) {
+			return DISCONNECTED;
+		}
+		elem = Lists_GetNext(elem);
+	}
+	return CONNECTED;
+}
+
+/**
+ * Synchronize invite, ban, except, and G-Line lists between servers.
  *
  * @param Client New server.
  * @return CONNECTED or DISCONNECTED.
@@ -173,30 +193,12 @@ Synchronize_Lists(CLIENT * Client)
 
 	c = Channel_First();
 	while (c) {
-		/* ban list */
-		head = Channel_GetListBans(c);
-		elem = Lists_GetFirst(head);
-		while (elem) {
-			if (!IRC_WriteStrClient(Client, "MODE %s +b %s",
-						Channel_Name(c),
-						Lists_GetMask(elem))) {
-				return DISCONNECTED;
-			}
-			elem = Lists_GetNext(elem);
-		}
-
-		/* invite list */
-		head = Channel_GetListInvites(c);
-		elem = Lists_GetFirst(head);
-		while (elem) {
-			if (!IRC_WriteStrClient(Client, "MODE %s +I %s",
-						Channel_Name(c),
-						Lists_GetMask(elem))) {
-				return DISCONNECTED;
-			}
-			elem = Lists_GetNext(elem);
-		}
-
+		if (!Send_List(Client, c, Channel_GetListExcepts(c), 'e'))
+			return DISCONNECTED;
+		if (!Send_List(Client, c, Channel_GetListBans(c), 'b'))
+			return DISCONNECTED;
+		if (!Send_List(Client, c, Channel_GetListInvites(c), 'I'))
+			return DISCONNECTED;
 		c = Channel_Next(c);
 	}
 	return CONNECTED;