From 2d243af6b8ebe579f19ad27d3ab3907ebfe6a77e Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 9 Nov 2005 10:17:00 +0000 Subject: Relevant BUGIDs: 562730, 435990 Purpose of commit: bugfix Commit summary: --------------- * modules/pam_access/pam_access.c (pam_sm_acct_mgmt): Parse correctly full path tty name. * modules/pam_time/pam_time.c (pam_sm_acct_mgmt): Parse correctly full path tty name. Allow unset tty. (logic_member): Allow matching ':' in tty name. * modules/pam_group/pam_group.c (pam_sm_acct_mgmt): Parse correctly full path tty name. Allow unset tty. (logic_member): Allow matching ':' in tty name. * libpam_misc/misc_conv.c (read_string): Read only up to EOL if stdin is not terminal. --- modules/pam_access/pam_access.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'modules/pam_access/pam_access.c') diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index 867cd9a1..2d8c92b4 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -435,11 +435,13 @@ pam_sm_acct_mgmt (pam_handle_t *pamh, int flags UNUSED, else from = void_from; - if (from != NULL && from[0] == '/') { /* full path */ - from++; - from = strchr(from, '/'); - from++; - } + if (from[0] == '/') { /* full path */ + const char *f; + from++; + if ((f = strchr(from, '/')) != NULL) { + from = f + 1; + } + } } if ((user_pw=pam_modutil_getpwnam(pamh, user))==NULL) return (PAM_USER_UNKNOWN); -- cgit v1.2.3