From 15afe62e9b6eec7913ae7ac67c888084fb8c6fe0 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Thu, 19 Mar 2020 18:40:16 +0000 Subject: modules/pam_access: fix compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following compilation warning reported by gcc when HAVE_LIBAUDIT is not set: modules/pam_access/pam_access.c: In function ‘login_access’: modules/pam_access/pam_access.c:338:13: warning: variable ‘nonall_match’ set but not used [-Wunused-but-set-variable] 338 | int nonall_match = NO; | ^~~~~~~~~~~~ * modules/pam_access/pam_access.c (login_access): Enclose nonall_match variable with HAVE_LIBAUDIT #ifdef's. --- modules/pam_access/pam_access.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/pam_access') diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index b57397be..9a427ee2 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -335,7 +335,9 @@ login_access (pam_handle_t *pamh, struct login_info *item) char *users; /* becomes list of login names */ char *froms; /* becomes list of terminals or hosts */ int match = NO; +#ifdef HAVE_LIBAUDIT int nonall_match = NO; +#endif int end; int lineno = 0; /* for diagnostics */ char *sptr; @@ -393,9 +395,11 @@ login_access (pam_handle_t *pamh, struct login_info *item) match, item->user->pw_name); if (match) { match = list_match(pamh, froms, NULL, item, from_match); +#ifdef HAVE_LIBAUDIT if (!match && perm[0] == '+') { nonall_match = YES; } +#endif if (item->debug) pam_syslog (pamh, LOG_DEBUG, "from_match=%d, \"%s\"", match, item->from); -- cgit v1.2.1