about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--configure.ng4
-rw-r--r--man/ngircd.conf.5.tmpl9
-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
7 files changed, 29 insertions, 18 deletions
diff --git a/configure.ng b/configure.ng
index bd40694f..34094a48 100644
--- a/configure.ng
+++ b/configure.ng
@@ -221,8 +221,8 @@ AC_CHECK_FUNCS([ \
 # Optional functions
 AC_CHECK_FUNCS_ONCE([
 	arc4random arc4random_stir gai_strerror getnameinfo inet_aton \
-	sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \
-	strtok_r unsetenv waitpid])
+	setgroups sigaction sigprocmask snprintf strdup strlcat strlcpy \
+	strndup strtok_r unsetenv vsnprintf waitpid])
 
 WORKING_GETADDRINFO
 
diff --git a/man/ngircd.conf.5.tmpl b/man/ngircd.conf.5.tmpl
index 0d57f902..9040043d 100644
--- a/man/ngircd.conf.5.tmpl
+++ b/man/ngircd.conf.5.tmpl
@@ -252,8 +252,8 @@ The Salt for cloaked hostname hashing. When undefined a random hash is
 generated after each server start.
 .TP
 \fBCloakUserToNick\fR (boolean)
-Set every clients' user name to their nickname and hide the one supplied
-by the IRC client. Default: no.
+Set every clients' user name and real name to their nickname and hide the one
+supplied by the IRC client. Default: no.
 .TP
 \fBConnectIPv4\fR (boolean)
 Set this to no if you do not want ngIRCd to connect to other IRC servers using
@@ -291,8 +291,9 @@ Default: none.
 .TP
 \fBMorePrivacy\fR (boolean)
 This will cause ngIRCd to censor user idle time, logon time as well as the
-part/quit messages (that are sometimes used to inform everyone about which
-client software is being used). WHOWAS requests are also silently ignored.
+PART/QUIT messages (that are sometimes used to inform everyone about which
+client software is being used). WHOWAS requests are also silently ignored,
+and NAMES output doesn't list any clients for non-members.
 This option is most useful when ngIRCd is being used together with
 anonymizing software such as TOR or I2P and one does not wish to make it
 too easy to collect statistics on the users.
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