Code

proto: Fixed/clarified authentication handshake options during startup.
[sysdb.git] / src / client / sock.c
index b60bad45e2cf97d47d2c101513c030f4a27fff5e..82a48a62534a6e0d0b00dee704e58cf821dc998c 100644 (file)
@@ -193,10 +193,15 @@ sdb_client_connect(sdb_client_t *client, const char *username)
                sdb_log(SDB_LOG_ERR, "Encountered end-of-file while waiting "
                                "for server response");
 
-       if (rstatus != CONNECTION_OK) {
+       if (rstatus == CONNECTION_ERROR) {
                sdb_log(SDB_LOG_ERR, "Access denied for user '%s'", username);
                status = -((int)rstatus);
        }
+       else if (rstatus != CONNECTION_OK) {
+               sdb_log(SDB_LOG_ERR, "Received unsupported authentication request "
+                               "(status %d) during startup", (int)rstatus);
+               status = -((int)rstatus);
+       }
 
        sdb_client_close(client);
        sdb_strbuf_destroy(buf);