]> git.proxmox.com Git - mirror_lxc.git/blobdiff - configure.ac
Revert "Revert "pam: create writable cgroups for unpriv users""
[mirror_lxc.git] / configure.ac
index 224e1f15e0b395b93f7cdafbf4dc397a7b513089..26bbe28e0067608d229cc3a871c11a2631edbee0 100644 (file)
@@ -607,6 +607,35 @@ else
 fi
 AM_CONDITIONAL([IS_BIONIC], [test "x$is_bionic" = "xyes"])
 
+AC_ARG_WITH(
+       [pamdir],
+       [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored,
+                                               or "none" if PAM modules are not to be built])],
+       [pamdir="${withval}"],
+       [
+               if test "${prefix}" = "/usr"; then
+                       pamdir="/lib${libdir##*/lib}/security"
+               else
+                       pamdir="\$(libdir)/security"
+               fi
+       ]
+)
+
+AM_CONDITIONAL([HAVE_PAM], [test x"$pamdir" != "xnone"])
+if test "z$pamdir" != "znone"; then
+       AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
+       AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
+       AC_CHECK_LIB(
+               [pam],
+               [pam_authenticate],
+               [PAM_LIBS="-lpam"],
+               [AC_MSG_ERROR([*** libpam not found.])
+               ])
+
+       AC_SUBST(PAM_LIBS)
+       AC_SUBST([pamdir])
+fi
+
 # Some systems lack PR_CAPBSET_DROP definition => HAVE_DECL_PR_CAPBSET_DROP
 AC_CHECK_DECLS([PR_CAPBSET_DROP], [], [], [#include <sys/prctl.h>])
 
@@ -926,6 +955,9 @@ Security features:
  - seccomp: $enable_seccomp
  - SELinux: $enable_selinux
 
+PAM:
+ - cgroup PAM module: $pamdir
+
 Bindings:
  - lua: $enable_lua
  - python3: $enable_python