2019-06-21 Fred Gleason <fredg@paravelsystems.com>

* Added 'RDApplication::syslog()' methods.
This commit is contained in:
Fred Gleason
2019-06-24 16:40:18 -04:00
parent 52dc14a3b3
commit f50447eb8b
71 changed files with 1064 additions and 887 deletions

View File

@@ -2,7 +2,7 @@
//
// Authenticate a PAM name.
//
// (C) Copyright 2010,2016 Fred Gleason <fredg@paravelsystems.com>
// (C) Copyright 2010-2019 Fred Gleason <fredg@paravelsystems.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@@ -29,7 +29,8 @@
#include <qstringlist.h>
#include <rdpam.h>
#include "rdapplication.h"
#include "rdpam.h"
int RDPamCallback(int num_msg, const struct pam_message **msg,
struct pam_response **resp, void *appdata_ptr)
@@ -47,12 +48,12 @@ int RDPamCallback(int num_msg, const struct pam_message **msg,
break;
case PAM_PROMPT_ECHO_ON:
syslog(LOG_ERR,"unhandled PAM request: %s",msg[i]->msg);
rda->syslog(LOG_ERR,"unhandled PAM request: %s",msg[i]->msg);
break;
case PAM_ERROR_MSG:
case PAM_TEXT_INFO:
syslog(LOG_NOTICE,"PAM message: %s",msg[i]->msg);
rda->syslog(LOG_NOTICE,"PAM message: %s",msg[i]->msg);
break;
}
}
@@ -79,7 +80,7 @@ bool RDPam::authenticate(const QString &username,const QString &token)
conv.conv=RDPamCallback;
conv.appdata_ptr=(RDPam *)this;
if((err=pam_start(system_pam_service,username,&conv,&pamh))!=PAM_SUCCESS) {
syslog(LOG_NOTICE,"PAM Error: %s",pam_strerror(pamh,err));
rda->syslog(LOG_NOTICE,"PAM Error: %s",pam_strerror(pamh,err));
pam_end(pamh,err);
CleanupPam();
return false;