summaryrefslogtreecommitdiff
path: root/modules/pam_access
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_access')
-rw-r--r--modules/pam_access/pam_access.c12
1 files changed, 7 insertions, 5 deletions
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);