Use pam_service instead of hardcoding PAM service name
Showing
2 changed files
with
4 additions
and
4 deletions
... | @@ -131,7 +131,7 @@ imap4d_login (struct imap4d_command *command, char *arg) | ... | @@ -131,7 +131,7 @@ imap4d_login (struct imap4d_command *command, char *arg) |
131 | _pwd = pass; | 131 | _pwd = pass; |
132 | /* libpam doesn't log to LOG_MAIL */ | 132 | /* libpam doesn't log to LOG_MAIL */ |
133 | closelog (); | 133 | closelog (); |
134 | pamerror = pam_start ("gnu-imap4d", username, &PAM_conversation, &pamh); | 134 | pamerror = pam_start (pam_service, username, &PAM_conversation, &pamh); |
135 | PAM_ERROR; | 135 | PAM_ERROR; |
136 | pamerror = pam_authenticate (pamh, 0); | 136 | pamerror = pam_authenticate (pamh, 0); |
137 | PAM_ERROR; | 137 | PAM_ERROR; |
... | @@ -140,7 +140,7 @@ imap4d_login (struct imap4d_command *command, char *arg) | ... | @@ -140,7 +140,7 @@ imap4d_login (struct imap4d_command *command, char *arg) |
140 | pamerror = pam_setcred (pamh, PAM_ESTABLISH_CRED); | 140 | pamerror = pam_setcred (pamh, PAM_ESTABLISH_CRED); |
141 | PAM_ERROR; | 141 | PAM_ERROR; |
142 | pam_end (pamh, PAM_SUCCESS); | 142 | pam_end (pamh, PAM_SUCCESS); |
143 | openlog ("gnu-imap4d", LOG_PID, LOG_FACILITY); | 143 | openlog ("gnu-imap4d", LOG_PID, log_facility); |
144 | #endif /* USE_LIBPAM */ | 144 | #endif /* USE_LIBPAM */ |
145 | 145 | ||
146 | if (pw->pw_uid > 0 && !mu_virtual_domain) | 146 | if (pw->pw_uid > 0 && !mu_virtual_domain) | ... | ... |
... | @@ -175,7 +175,7 @@ pop3d_user (const char *arg) | ... | @@ -175,7 +175,7 @@ pop3d_user (const char *arg) |
175 | _pwd = pass; | 175 | _pwd = pass; |
176 | /* libpam doesn't log to LOG_MAIL */ | 176 | /* libpam doesn't log to LOG_MAIL */ |
177 | closelog (); | 177 | closelog (); |
178 | pamerror = pam_start ("gnu-pop3d", arg, &PAM_conversation, &pamh); | 178 | pamerror = pam_start (pam_service, arg, &PAM_conversation, &pamh); |
179 | PAM_ERROR; | 179 | PAM_ERROR; |
180 | pamerror = pam_authenticate (pamh, 0); | 180 | pamerror = pam_authenticate (pamh, 0); |
181 | PAM_ERROR; | 181 | PAM_ERROR; |
... | @@ -185,7 +185,7 @@ pop3d_user (const char *arg) | ... | @@ -185,7 +185,7 @@ pop3d_user (const char *arg) |
185 | PAM_ERROR; | 185 | PAM_ERROR; |
186 | pam_errlab: | 186 | pam_errlab: |
187 | pam_end (pamh, PAM_SUCCESS); | 187 | pam_end (pamh, PAM_SUCCESS); |
188 | openlog ("gnu-pop3d", LOG_PID, LOG_FACILITY); | 188 | openlog ("gnu-pop3d", LOG_PID, log_facility); |
189 | if (pamerror != PAM_SUCCESS) | 189 | if (pamerror != PAM_SUCCESS) |
190 | { | 190 | { |
191 | syslog (LOG_INFO, "User '%s': authentication failed", _user); | 191 | syslog (LOG_INFO, "User '%s': authentication failed", _user); | ... | ... |
-
Please register or sign in to post a comment