Commit 24ed1e41 24ed1e413c672174ab499b436c1161f968de6233 by Sergey Poznyakoff

Use pam_service instead of hardcoding PAM service name

1 parent 605591d4
......@@ -131,7 +131,7 @@ imap4d_login (struct imap4d_command *command, char *arg)
_pwd = pass;
/* libpam doesn't log to LOG_MAIL */
closelog ();
pamerror = pam_start ("gnu-imap4d", username, &PAM_conversation, &pamh);
pamerror = pam_start (pam_service, username, &PAM_conversation, &pamh);
PAM_ERROR;
pamerror = pam_authenticate (pamh, 0);
PAM_ERROR;
......@@ -140,7 +140,7 @@ imap4d_login (struct imap4d_command *command, char *arg)
pamerror = pam_setcred (pamh, PAM_ESTABLISH_CRED);
PAM_ERROR;
pam_end (pamh, PAM_SUCCESS);
openlog ("gnu-imap4d", LOG_PID, LOG_FACILITY);
openlog ("gnu-imap4d", LOG_PID, log_facility);
#endif /* USE_LIBPAM */
if (pw->pw_uid > 0 && !mu_virtual_domain)
......
......@@ -175,7 +175,7 @@ pop3d_user (const char *arg)
_pwd = pass;
/* libpam doesn't log to LOG_MAIL */
closelog ();
pamerror = pam_start ("gnu-pop3d", arg, &PAM_conversation, &pamh);
pamerror = pam_start (pam_service, arg, &PAM_conversation, &pamh);
PAM_ERROR;
pamerror = pam_authenticate (pamh, 0);
PAM_ERROR;
......@@ -185,7 +185,7 @@ pop3d_user (const char *arg)
PAM_ERROR;
pam_errlab:
pam_end (pamh, PAM_SUCCESS);
openlog ("gnu-pop3d", LOG_PID, LOG_FACILITY);
openlog ("gnu-pop3d", LOG_PID, log_facility);
if (pamerror != PAM_SUCCESS)
{
syslog (LOG_INFO, "User '%s': authentication failed", _user);
......