diff --git a/autogen.sh b/autogen.sh index f1740d1663..6ff3dd637a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -15,6 +15,7 @@ CFLAGS="$CFLAGS -Werror=int-conversion" CFLAGS="$CFLAGS -Werror=overflow" CFLAGS="$CFLAGS -Werror=sizeof-pointer-div" CFLAGS="$CFLAGS -Werror=unused-but-set-parameter" +CFLAGS="$CFLAGS -Werror=unused-but-set-variable" CFLAGS="$CFLAGS -Werror=unused-function" CFLAGS="$CFLAGS -Werror=unused-label" CFLAGS="$CFLAGS -Werror=unused-local-typedefs" diff --git a/src/login.c b/src/login.c index 216e9ac3d3..b4ffa8586f 100644 --- a/src/login.c +++ b/src/login.c @@ -452,7 +452,9 @@ static /*@observer@*/const char *get_failent_user (/*@returned@*/const char *use int main (int argc, char **argv) { int err; +#if !defined(USE_PAM) bool subroot = false; +#endif char **envp = environ; char *host = NULL; char tty[BUFSIZ]; @@ -1021,7 +1023,9 @@ int main (int argc, char **argv) if (strprefix(pwd->pw_shell, "*")) { /* subsystem root */ pwd->pw_shell++; /* skip the '*' */ subsystem (pwd); /* figure out what to execute */ +#if !defined(USE_PAM) subroot = true; /* say I was here again */ +#endif endpwent (); /* close all of the file which were */ endgrent (); /* open in the original rooted file */ endspent (); /* system. they will be re-opened */ diff --git a/src/useradd.c b/src/useradd.c index e6c80bd6f1..8d3fa29779 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -2347,7 +2347,7 @@ static void create_home(const struct option_flags *flags) * exist. It will be created mode 660 owned by the user and group * 'mail' */ -static void create_mail(const struct option_flags *flags) +static void create_mail(MAYBE_UNUSED const struct option_flags *flags) { int fd; char *file; @@ -2355,9 +2355,9 @@ static void create_mail(const struct option_flags *flags) mode_t mode; const char *spool; struct group *gr; - bool process_selinux; - - process_selinux = !flags->chroot && !flags->prefix; +#ifdef WITH_SELINUX + bool process_selinux = !flags->chroot && !flags->prefix; +#endif if (!strcaseeq(create_mail_spool, "yes")) return;