about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/irc-channel.c8
-rw-r--r--src/ngircd/irc-info.c2
-rw-r--r--src/ngircd/match.c18
-rw-r--r--src/ngircd/messages.h1
-rw-r--r--src/ngircd/ngircd.c5
5 files changed, 22 insertions, 12 deletions
diff --git a/src/ngircd/irc-channel.c b/src/ngircd/irc-channel.c
index aa4abe3d..4ea25bb0 100644
--- a/src/ngircd/irc-channel.c
+++ b/src/ngircd/irc-channel.c
@@ -597,6 +597,10 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
 		}
 	}
 
+	/* Send list head */
+	if (!IRC_WriteStrClient(from, RPL_LISTSTART_MSG, Client_ID(from)))
+		return DISCONNECTED;
+
 	while (pattern) {
 		/* Loop through all the channels */
 		if (Req->argc > 0)
@@ -608,9 +612,7 @@ IRC_LIST( CLIENT *Client, REQUEST *Req )
 				/* Gotcha! */
 				if (!Channel_HasMode(chan, 's')
 				    || Channel_IsMemberOf(chan, from)
-				    || (!Conf_MorePrivacy
-					&& Client_HasMode(Client, 'o')
-					&& Client_Conn(Client) > NONE))
+				    || Client_HasMode(from, 'o'))
 				{
 					if ((Conf_MaxListSize > 0)
 					    && IRC_CheckListTooBig(from, count,
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c
index ba7a2b74..1bbaf57b 100644
--- a/src/ngircd/irc-info.c
+++ b/src/ngircd/irc-info.c
@@ -407,7 +407,7 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
 
 	/* Local client and requester is the user itself or an IRC Op? */
 	if (Client_Conn(c) > NONE &&
-	    (from == c || (!Conf_MorePrivacy && Client_HasMode(from, 'o')))) {
+	    (from == c || Client_HasMode(from, 'o'))) {
 		/* Client hostname */
 		if (!IRC_WriteStrClient(from, RPL_WHOISHOST_MSG,
 					Client_ID(from), Client_ID(c),
diff --git a/src/ngircd/match.c b/src/ngircd/match.c
index 93ddc0bc..c1119a50 100644
--- a/src/ngircd/match.c
+++ b/src/ngircd/match.c
@@ -50,8 +50,10 @@ static int Matche_After_Star PARAMS(( const char *p, const char *t ));
 GLOBAL bool
 Match( const char *Pattern, const char *String )
 {
-	if( Matche( Pattern, String ) == MATCH_VALID ) return true;
-	else return false;
+	if (Matche(Pattern, String) == MATCH_VALID)
+		return true;
+	else
+		return false;
 } /* Match */
 
 /**
@@ -64,10 +66,12 @@ Match( const char *Pattern, const char *String )
 GLOBAL bool
 MatchCaseInsensitive(const char *Pattern, const char *String)
 {
-	char haystack[COMMAND_LEN];
+	char needle[COMMAND_LEN], haystack[COMMAND_LEN];
 
+	strlcpy(needle, Pattern, sizeof(needle));
 	strlcpy(haystack, String, sizeof(haystack));
-	return Match(Pattern, ngt_LowerStr(haystack));
+
+	return Match(ngt_LowerStr(needle), ngt_LowerStr(haystack));
 } /* MatchCaseInsensitive */
 
 /**
@@ -82,16 +86,14 @@ GLOBAL bool
 MatchCaseInsensitiveList(const char *Pattern, const char *String,
 		     const char *Separator)
 {
-	char tmp_pattern[COMMAND_LEN], haystack[COMMAND_LEN], *ptr;
+	char tmp_pattern[COMMAND_LEN], *ptr;
 
 	strlcpy(tmp_pattern, Pattern, sizeof(tmp_pattern));
-	strlcpy(haystack, String, sizeof(haystack));
-	ngt_LowerStr(haystack);
 
 	ptr = strtok(tmp_pattern, Separator);
 	while (ptr) {
 		ngt_TrimStr(ptr);
-		if (Match(ptr, haystack))
+		if (MatchCaseInsensitive(ptr, String))
 			return true;
 		ptr = strtok(NULL, Separator);
 	}
diff --git a/src/ngircd/messages.h b/src/ngircd/messages.h
index 1f18215d..8a7215b4 100644
--- a/src/ngircd/messages.h
+++ b/src/ngircd/messages.h
@@ -67,6 +67,7 @@
 #define RPL_WHOISIDLE_MSG		"317 %s %s %lu %lu :seconds idle, signon time"
 #define RPL_ENDOFWHOIS_MSG		"318 %s %s :End of WHOIS list"
 #define RPL_WHOISCHANNELS_MSG		"319 %s %s :"
+#define RPL_LISTSTART_MSG		"321 %s Channel :Users  Name"
 #define RPL_LIST_MSG			"322 %s %s %ld :%s"
 #define RPL_LISTEND_MSG			"323 %s :End of LIST"
 #define RPL_CHANNELMODEIS_MSG		"324 %s %s +%s"
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 1b20597d..0e8acb54 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -724,6 +724,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM) 
 				goto out;
 		}
+#ifdef HAVE_SETGROUPS
 		if (setgroups(0, NULL) != 0) {
 			real_errno = errno;
 			Log(LOG_ERR, "Can't drop supplementary group IDs: %s!",
@@ -731,6 +732,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM)
 				goto out;
 		}
+#else
+		Log(LOG_WARNING,
+		    "Can't drop supplementary group IDs: setgroups(3) missing!");
+#endif
 	}
 #endif