]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/irc-login.c
Add Doxygen @file documentation to each source and header file
[ngircd-alex.git] / src / ngircd / irc-login.c
index b1b739b85a666c921371531ba4882da9991d6b72..b310d8b84614e7a37737825518125d9eb78ca705 100644 (file)
@@ -7,13 +7,16 @@
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
  * Please read the file COPYING, README and AUTHORS for more information.
- *
- * Login and logout
  */
 
 
 #include "portab.h"
 
+/**
+ * @file
+ * Login and logout
+ */
+
 #include "imp.h"
 #include <assert.h>
 #include <stdio.h>
@@ -143,16 +146,17 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
                if (type && strcmp(type, PROTOIRCPLUS) == 0) {
                        /* The peer seems to be a server which supports the
                         * IRC+ protocol (see doc/Protocol.txt). */
-                       serverver = ptr + 1;
-                       flags = strchr(serverver, ':');
+                       serverver = ptr ? ptr + 1 : "?";
+                       flags = strchr(ptr ? serverver : impl, ':');
                        if (flags) {
                                *flags = '\0';
                                flags++;
                        } else
                                flags = "";
                        Log(LOG_INFO,
-                           "Peer announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
-                           impl, serverver, protohigh, protolow, flags);
+                           "Peer on conenction %d announces itself as %s-%s using protocol %d.%d/IRC+ (flags: \"%s\").",
+                           Client_Conn(Client), impl, serverver,
+                           protohigh, protolow, flags);
                } else {
                        /* The peer seems to be a server supporting the
                         * "original" IRC protocol (RFC 2813). */
@@ -161,8 +165,9 @@ IRC_PASS( CLIENT *Client, REQUEST *Req )
                        else
                                flags = "";
                        Log(LOG_INFO,
-                           "Peer announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
-                           impl, protohigh, protolow, flags);
+                           "Peer on connection %d announces itself as \"%s\" using protocol %d.%d (flags: \"%s\").",
+                           Client_Conn(Client), impl,
+                           protohigh, protolow, flags);
                }
                Client_SetFlags(Client, flags);
        }
@@ -778,7 +783,7 @@ Hello_User(CLIENT * Client)
        assert(Client != NULL);
        conn = Client_Conn(Client);
 
-       if (Conf_NoPAM) {
+       if (!Conf_PAM) {
                /* Don't do any PAM authentication at all, instead emulate
                 * the beahiour of the daemon compiled without PAM support:
                 * because there can't be any "server password", all
@@ -789,7 +794,10 @@ Hello_User(CLIENT * Client)
                return DISCONNECTED;
        }
 
-       pid = Proc_Fork(Conn_GetProcStat(conn), pipefd, cb_Read_Auth_Result);
+       /* Fork child process for PAM authentication; and make sure that the
+        * process timeout is set higher than the login timeout! */
+       pid = Proc_Fork(Conn_GetProcStat(conn), pipefd,
+                       cb_Read_Auth_Result, Conf_PongTimeout + 1);
        if (pid > 0) {
                LogDebug("Authenticator for connection %d created (PID %d).",
                         conn, pid);