Code

frontend: Always store errors in the error buffer.
[sysdb.git] / src / frontend / connection.c
index b4f170bb1d759c2289148d2ce31e8006277110eb..8d7123a1beb13ab77956403659c8be8d81bfdc01 100644 (file)
@@ -265,6 +265,7 @@ command_handle(sdb_conn_t *conn)
 
        if ((! conn->username) && (conn->cmd != CONNECTION_STARTUP)) {
                const char *errmsg = "Authentication required";
+               sdb_strbuf_sprintf(conn->errbuf, errmsg);
                sdb_connection_send(conn, CONNECTION_ERROR,
                                (uint32_t)strlen(errmsg), errmsg);
                return -1;