summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be7975a)
raw | patch | inline | side by side (parent: be7975a)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Feb 2014 21:08:54 +0000 (22:08 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 5 Feb 2014 21:08:54 +0000 (22:08 +0100) |
src/frontend/connection.c | patch | blob | history |
index f780979cac6ed333104d26f15bf2c8829184fb24..24735de2f0e55fac5ce8f7313445068f0ce9263e 100644 (file)
sdb_log(SDB_LOG_DEBUG, "frontend: Handling command %u (len: %u)",
conn->cmd, conn->cmd_len);
+ if ((! conn->username) && (conn->cmd != CONNECTION_STARTUP)) {
+ const char *errmsg = "Authentication required";
+ sdb_connection_send(conn, CONNECTION_ERROR,
+ (uint32_t)strlen(errmsg), errmsg);
+ return -1;
+ }
+
/* reset */
sdb_strbuf_sprintf(conn->errbuf, "");