Merge pull request #4032 from joanbm/master

autotools: Avoid multiple liblxc.so with --enable-pam
This commit is contained in:
Christian Brauner 2021-11-08 19:41:47 +01:00 committed by GitHub
commit d6bd3ab9ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 16 deletions

View File

@ -636,19 +636,19 @@ AM_COND_IF([ENABLE_PAM],
[pamdir], [pamdir],
[AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored, [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored,
or "none" if PAM modules are not to be built])], or "none" if PAM modules are not to be built])],
[pamdir=$withval], [exec_pamdir=$withval],
[ [
if test "${prefix}" = "/usr"; then if test "${prefix}" = "/usr"; then
pamdir="/lib${libdir##*/lib}/security" exec_pamdir="/lib${libdir##*/lib}/security"
else else
pamdir="\$(libdir)/security" exec_pamdir="\$(libdir)/security"
fi fi
] ]
)]) )])
AM_CONDITIONAL([HAVE_PAM], [test x"$pamdir" != "xnone"]) AM_CONDITIONAL([HAVE_PAM], [test x"$exec_pamdir" != "xnone"])
AM_COND_IF([ENABLE_PAM], AM_COND_IF([ENABLE_PAM],
[if test "z$pamdir" != "znone"; then [if test "z$exec_pamdir" != "znone"; then
AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam]) AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
AC_ARG_VAR([PAM_LIBS], [linker flags for pam]) AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
AC_CHECK_LIB( AC_CHECK_LIB(
@ -659,7 +659,7 @@ AM_COND_IF([ENABLE_PAM],
]) ])
AC_SUBST(PAM_LIBS) AC_SUBST(PAM_LIBS)
AC_SUBST([pamdir]) AC_SUBST([exec_pamdir])
fi]) fi])
# Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
@ -1130,7 +1130,7 @@ Security features:
PAM: PAM:
- PAM module: $enable_pam - PAM module: $enable_pam
- cgroup PAM module: $pamdir - cgroup PAM module: $exec_pamdir
Documentation: Documentation:
- examples: $enable_examples - examples: $enable_examples

View File

@ -2631,7 +2631,7 @@ endif
if ENABLE_PAM if ENABLE_PAM
if HAVE_PAM if HAVE_PAM
pam_LTLIBRARIES = pam_cgfs.la exec_pam_LTLIBRARIES = pam_cgfs.la
pam_cgfs_la_SOURCES = pam/pam_cgfs.c \ pam_cgfs_la_SOURCES = pam/pam_cgfs.c \
file_utils.c file_utils.h \ file_utils.c file_utils.h \
@ -2661,7 +2661,7 @@ pam_cgfs_la_LDFLAGS = $(AM_LDFLAGS) \
endif endif
endif endif
install-exec-local: install-libLTLIBRARIES install-exec-hook:
mkdir -p $(DESTDIR)$(datadir)/lxc mkdir -p $(DESTDIR)$(datadir)/lxc
install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@ mv $(shell readlink -f $(DESTDIR)$(libdir)/liblxc.so) $(DESTDIR)$(libdir)/liblxc.so.@LXC_ABI@
@ -2669,10 +2669,15 @@ install-exec-local: install-libLTLIBRARIES
cd $(DESTDIR)$(libdir); \ cd $(DESTDIR)$(libdir); \
ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \ ln -sf liblxc.so.@LXC_ABI@ liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)); \
ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so ln -sf liblxc.so.$(firstword $(subst ., ,@LXC_ABI@)) liblxc.so
if ENABLE_PAM
if HAVE_PAM
$(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.la"
$(RM) "$(DESTDIR)$(exec_pamdir)/pam_cgfs.a"
endif
endif
if ENABLE_COMMANDS if ENABLE_COMMANDS
install-exec-hook:
chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic chmod u+s $(DESTDIR)$(libexecdir)/lxc/lxc-user-nic
if ENABLE_BASH if ENABLE_BASH
install-data-local: install-data-local:
cd $(DESTDIR)$(bashcompdir); \ cd $(DESTDIR)$(bashcompdir); \
@ -2693,10 +2698,6 @@ endif
if ENABLE_PAM if ENABLE_PAM
if HAVE_PAM if HAVE_PAM
$(RM) $(DESTDIR)$(pamdir)/pam_cgfs.so* $(RM) $(DESTDIR)$(exec_pamdir)/pam_cgfs.so*
install-data-hook: install-pamLTLIBRARIES
$(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.la"
$(RM) "$(DESTDIR)$(pamdir)/pam_cgfs.a"
endif endif
endif endif