diff --git a/src/frontend/session.c b/src/frontend/session.c
index ab45cdd17c30cb154a7cf051cf940ba11e47e4b0..ed68c61cc747e89dbbadba928a29536cca702bb5 100644 (file)
--- a/src/frontend/session.c
+++ b/src/frontend/session.c
username[conn->cmd_len] = '\0';
if (! conn->username) {
username[conn->cmd_len] = '\0';
if (! conn->username) {
- /* We couldn't determine the remote peer when setting up the
- * connection; TODO: add support for password authentication */
- sdb_strbuf_sprintf(conn->errbuf, "Password authentication "
- "not supported");
- return -1;
+ /* We trust the remote peer.
+ * TODO: make the auth mechanism configurable */
+ conn->username = strdup(username);
}
}
- if (strcmp(conn->username, username)) {
+ else if (strcmp(conn->username, username)) {
sdb_strbuf_sprintf(conn->errbuf, "%s cannot act on behalf of %s",
conn->username, username);
return -1;
sdb_strbuf_sprintf(conn->errbuf, "%s cannot act on behalf of %s",
conn->username, username);
return -1;