summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@suse.com>2023-01-31 11:41:28 +0100
committerDmitry V. Levin <ldv@strace.io>2023-01-31 10:41:28 +0000
commita44743a0bf50c8c6fedd8304524536aa040fd3b3 (patch)
treefb2812d7733ebb96018eb259f35f5890c6544066
parentd13a8ea18f852e97201269e55255a14fe4fe5d0f (diff)
downloadlinux-pam-git-a44743a0bf50c8c6fedd8304524536aa040fd3b3.tar.gz
pam_unix: don't link against yppasswd_xdr if NIS is disabled
* configure.ac: Define HAVE_NIS if NIS is enabled. * modules/pam_unix/Makefile.am: Don't link against yppasswd_xdr.c if NIS is disabled. * modules/pam_unix/pam_unix_passwd.c: Don't redefine HAVE_NIS. Resolves: https://github.com/linux-pam/linux-pam/issues/523
-rw-r--r--configure.ac1
-rw-r--r--modules/pam_unix/Makefile.am7
-rw-r--r--modules/pam_unix/pam_unix_passwd.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index afa749cf..587be871 100644
--- a/configure.ac
+++ b/configure.ac
@@ -459,6 +459,7 @@ AC_SUBST(LIBDB)
AC_ARG_ENABLE([nis],
AS_HELP_STRING([--disable-nis], [Disable building NIS/YP support in pam_unix]))
+AM_CONDITIONAL([HAVE_NIS], [test "x$enable_nis" != "xno"])
AS_IF([test "x$enable_nis" != "xno"], [
old_CFLAGS=$CFLAGS
diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
index 1658735b..74fc9b32 100644
--- a/modules/pam_unix/Makefile.am
+++ b/modules/pam_unix/Makefile.am
@@ -5,7 +5,7 @@
CLEANFILES = *~
MAINTAINERCLEANFILES = $(MANS) README
-EXTRA_DIST = md5.c md5_crypt.c lckpwdf.-c $(XMLS) CHANGELOG
+EXTRA_DIST = md5.c md5_crypt.c lckpwdf.-c yppasswd_xdr.c $(XMLS) CHANGELOG
if HAVE_DOC
dist_man_MANS = pam_unix.8 unix_chkpwd.8 unix_update.8
@@ -39,7 +39,10 @@ noinst_PROGRAMS = bigcrypt
pam_unix_la_SOURCES = bigcrypt.c pam_unix_acct.c \
pam_unix_auth.c pam_unix_passwd.c pam_unix_sess.c support.c \
- passverify.c yppasswd_xdr.c md5_good.c md5_broken.c
+ passverify.c md5_good.c md5_broken.c
+if HAVE_NIS
+ pam_unix_la_SOURCES += yppasswd_xdr.c
+endif
bigcrypt_SOURCES = bigcrypt.c bigcrypt_main.c
bigcrypt_CFLAGS = $(AM_CFLAGS)
diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c
index ca721475..857ddd45 100644
--- a/modules/pam_unix/pam_unix_passwd.c
+++ b/modules/pam_unix/pam_unix_passwd.c
@@ -72,10 +72,6 @@
#include "passverify.h"
#include "bigcrypt.h"
-#if (defined(HAVE_YP_GET_DEFAULT_DOMAIN) || defined(HAVE_GETDOMAINNAME)) && defined(HAVE_YP_MASTER)
-# define HAVE_NIS
-#endif
-
#ifdef HAVE_NIS
# include <rpc/rpc.h>