Mercurial > dropbear
comparison svr-authpam.c @ 819:fee485ce81eb
Get rid of spurious newlines in pam log messages
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 03 Oct 2013 23:04:26 +0800 |
parents | 8fe36617bf4e |
children | bae0b34bc059 aaf576b27a10 |
comparison
equal
deleted
inserted
replaced
818:8fe36617bf4e | 819:fee485ce81eb |
---|---|
210 userData.user = ses.authstate.pw_name; | 210 userData.user = ses.authstate.pw_name; |
211 userData.passwd = password; | 211 userData.passwd = password; |
212 | 212 |
213 /* Init pam */ | 213 /* Init pam */ |
214 if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { | 214 if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) { |
215 dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s\n", | 215 dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", |
216 rc, pam_strerror(pamHandlep, rc)); | 216 rc, pam_strerror(pamHandlep, rc)); |
217 goto cleanup; | 217 goto cleanup; |
218 } | 218 } |
219 | 219 |
220 /* just to set it to something */ | 220 /* just to set it to something */ |
221 if ((rc = pam_set_item(pamHandlep, PAM_TTY, "ssh") != PAM_SUCCESS)) { | 221 if ((rc = pam_set_item(pamHandlep, PAM_TTY, "ssh") != PAM_SUCCESS)) { |
222 dropbear_log(LOG_WARNING, "pam_set_item() failed, rc=%d, %s\n", | 222 dropbear_log(LOG_WARNING, "pam_set_item() failed, rc=%d, %s", |
223 rc, pam_strerror(pamHandlep, rc)); | 223 rc, pam_strerror(pamHandlep, rc)); |
224 goto cleanup; | 224 goto cleanup; |
225 } | 225 } |
226 | 226 |
227 #ifdef HAVE_PAM_FAIL_DELAY | 227 #ifdef HAVE_PAM_FAIL_DELAY |
230 #endif | 230 #endif |
231 | 231 |
232 /* (void) pam_set_item(pamHandlep, PAM_FAIL_DELAY, (void*) pamDelayFunc); */ | 232 /* (void) pam_set_item(pamHandlep, PAM_FAIL_DELAY, (void*) pamDelayFunc); */ |
233 | 233 |
234 if ((rc = pam_authenticate(pamHandlep, 0)) != PAM_SUCCESS) { | 234 if ((rc = pam_authenticate(pamHandlep, 0)) != PAM_SUCCESS) { |
235 dropbear_log(LOG_WARNING, "pam_authenticate() failed, rc=%d, %s\n", | 235 dropbear_log(LOG_WARNING, "pam_authenticate() failed, rc=%d, %s", |
236 rc, pam_strerror(pamHandlep, rc)); | 236 rc, pam_strerror(pamHandlep, rc)); |
237 dropbear_log(LOG_WARNING, | 237 dropbear_log(LOG_WARNING, |
238 "Bad PAM password attempt for '%s' from %s", | 238 "Bad PAM password attempt for '%s' from %s", |
239 ses.authstate.pw_name, | 239 ses.authstate.pw_name, |
240 svr_ses.addrstring); | 240 svr_ses.addrstring); |
241 send_msg_userauth_failure(0, 1); | 241 send_msg_userauth_failure(0, 1); |
242 goto cleanup; | 242 goto cleanup; |
243 } | 243 } |
244 | 244 |
245 if ((rc = pam_acct_mgmt(pamHandlep, 0)) != PAM_SUCCESS) { | 245 if ((rc = pam_acct_mgmt(pamHandlep, 0)) != PAM_SUCCESS) { |
246 dropbear_log(LOG_WARNING, "pam_acct_mgmt() failed, rc=%d, %s\n", | 246 dropbear_log(LOG_WARNING, "pam_acct_mgmt() failed, rc=%d, %s", |
247 rc, pam_strerror(pamHandlep, rc)); | 247 rc, pam_strerror(pamHandlep, rc)); |
248 dropbear_log(LOG_WARNING, | 248 dropbear_log(LOG_WARNING, |
249 "Bad PAM password attempt for '%s' from %s", | 249 "Bad PAM password attempt for '%s' from %s", |
250 ses.authstate.pw_name, | 250 ses.authstate.pw_name, |
251 svr_ses.addrstring); | 251 svr_ses.addrstring); |