]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Merge remote-tracking branch 'LucentW/master'
authorAlexander Barton <alex@barton.de>
Sun, 7 Jun 2015 19:13:45 +0000 (21:13 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 7 Jun 2015 19:13:45 +0000 (21:13 +0200)
* LucentW/master:
  Fix with oneshot invites
  Fixed building issues\
  Implement timestamp tracking of invites
  Keep track of who placed bans/invites/excepts
  IRC operators w/OperCanMode can kick anyone [already cherry-picked]

Closes #203, Closes #205.

configure.ng
man/ngircd.conf.5.tmpl
src/ngircd/irc-channel.c
src/ngircd/irc-info.c
src/ngircd/match.c
src/ngircd/messages.h
src/ngircd/ngircd.c

index bd40694f3ccdef563aefa32803a2941b4cab1564..34094a485180cc9874085daf4d45a2b8ae31aefb 100644 (file)
@@ -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
 
index 0d57f902d46c4b5a0fb5f8cc3651a4030694554b..9040043d9db8003ce997d9851454c223badf3f7d 100644 (file)
@@ -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.
index aa4abe3d17afdc49ab2239421661a924df82b168..4ea25bb044e61d7744e0d427faac7a35fa44e3f8 100644 (file)
@@ -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,
index ba7a2b74243cd4cc21bfc8917510502104387d5a..1bbaf57b3b53a35e905be647c5f075690ade38ac 100644 (file)
@@ -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),
index 93ddc0bc71f363ebece6d8bac0719edab478dcbf..c1119a50d9edd917840a85b94a29e95ed0f98ce7 100644 (file)
@@ -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);
        }
index 1f18215db70e5b0085984012365d01403e4f18b8..8a7215b42172464a3f77204225292760fb47af5c 100644 (file)
@@ -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"
index 1b20597d8aa26cf7dbd0c2e490786ea910bab8d5..0e8acb54213e3a3c6e54e99affdf0b9bfed22871 100644 (file)
@@ -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