]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Don't crash at startup if auth socket name doesn't contain "-".
authorTimo Sirainen <tss@iki.fi>
Mon, 24 Aug 2009 20:44:03 +0000 (16:44 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 24 Aug 2009 20:44:03 +0000 (16:44 -0400)
--HG--
branch : HEAD

src/auth/main.c

index 7dbcb65caaef4fd44e1bc9a3b9fa49aee20e9175..52e14f8e43dbf9e4a7252eed2a168aa598e956bf 100644 (file)
@@ -141,7 +141,9 @@ static void client_connected(const struct master_service_connection *conn)
                }
 
                suffix = strrchr(sa.sun_path, '-');
-               if (strcmp(suffix, "master") == 0)
+               if (suffix == NULL)
+                       *type = AUTH_SOCKET_CLIENT;
+               else if (strcmp(suffix, "master") == 0)
                        *type = AUTH_SOCKET_MASTER;
                else if (strcmp(suffix, "userdb") == 0)
                        *type = AUTH_SOCKET_USERDB;