diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-07-05 21:28:14 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2020-07-05 21:28:14 +0200 |
commit | 236983125ffb300bb68bd5d56107750118e5fe96 (patch) | |
tree | 97f858bf3326f57e5523b035abbe6cc9f06836e2 /src/connectionhandler.cc | |
parent | feeb7602a9b386dfdd61190ce633a3b56a10c68f (diff) |
Use password file for authentication.
Diffstat (limited to 'src/connectionhandler.cc')
-rw-r--r-- | src/connectionhandler.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/connectionhandler.cc b/src/connectionhandler.cc index 8b48c03..419556e 100644 --- a/src/connectionhandler.cc +++ b/src/connectionhandler.cc @@ -30,6 +30,7 @@ #include <stdio.h> #include "hugin.hpp" +#include "acl.h" // Global ConnectionHandler. ConnectionHandler connection_handler; @@ -57,9 +58,13 @@ void ConnectionHandler::close(clientid_t clientid) DEBUG(conn, "Removed connection\n"); } -void ConnectionHandler::login(clientid_t clientid, std::string user, std::string password) +void ConnectionHandler::login(clientid_t clientid, + const std::string& user, + const std::string& password) { - authlist[clientid] = (password == "hundemad"); + ACL acl(CONFDIR"/users"); + acl.load(); + authlist[clientid] = acl.checkPassword(user, password); DEBUG(conn, "Authentication %d\n", authlist[clientid]); } |