]> arthur.barton.de Git - ngircd.git/commitdiff
Merge branch 'HelpText'
authorAlexander Barton <alex@barton.de>
Sat, 9 Feb 2013 23:29:30 +0000 (00:29 +0100)
committerAlexander Barton <alex@barton.de>
Sat, 9 Feb 2013 23:29:30 +0000 (00:29 +0100)
* HelpText: (22 commits)
  Commands.txt: Update description of the "USERS" command
  Commands.txt: Update description of the "SUMMON" command
  Commands.txt: Update description of the "SERVLIST" command
  Commands.txt: Update description of the "WHOWAS" command
  Commands.txt: Update description of the "WHOIS" command
  Commands.txt: Update description of the "WHO" command
  Commands.txt: Update description of the "VERSION" command
  Commands.txt: Update description of the "USERHOST" command
  Commands.txt: Update description of the "TIME" command
  Commands.txt: Update description of the "STATS" command
  Commands.txt: Update description of the "NAMES" command
  Commands.txt: Update description of the "MOTD" command
  Commands.txt: Update description of the "LUSERS" command
  Commands.txt: Update description of the "LINKS" command
  Commands.txt: Update description of the "ISON" command
  Commands.txt: Update description of the "INFO" command
  Commands.txt: Update description of the "ADMIN" command
  Commands.txt: Add description for the "CHARCONV" command
  Commands.txt: Add description for the "CAP" command
  Commands.txt: Import descriptions from "rbose/command_help"
  ...

15 files changed:
AUTHORS
autogen.sh
configure.ng
contrib/Debian/rules
src/ngircd/channel.c
src/ngircd/client.c
src/ngircd/conn.c
src/ngircd/io.c
src/ngircd/irc-info.c
src/ngircd/irc-login.c
src/ngircd/irc-server.c
src/ngircd/irc.c
src/ngircd/log.c
src/ngircd/messages.h
src/ngircd/ngircd.c

diff --git a/AUTHORS b/AUTHORS
index 1d061a60d4c53c897e232ae958db00a00f983c4a..605df2d06600f7b73a84c6f6e85fcf6baf35b3c1 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -18,29 +18,41 @@ Don't mail the people listed here directly, if possible!
 
 Main Authors
 ~~~~~~~~~~~~
-Alexander Barton, <alex@barton.de> (alex)
-Florian Westphal, <fw@strlen.de>
+Alexander Barton <alex@barton.de>
+Florian Westphal <fw@strlen.de>
 
 
 Contributors
 ~~~~~~~~~~~~
-Ali Shemiran, <ashemira@ucsd.edu>
-Ask Bjørn Hansen, <ask@develooper.com>
-Benjamin Pineau, <ben@zouh.org>
-Brandon Beresini, <beresini@google.com>
-Bryan Caldwell, <bcaldwel@ucsd.edu>
-Dana Dahlstrom, <dana+ngIRCd@cs.ucsd.edu>
-Eric Grunow, <egrunow@ucsd.edu>
-Goetz Hoffart, <goetz@hoffart.de>
-Ilja Osthoff, <i.osthoff@gmx.net>
-Jari Aalto, <jari.aalto@cante.net>
-Rolf Eike Beer, <eike@sf-mail.de>
-Scott Perry, <scperry@ucsd.edu>
-Sean Reifschneider, <jafo-rpms@tummy.com>
+Ali Shemiran <ashemira@ucsd.edu>
+Ask Bjørn Hansen <ask@develooper.com>
+Benjamin Pineau <ben@zouh.org>
+Brandon Beresini <beresini@google.com>
+Brett Smith <brett@w3.org>
+Brian Collins <bricollins@gmail.com>
+Bryan Caldwell <bcaldwel@ucsd.edu>
+Christoph Biedl <ngircd.anoy@manchmal.in-ulm.de>
+DNS <dns@rbose.org>
+Dana Dahlstrom <dana+ngIRCd@cs.ucsd.edu>
+David Kingston <deathking1337@aim.com>
+Eric Grunow <egrunow@ucsd.edu>
+Federico G. Schwindt <fgsch@lodoss.net>
+Gabor Adam Toth <tg@tgbit.net>
+Goetz Hoffart <goetz@hoffart.de>
+Ilja Osthoff <i.osthoff@gmx.net>
+Jari Aalto <jari.aalto@cante.net>
+Neale Pickett <neale@woozle.org>
+Rolf Eike Beer <eike@sf-mail.de>
+Scott Perry <scperry@ucsd.edu>
+Sean Reifschneider <jafo-rpms@tummy.com>
+Sebastian Köhler <sebkoehler@whoami.org.uk>
+Tassilo Schweyer <dev@welterde.de>
+William Pitcock <nenolod@dereferenced.org>
+xor <xorboy@gmail.com>
 
 
 Code snippets
 ~~~~~~~~~~~~~
 J. Kercheval: pattern matching functions
-Patrick Powell, <papowell@astart.com>: snprintf()-function
+Patrick Powell <papowell@astart.com>: snprintf()-function
 Andrew Tridgell & Martin Pool: strl{cpy|cat}()-functions
index b1fa883d76fe27138544181b3c3aa9c15f74a055..cab3ca62c573e6da0ea81fe05a9c65371a999e58 100755 (executable)
@@ -73,8 +73,12 @@ Search()
        for name in $searchlist; do
                $EXIST "${name}" >/dev/null 2>&1
                if [ $? -eq 0 ]; then
-                       echo "${name}"
-                       return 0
+                       "${name}" --version 2>&1 \
+                        | grep -v "environment variable" >/dev/null 2>&1
+                       if [ $? -eq 0 ]; then
+                               echo "${name}"
+                               return 0
+                       fi
                fi
        done
 
@@ -144,6 +148,15 @@ echo "Searching for required tools ..."
 [ -z "$AUTOCONF" ] && AUTOCONF=`Search autoconf 2`
 [ "$VERBOSE" = "1" ] && echo " - AUTOCONF=$AUTOCONF"
 
+AUTOCONF_VERSION=`echo $AUTOCONF | cut -d'-' -f2-`
+[ -n "$AUTOCONF_VERSION" -a "$AUTOCONF_VERSION" != "autoconf" ] \
+       && export AUTOCONF_VERSION || unset AUTOCONF_VERSION
+[ "$VERBOSE" = "1" ] && echo " - AUTOCONF_VERSION=$AUTOCONF_VERSION"
+AUTOMAKE_VERSION=`echo $AUTOMAKE | cut -d'-' -f2-`
+[ -n "$AUTOMAKE_VERSION" -a "$AUTOMAKE_VERSION" != "automake" ] \
+       && export AUTOMAKE_VERSION || unset AUTOMAKE_VERSION
+[ "$VERBOSE" = "1" ] && echo " - AUTOMAKE_VERSION=$AUTOMAKE_VERSION"
+
 [ $# -gt 0 ] && CONFIGURE_ARGS=" $@" || CONFIGURE_ARGS=""
 [ -z "$GO" -a -n "$CONFIGURE_ARGS" ] && GO=1
 
@@ -153,7 +166,7 @@ echo "Searching for required tools ..."
 [ -z "$AUTOMAKE" ] && Notfound automake
 [ -z "$AUTOCONF" ] && Notfound autoconf
 
-AM_VERSION=`$AUTOMAKE --version|head -n 1|egrep -o "([1-9]\.[0-9]+(\.[0-9]+)*)"`
+AM_VERSION=`$AUTOMAKE --version | head -n 1 | sed -e 's/.* //g'`
 ifs=$IFS; IFS="."; set $AM_VERSION; IFS=$ifs
 AM_MAJOR="$1"; AM_MINOR="$2"; AM_PATCHLEVEL="$3"
 echo "Detected automake $AM_VERSION ..."
@@ -195,7 +208,7 @@ done
 export ACLOCAL AUTOHEADER AUTOMAKE AUTOCONF
 
 # Generate files
-echo "Generating files using GNU $AUTOCONF and $AUTOMAKE ..."
+echo "Generating files using \"$AUTOCONF\" and \"$AUTOMAKE\" ..."
 Run $ACLOCAL && \
        Run $AUTOCONF && \
        Run $AUTOHEADER && \
index c89096fd0f8febf02f3f1a08134ba7c686e387c3..034b565305232131f5e63126c49cab0a7768a150 100644 (file)
@@ -120,14 +120,14 @@ AC_HEADER_TIME
 
 # Required header files
 AC_CHECK_HEADERS([ \
-       fcntl.h netdb.h netinet/in.h netinet/in_systm.h stdlib.h string.h \
+       fcntl.h netdb.h netinet/in.h stdlib.h string.h \
        strings.h sys/socket.h sys/time.h unistd.h \
        ],,AC_MSG_ERROR([required C header missing!]))
 
 # Optional header files
 AC_CHECK_HEADERS_ONCE([ \
-       arpa/inet.h inttypes.h malloc.h netinet/ip.h stdbool.h stddef.h \
-       stdint.h varargs.h \
+       arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \
+       stdbool.h stddef.h stdint.h varargs.h \
        ])
 
 # -- Datatypes --
index 0aecde56e00ee6640b5155eab2c2a3974a908fb2..e02db2245d24123a48b2b4c47cd7c968b6ff987f 100755 (executable)
@@ -216,7 +216,7 @@ binary-arch: build install
        dh_installdocs -a
        dh_installinit -a
        dh_strip -a --no-package=ngircd-full-dbg
-       dh_compress -a
+       dh_compress -a -XCommands.txt
        dh_fixperms -a
        dh_installdeb -a
        dh_shlibdeps -a
index 00aafe05a170102a3e22053af73861b50b14e112..4eab2726a04393f40bc08ddec9ecfd4a4d5144c0 100644 (file)
@@ -131,11 +131,11 @@ Channel_InitPredefined( void )
 
                new_chan = Channel_Create(conf_chan->name);
                if (!new_chan) {
-                       Log(LOG_ERR, "Can't create pre-defined channel \"%s\"",
+                       Log(LOG_ERR, "Can't create pre-defined channel \"%s\"!",
                                                        conf_chan->name);
                        continue;
                }
-               Log(LOG_INFO, "Created pre-defined channel \"%s\"",
+               Log(LOG_INFO, "Created pre-defined channel \"%s\".",
                                                conf_chan->name);
 
                Channel_ModeAdd(new_chan, 'P');
index 2114f84ddbc8bcf6a6761db022524b880c6a1d85..d10775a88fad4a39ecb363dc7b6c433b5e497306 100644 (file)
@@ -239,9 +239,9 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen
 
        assert( Client != NULL );
 
-       if( LogMsg ) txt = LogMsg;
-       else txt = FwdMsg;
-       if( ! txt ) txt = "Reason unknown.";
+       txt = LogMsg ? LogMsg : FwdMsg;
+       if (!txt)
+               txt = "Reason unknown";
 
        /* netsplit message */
        if( Client->type == CLIENT_SERVER ) {
@@ -281,10 +281,15 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen
                                Destroy_UserOrService(c, txt, FwdMsg, SendQuit);
                        else if( c->type == CLIENT_SERVER )
                        {
-                               if( c != This_Server )
-                               {
-                                       if( c->conn_id != NONE ) Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
-                                       else Log( LOG_NOTICE|LOG_snotice, "Server \"%s\" unregistered: %s", c->id, txt );
+                               if (c != This_Server) {
+                                       if (c->conn_id != NONE)
+                                               Log(LOG_NOTICE|LOG_snotice,
+                                                   "Server \"%s\" unregistered (connection %d): %s.",
+                                               c->id, c->conn_id, txt);
+                                       else
+                                               Log(LOG_NOTICE|LOG_snotice,
+                                                   "Server \"%s\" unregistered: %s.",
+                                                   c->id, txt);
                                }
 
                                /* inform other servers */
@@ -296,13 +301,19 @@ Client_Destroy( CLIENT *Client, const char *LogMsg, const char *FwdMsg, bool Sen
                        }
                        else
                        {
-                               if( c->conn_id != NONE )
-                               {
-                                       if( c->id[0] ) Log( LOG_NOTICE, "Client \"%s\" unregistered (connection %d): %s", c->id, c->conn_id, txt );
-                                       else Log( LOG_NOTICE, "Client unregistered (connection %d): %s", c->conn_id, txt );
+                               if (c->conn_id != NONE) {
+                                       if (c->id[0])
+                                               Log(LOG_NOTICE,
+                                                   "Client \"%s\" unregistered (connection %d): %s.",
+                                                   c->id, c->conn_id, txt);
+                                       else
+                                               Log(LOG_NOTICE,
+                                                   "Client unregistered (connection %d): %s.",
+                                                   c->conn_id, txt);
                                } else {
-                                       Log(LOG_WARNING, "Unregistered unknown client \"%s\": %s",
-                                                               c->id[0] ? c->id : "(No Nick)", txt );
+                                       Log(LOG_WARNING,
+                                           "Unregistered unknown client \"%s\": %s",
+                                           c->id[0] ? c->id : "(No Nick)", txt);
                                }
                        }
 
@@ -1424,7 +1435,7 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool
        if(Client->conn_id != NONE) {
                /* Local (directly connected) client */
                Log(LOG_NOTICE,
-                   "%s \"%s\" unregistered (connection %d): %s",
+                   "%s \"%s\" unregistered (connection %d): %s.",
                    Client_TypeText(Client), Client_Mask(Client),
                    Client->conn_id, Txt);
                Log_ServerNotice('c', "Client exiting: %s (%s@%s) [%s]",
@@ -1442,7 +1453,7 @@ Destroy_UserOrService(CLIENT *Client, const char *Txt, const char *FwdMsg, bool
                }
        } else {
                /* Remote client */
-               LogDebug("%s \"%s\" unregistered: %s",
+               LogDebug("%s \"%s\" unregistered: %s.",
                         Client_TypeText(Client), Client_Mask(Client), Txt);
 
                if(SendQuit) {
index 80b085a83e2f3e4b6108ed36c30c8358ff5ac441..14d337b9408265b1213a157cd36cf66a8efc057e 100644 (file)
@@ -205,7 +205,7 @@ cb_connserver(int sock, UNUSED short what)
                            My_Connections[idx].host, Conf_Server[server].port,
                            idx, strerror(err));
 
-               Conn_Close(idx, "Can't connect!", NULL, false);
+               Conn_Close(idx, "Can't connect", NULL, false);
 
                if (ng_ipaddr_af(&Conf_Server[server].dst_addr[0])) {
                        /* more addresses to try... */
@@ -282,7 +282,7 @@ cb_connserver_login_ssl(int sock, short unused)
                return;
        case -1:
                Log(LOG_ERR, "SSL connection on socket %d failed!", sock);
-               Conn_Close(idx, "Can't connect!", NULL, false);
+               Conn_Close(idx, "Can't connect", NULL, false);
                return;
        }
 
@@ -454,7 +454,7 @@ Conn_CloseAllSockets(int ExceptOf)
  * @returns            Number of listening sockets created.
  */
 static unsigned int
-ports_initlisteners(array *a, const char *listen_addr, void (*func)(int,short))
+Init_Listeners(array *a, const char *listen_addr, void (*func)(int,short))
 {
        unsigned int created = 0;
        size_t len;
@@ -470,8 +470,9 @@ ports_initlisteners(array *a, const char *listen_addr, void (*func)(int,short))
                        continue;
                }
                if (!io_event_create( fd, IO_WANTREAD, func )) {
-                       Log( LOG_ERR, "io_event_create(): Could not add listening fd %d (port %u): %s!",
-                                               fd, (unsigned int) *port, strerror(errno));
+                       Log(LOG_ERR,
+                           "io_event_create(): Can't add fd %d (port %u): %s!",
+                           fd, (unsigned int) *port, strerror(errno));
                        close(fd);
                        port++;
                        continue;
@@ -500,7 +501,8 @@ Conn_InitListeners( void )
        /* can't use Conf_ListenAddress directly, see below */
        copy = strdup(Conf_ListenAddress);
        if (!copy) {
-               Log(LOG_CRIT, "Cannot copy %s: %s", Conf_ListenAddress, strerror(errno));
+               Log(LOG_CRIT, "Cannot copy %s: %s", Conf_ListenAddress,
+                   strerror(errno));
                return 0;
        }
        listen_addr = strtok(copy, ",");
@@ -508,9 +510,11 @@ Conn_InitListeners( void )
        while (listen_addr) {
                ngt_TrimStr(listen_addr);
                if (*listen_addr) {
-                       created += ports_initlisteners(&Conf_ListenPorts, listen_addr, cb_listen);
+                       created += Init_Listeners(&Conf_ListenPorts,
+                                                 listen_addr, cb_listen);
 #ifdef SSL_SUPPORT
-                       created += ports_initlisteners(&Conf_SSLOptions.ListenPorts, listen_addr, cb_listen_ssl);
+                       created += Init_Listeners(&Conf_SSLOptions.ListenPorts,
+                                                 listen_addr, cb_listen_ssl);
 #endif
                }
 
@@ -568,7 +572,7 @@ InitSinaddrListenAddr(ng_ipaddr_t *addr, const char *listen_addrstr, UINT16 Port
        ret = ng_ipaddr_init(addr, listen_addrstr, Port);
        if (!ret) {
                assert(listen_addrstr);
-               Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"",
+               Log(LOG_CRIT, "Can't bind to [%s]:%u: can't convert ip address \"%s\"!",
                                                listen_addrstr, Port, listen_addrstr);
        }
        return ret;
@@ -620,8 +624,9 @@ NewListener(const char *listen_addr, UINT16 Port)
 
        af = ng_ipaddr_af(&addr);
        sock = socket(af, SOCK_STREAM, 0);
-       if( sock < 0 ) {
-               Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af, strerror(errno));
+       if (sock < 0) {
+               Log(LOG_CRIT, "Can't create socket (af %d) : %s!", af,
+                   strerror(errno));
                return -1;
        }
 
@@ -631,22 +636,23 @@ NewListener(const char *listen_addr, UINT16 Port)
                return -1;
 
        if (bind(sock, (struct sockaddr *)&addr, ng_ipaddr_salen(&addr)) != 0) {
-               Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s",
-                       ng_ipaddr_tostr(&addr), Port, strerror(errno));
+               Log(LOG_CRIT, "Can't bind socket to address %s:%d - %s!",
+                   ng_ipaddr_tostr(&addr), Port, strerror(errno));
                close(sock);
                return -1;
        }
 
-       if( listen( sock, 10 ) != 0 ) {
-               Log( LOG_CRIT, "Can't listen on socket: %s!", strerror( errno ));
-               close( sock );
+       if (listen(sock, 10) != 0) {
+               Log(LOG_CRIT, "Can't listen on socket: %s!", strerror(errno));
+               close(sock);
                return -1;
        }
 
        /* keep fd in list so we can close it when ngircd restarts/shuts down */
-       if (!array_catb( &My_Listeners,(char*) &sock, sizeof(int) )) {
-               Log( LOG_CRIT, "Can't add socket to My_Listeners array: %s!", strerror( errno ));
-               close( sock );
+       if (!array_catb(&My_Listeners, (char *)&sock, sizeof(int))) {
+               Log(LOG_CRIT, "Can't add socket to My_Listeners array: %s!",
+                   strerror(errno));
+               close(sock);
                return -1;
        }
 
@@ -1078,7 +1084,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
        Conn_OPTION_ADD( &My_Connections[Idx], CONN_ISCLOSING );
 
        port = ng_ipaddr_getport(&My_Connections[Idx].addr);
-       Log(LOG_INFO, "Shutting down connection %d (%s) with %s:%d ...", Idx,
+       Log(LOG_INFO, "Shutting down connection %d (%s) with \"%s:%d\" ...", Idx,
            LogMsg ? LogMsg : FwdMsg, My_Connections[Idx].host, port);
 
        /* Search client, if any */
@@ -1152,7 +1158,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
                in_p = (int)(( in_k * 100 ) / in_z_k );
                out_p = (int)(( out_k * 100 ) / out_z_k );
                Log(LOG_INFO,
-                   "Connection %d with %s:%d closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
+                   "Connection %d with \"%s:%d\" closed (in: %.1fk/%.1fk/%d%%, out: %.1fk/%.1fk/%d%%).",
                    Idx, My_Connections[Idx].host, port,
                    in_k, in_z_k, in_p, out_k, out_z_k, out_p);
        }
@@ -1160,7 +1166,7 @@ Conn_Close( CONN_ID Idx, const char *LogMsg, const char *FwdMsg, bool InformClie
 #endif
        {
                Log(LOG_INFO,
-                   "Connection %d with %s:%d closed (in: %.1fk, out: %.1fk).",
+                   "Connection %d with \"%s:%d\" closed (in: %.1fk, out: %.1fk).",
                    Idx, My_Connections[Idx].host, port,
                    in_k, out_k);
        }
@@ -1500,7 +1506,7 @@ New_Connection(int Sock, UNUSED bool IsSSL)
 
        Client_SetHostname(c, My_Connections[new_sock].host);
 
-       Log(LOG_INFO, "Accepted connection %d from %s:%d on socket %d.",
+       Log(LOG_INFO, "Accepted connection %d from \"%s:%d\" on socket %d.",
            new_sock, My_Connections[new_sock].host,
            ng_ipaddr_getport(&new_addr), Sock);
        Account_Connection();
@@ -1629,13 +1635,10 @@ Read_Request( CONN_ID Idx )
 #endif
        len = read(My_Connections[Idx].sock, readbuf, sizeof(readbuf));
        if (len == 0) {
-               Log(LOG_INFO, "%s:%u (%s) is closing the connection ...",
-                               My_Connections[Idx].host,
-                               (unsigned int) ng_ipaddr_getport(&My_Connections[Idx].addr),
-                               ng_ipaddr_tostr(&My_Connections[Idx].addr));
-               Conn_Close(Idx,
-                          "Socket closed!", "Client closed connection",
-                          false);
+               LogDebug("Client \"%s:%u\" is closing connection %d ...",
+                        My_Connections[Idx].host,
+                        ng_ipaddr_tostr(&My_Connections[Idx].addr), Idx);
+               Conn_Close(Idx, NULL, "Client closed connection", false);
                return;
        }
 
@@ -1643,7 +1646,7 @@ Read_Request( CONN_ID Idx )
                if( errno == EAGAIN ) return;
                Log(LOG_ERR, "Read error on connection %d (socket %d): %s!",
                    Idx, My_Connections[Idx].sock, strerror(errno));
-               Conn_Close(Idx, "Read error!", "Client closed connection",
+               Conn_Close(Idx, "Read error", "Client closed connection",
                           false);
                return;
        }
index cce6ef536557e7376bf93a1a8df9f912218ae0e4..dab3043983364e6997effff4055eab9c8a1400a9 100644 (file)
@@ -631,7 +631,7 @@ io_library_init_kqueue(unsigned int eventsize)
        io_masterfd = kqueue();
 
        Log(LOG_INFO,
-           "IO subsystem: kqueue (initial maxfd %u, masterfd %d)",
+           "IO subsystem: kqueue (initial maxfd %u, masterfd %d).",
            eventsize, io_masterfd);
        if (io_masterfd >= 0)
                library_initialized = true;
index 57d6e1a2e327afbe5261d180bda6caac727d4e9a..f9c9b0d2423c97b2ed8e2bf596a5f56fa1efa3ca 100644 (file)
@@ -893,7 +893,8 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
 
                is_visible = strchr(client_modes, 'i') == NULL;
                if (is_member || is_visible) {
-                       strcpy(flags, who_flags_status(client_modes));
+                       strlcpy(flags, who_flags_status(client_modes),
+                               sizeof(flags));
                        if (is_ircop)
                                strlcat(flags, "*", sizeof(flags));
 
@@ -950,7 +951,7 @@ IRC_WHO_Mask(CLIENT *Client, char *Mask, bool OnlyOps)
                if (Mask) {
                        /* Match pattern against user host/server/name/nick */
                        client_match = MatchCaseInsensitive(Mask,
-                                               Client_Hostname(c));
+                                               Client_HostnameDisplayed(c));
                        if (!client_match)
                                client_match = MatchCaseInsensitive(Mask,
                                                Client_ID(Client_Introducer(c)));
@@ -1132,14 +1133,20 @@ IRC_WHOIS_SendReply(CLIENT *Client, CLIENT *from, CLIENT *c)
                        return DISCONNECTED;
        }
 
+       /* Service? */
+       if (Client_Type(c) == CLIENT_SERVICE &&
+           !IRC_WriteStrClient(from, RPL_WHOISSERVICE_MSG,
+                               Client_ID(from), Client_ID(c)))
+               return DISCONNECTED;
+
        /* IRC-Operator? */
-       if (Client_HasMode(c, 'o') &&
+       if (Client_HasMode(c, 'o') && Client_Type(c) != CLIENT_SERVICE &&
            !IRC_WriteStrClient(from, RPL_WHOISOPERATOR_MSG,
                                Client_ID(from), Client_ID(c)))
                return DISCONNECTED;
 
        /* IRC-Bot? */
-       if (Client_HasMode(c, 'B') &&
+       if (Client_HasMode(c, 'B') && Client_Type(c) != CLIENT_SERVICE &&
            !IRC_WriteStrClient(from, RPL_WHOISBOT_MSG,
                                Client_ID(from), Client_ID(c)))
                return DISCONNECTED;
@@ -1261,7 +1268,8 @@ IRC_WHOIS( CLIENT *Client, REQUEST *Req )
                 */
                if (!has_wildcards || is_remote) {
                        c = Client_Search(query);
-                       if (c && Client_Type(c) == CLIENT_USER) {
+                       if (c && (Client_Type(c) == CLIENT_USER
+                                 || Client_Type(c) == CLIENT_SERVICE)) {
                                if (!IRC_WHOIS_SendReply(Client, from, c))
                                        return DISCONNECTED;
                        } else {
index 80a6627fcccf43fa91e25c730922ce5d98996122..e7d83eff301c3491c83d71f9892944c0f6e5c480 100644 (file)
@@ -691,11 +691,11 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req )
                }
 
                if (target != Client) {
-                       Client_Destroy(target, "Got QUIT command.",
+                       Client_Destroy(target, "Got QUIT command",
                                       Req->argc == 1 ? quitmsg : NULL, true);
                        return CONNECTED;
                } else {
-                       Conn_Close(Client_Conn(Client), "Got QUIT command.",
+                       Conn_Close(Client_Conn(Client), "Got QUIT command",
                                   Req->argc == 1 ? quitmsg : NULL, true);
                        return DISCONNECTED;
                }
@@ -708,7 +708,7 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req )
                }
 
                /* User, Service, or not yet registered */
-               Conn_Close(Client_Conn(Client), "Got QUIT command.",
+               Conn_Close(Client_Conn(Client), "Got QUIT command",
                           Req->argc == 1 ? quitmsg : NULL, true);
 
                return DISCONNECTED;
@@ -907,8 +907,9 @@ IRC_PONG(CLIENT *Client, REQUEST *Req)
 
        if (Client_Type(Client) == CLIENT_SERVER && Conn_LastPing(conn) == 0) {
                Log(LOG_INFO,
-                   "Synchronization with \"%s\" done (connection %d): %ld seconds [%ld users, %ld channels]",
+                   "Synchronization with \"%s\" done (connection %d): %ld second%s [%ld users, %ld channels].",
                    Client_ID(Client), conn, time(NULL) - Conn_GetSignon(conn),
+                   time(NULL) - Conn_GetSignon(conn) == 1 ? "" : "s",
                    Client_UserCount(), Channel_CountVisible(NULL));
                Conn_UpdatePing(conn);
        } else
@@ -938,7 +939,7 @@ Kill_Nick(char *Nick, char *Reason)
        r.argv[1] = Reason;
        r.argc = 2;
 
-       Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s",
+       Log(LOG_ERR, "User(s) with nick \"%s\" will be disconnected: %s!",
            Nick, Reason);
 
        IRC_KILL(Client_ThisServer(), &r);
index a587c52f6de794482e5e732e689c2e4dff27d47b..0a9e930d816f696b5fc784fa6857c063fbf49744 100644 (file)
@@ -352,7 +352,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
 
        if (Req->argv[1][0])
                if (Client_NextHop(from) != Client || con > NONE)
-                       snprintf(msg, sizeof(msg), "%s (SQUIT from %s)",
+                       snprintf(msg, sizeof(msg), "\"%s\" (SQUIT from %s)",
                                 Req->argv[1], Client_ID(from));
                else
                        strlcpy(msg, Req->argv[1], sizeof(msg));
@@ -385,7 +385,7 @@ IRC_SQUIT(CLIENT * Client, REQUEST * Req)
                        logmsg[0] = '\0';
                        if (!strchr(msg, '('))
                                snprintf(logmsg, sizeof(logmsg),
-                                        "%s (SQUIT from %s)", Req->argv[1],
+                                        "\"%s\" (SQUIT from %s)", Req->argv[1],
                                         Client_ID(from));
                        Client_Destroy(target, logmsg[0] ? logmsg : msg,
                                       msg, false);
index e76abcb8a4af00250d819d00d332ca4a5cdc0f65..37df06873bb30e99c78d91c360d23a09b9bbfec1 100644 (file)
@@ -154,7 +154,7 @@ IRC_KILL( CLIENT *Client, REQUEST *Req )
 
        if (Client != Client_ThisServer())
                Log(LOG_NOTICE|LOG_snotice,
-                   "Got KILL command from \"%s\" for \"%s\": %s",
+                   "Got KILL command from \"%s\" for \"%s\": \"%s\".",
                    Client_Mask(prefix), Req->argv[0], Req->argv[1]);
 
        /* Build reason string: Prefix the "reason" if the originator is a
index 51bd2a5dc64d4989921e2f30445bab72c94cb997..375f4bc1f6ab605ecbfe659367c82812b981a1a0 100644 (file)
@@ -109,8 +109,9 @@ Log_ReInit(void)
 GLOBAL void
 Log_Exit( void )
 {
-       Log(LOG_NOTICE, "%s done%s, served %lu connections.", PACKAGE_NAME,
-           NGIRCd_SignalRestart ? " (restarting)" : "", Conn_CountAccepted());
+       Log(LOG_NOTICE, "%s done%s, served %lu connection%s.", PACKAGE_NAME,
+           NGIRCd_SignalRestart ? " (restarting)" : "", Conn_CountAccepted(),
+           Conn_CountAccepted() == 1 ? "" : "s");
 #ifdef SYSLOG
        closelog();
 #endif
index a6a6d8c24559457d70adacc5cffb78dc3152f214..371abc262d7dc6f708a7cee156884d6d2186efa5 100644 (file)
@@ -56,6 +56,7 @@
 #define RPL_UNAWAY_MSG                 "305 %s :You are no longer marked as being away"
 #define RPL_NOWAWAY_MSG                        "306 %s :You have been marked as being away"
 #define RPL_WHOISREGNICK_MSG           "307 %s %s :is a registered nick"
+#define RPL_WHOISSERVICE_MSG           "310 %s %s :is an IRC service"
 #define RPL_WHOISUSER_MSG              "311 %s %s %s %s * :%s"
 #define RPL_WHOISSERVER_MSG            "312 %s %s %s :%s"
 #define RPL_WHOISOPERATOR_MSG          "313 %s %s :is an IRC operator"
index dfae3366d1f72655cc8cc0e51088b369d9218114..e28c370b47af675ab000cf28bf9add9e0afc529d 100644 (file)
@@ -535,16 +535,18 @@ Pidfile_Create(pid_t pid)
 
        len = snprintf(pidbuf, sizeof pidbuf, "%ld\n", (long)pid);
        if (len < 0 || len >= (int)sizeof pidbuf) {
-               Log(LOG_ERR, "Error converting pid");
+               Log(LOG_ERR, "Error converting process ID!");
                close(pidfd);
                return;
        }
        
        if (write(pidfd, pidbuf, (size_t)len) != (ssize_t)len)
-               Log( LOG_ERR, "Can't write PID file (%s): %s", Conf_PidFile, strerror( errno ));
+               Log(LOG_ERR, "Can't write PID file (%s): %s!", Conf_PidFile,
+                   strerror(errno));
 
-       if( close(pidfd) != 0 )
-               Log( LOG_ERR, "Error closing PID file (%s): %s", Conf_PidFile, strerror( errno ));
+       if (close(pidfd) != 0)
+               Log(LOG_ERR, "Error closing PID file (%s): %s!", Conf_PidFile,
+                   strerror(errno));
 } /* Pidfile_Create */
 
 
@@ -678,14 +680,14 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
        /* Change root */
        if (Conf_Chroot[0]) {
                if (chdir(Conf_Chroot) != 0) {
-                       Log(LOG_ERR, "Can't chdir() in ChrootDir (%s): %s",
+                       Log(LOG_ERR, "Can't chdir() in ChrootDir (%s): %s!",
                            Conf_Chroot, strerror(errno));
                        goto out;
                }
 
                if (chroot(Conf_Chroot) != 0) {
                        Log(LOG_ERR,
-                           "Can't change root directory to \"%s\": %s",
+                           "Can't change root directory to \"%s\": %s!",
                            Conf_Chroot, strerror(errno));
                        goto out;
                } else {
@@ -716,7 +718,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
                if (setgid(Conf_GID) != 0) {
                        real_errno = errno;
                        grp = getgrgid(Conf_GID);
-                       Log(LOG_ERR, "Can't change group ID to %s(%u): %s",
+                       Log(LOG_ERR, "Can't change group ID to %s(%u): %s!",
                            grp ? grp->gr_name : "?", Conf_GID,
                            strerror(errno));
                        if (real_errno != EPERM) 
@@ -730,7 +732,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
                if (setuid(Conf_UID) != 0) {
                        real_errno = errno;
                        pwd = getpwuid(Conf_UID);
-                       Log(LOG_ERR, "Can't change user ID to %s(%u): %s",
+                       Log(LOG_ERR, "Can't change user ID to %s(%u): %s!",
                            pwd ? pwd->pw_name : "?", Conf_UID,
                            strerror(errno));
                        if (real_errno != EPERM)
@@ -764,7 +766,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
                setpgrp(0, getpid());
 #endif
                if (chdir("/") != 0)
-                       Log(LOG_ERR, "Can't change directory to '/': %s",
+                       Log(LOG_ERR, "Can't change directory to '/': %s!",
                                     strerror(errno));
 
                /* Detach stdin, stdout and stderr */
@@ -808,7 +810,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
                            pwd->pw_dir);
                else
                        Log(LOG_INFO,
-                           "Notice: Can't change working directory to \"%s\": %s",
+                           "Notice: Can't change working directory to \"%s\": %s!",
                            pwd->pw_dir, strerror(errno));
        } else
                Log(LOG_ERR, "Can't get user informaton for UID %d!?", Conf_UID);