diff options
Diffstat (limited to 'modules/pam_tty_audit')
-rw-r--r-- | modules/pam_tty_audit/pam_tty_audit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/pam_tty_audit/pam_tty_audit.c b/modules/pam_tty_audit/pam_tty_audit.c index 589c60a2..1d9256c3 100644 --- a/modules/pam_tty_audit/pam_tty_audit.c +++ b/modules/pam_tty_audit/pam_tty_audit.c @@ -55,6 +55,7 @@ #include <security/pam_modutil.h> #include "pam_cc_compat.h" +#include "pam_inline.h" #define DATANAME "pam_tty_audit_last_state" @@ -288,14 +289,16 @@ pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char **argv) #endif /* HAVE_STRUCT_AUDIT_TTY_STATUS_LOG_PASSWD */ for (i = 0; i < argc; i++) { - if (strncmp (argv[i], "enable=", 7) == 0 - || strncmp (argv[i], "disable=", 8) == 0) + const char *str; + + if ((str = pam_str_skip_prefix(argv[i], "enable=")) != NULL + || (str = pam_str_skip_prefix(argv[i], "disable=")) != NULL) { enum command this_command; char *copy, *tok_data, *tok; this_command = *argv[i] == 'e' ? CMD_ENABLE : CMD_DISABLE; - copy = strdup (strchr (argv[i], '=') + 1); + copy = strdup (str); if (copy == NULL) return PAM_SESSION_ERR; for (tok = strtok_r (copy, ",", &tok_data); |