From a2df1406cdebb71a06ff0dc8b35f3dce98954c76 Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Fri, 13 Jul 2018 10:52:09 +0200 Subject: [PATCH] console: added parameter UsePamAuthentication --- core/src/console/console.cc | 8 +++++--- core/src/console/console_conf.cc | 1 + core/src/console/console_conf.h | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/console/console.cc b/core/src/console/console.cc index 0445bf46303..6bf47f77022 100644 --- a/core/src/console/console.cc +++ b/core/src/console/console.cc @@ -1442,9 +1442,11 @@ int main(int argc, char *argv[]) sendit(errmsg); - if (!ConsolePamAuthenticate(stdin, UA_sock)) { - TerminateConsole(0); - return 1; + if (dir && dir->use_pam_authentication) { + if (!ConsolePamAuthenticate(stdin, UA_sock)) { + TerminateConsole(0); + return 1; + } } Dmsg0(40, "Opened connection with Director daemon\n"); diff --git a/core/src/console/console_conf.cc b/core/src/console/console_conf.cc index 2f8c419bdcb..8528670f22f 100644 --- a/core/src/console/console_conf.cc +++ b/core/src/console/console_conf.cc @@ -96,6 +96,7 @@ static ResourceItem dir_items[] = { { "Address", CFG_TYPE_STR, ITEM(res_dir.address), 0, 0, NULL, NULL, NULL }, { "Password", CFG_TYPE_MD5PASSWORD, ITEM(res_dir.password), 0, CFG_ITEM_REQUIRED, NULL, NULL, NULL }, { "HeartbeatInterval", CFG_TYPE_TIME, ITEM(res_dir.heartbeat_interval), 0, CFG_ITEM_DEFAULT, "0", NULL, NULL }, + { "UsePamAuthentication", CFG_TYPE_BOOL, ITEM(res_dir.use_pam_authentication), 0, CFG_ITEM_DEFAULT, "false", NULL, NULL }, TLS_COMMON_CONFIG(res_dir), TLS_CERT_CONFIG(res_dir), TLS_PSK_CONFIG(res_dir), diff --git a/core/src/console/console_conf.h b/core/src/console/console_conf.h index 0c676b4e828..1294d7cdc95 100644 --- a/core/src/console/console_conf.h +++ b/core/src/console/console_conf.h @@ -72,6 +72,7 @@ class DirectorResource : public TlsResource { uint32_t DIRport; /**< UA server port */ char *address; /**< UA server address */ utime_t heartbeat_interval; /**< Interval to send heartbeats to Dir */ + bool use_pam_authentication; /**< Use Pam authentication instead of password */ DirectorResource() : TlsResource() {} };