0.74: please submit patches for this section with actual code/doc
patches!
+* pam_tally - check for PAM_TTY if PAM_RHOST is not set when writing
+ to faillog (Bug 124394 - baggins)
* use O_NOFOLLOW if available when opening debug log (Bug 124385 - baggins)
* pam_cracklib - removed comments about pam_unix not working with
pam_cracklib, added information about use_authtok parameter
*TALLY = NULL;
const char
*user = NULL,
- *remote_host = NULL;
+ *remote_host = NULL,
+ *cur_tty = NULL;
int i=pam_get_uid(pamh, &uid, &user);
if ( i != PAM_SUCCESS ) RETURN_ERROR( i );
(void) pam_get_item(pamh, PAM_RHOST, (const void **)&remote_host);
if (!remote_host)
{
- strcpy(faillog.fail_line, "unknown");
+ (void) pam_get_item(pamh, PAM_TTY, (const void **)&cur_tty);
+ if (!cur_tty)
+ strcpy(faillog.fail_line, "unknown");
+ else {
+ strncpy(faillog.fail_line, cur_tty, (size_t)sizeof(faillog.fail_line));
+ faillog.fail_line[sizeof(faillog.fail_line)-1] = 0;
+ }
}
else
{