From 236983125ffb300bb68bd5d56107750118e5fe96 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 5 Jul 2020 21:28:14 +0200 Subject: Use password file for authentication. --- src/connectionhandler.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/connectionhandler.cc') 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 #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]); } -- cgit v1.2.3