]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/login.c
Pidfile_Create(): Don't leak file descriptor on error path
[ngircd-alex.git] / src / ngircd / login.c
index 2c305402d77893158ac009ad989303ed53a8ddbf..7f0299cb09088622b03787a7815950db772f02c7 100644 (file)
@@ -19,6 +19,7 @@
 #include "imp.h"
 #include <assert.h>
 #include <stdlib.h>
+#include <string.h>
 #include <strings.h>
 #include <unistd.h>
 
@@ -26,6 +27,7 @@
 #include "conn.h"
 #include "class.h"
 #include "client.h"
+#include "client-cap.h"
 #include "channel.h"
 #include "conf.h"
 #include "io.h"
@@ -78,6 +80,13 @@ Login_User(CLIENT * Client)
        }
 #endif
 
+       /* Still waiting for "CAP END" command? */
+       if (Client_Cap(Client) & CLIENT_CAP_PENDING) {
+               Client_SetType(Client, CLIENT_WAITCAPEND);
+               LogDebug("Connection %d: Waiting for CAP END ...", conn);
+               return CONNECTED;
+       }
+
 #ifdef PAM
        if (!Conf_PAM) {
                /* Don't do any PAM authentication at all, instead emulate