From 2f289878b6a7bd888fdfcfe4286b87006074da11 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 17 Feb 2022 09:48:14 +0100 Subject: pam_time: fix clang compilation warning Fix the following compilation warning reported by clang: "result of comparison against a string literal is unspecified (use strcmp instead)". * pam_time.c (_pam_parse): Do not compare char* string with a constant. --- modules/pam_time/pam_time.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'modules/pam_time') diff --git a/modules/pam_time/pam_time.c b/modules/pam_time/pam_time.c index b99e4c32..9092597a 100644 --- a/modules/pam_time/pam_time.c +++ b/modules/pam_time/pam_time.c @@ -58,7 +58,7 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** { int ctrl = 0; - *conffile = PAM_TIME_CONF; + *conffile = NULL; /* step through arguments */ for (; argc-- > 0; ++argv) { const char *str; @@ -82,8 +82,9 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** } } + if (*conffile == NULL) { + *conffile = PAM_TIME_CONF; #ifdef VENDOR_PAM_TIME_CONF - if (*conffile == PAM_TIME_CONF) { /* * Check whether PAM_TIME_CONF file is available. * If it does not exist, fall back to VENDOR_PAM_TIME_CONF file. @@ -92,8 +93,8 @@ _pam_parse (const pam_handle_t *pamh, int argc, const char **argv, const char ** if (stat(*conffile, &buffer) != 0 && errno == ENOENT) { *conffile = VENDOR_PAM_TIME_CONF; } - } #endif + } return ctrl; } -- cgit v1.2.3