lxctemplatedir = join_paths(lxcdatadir, 'templates')
lxc_user_network_conf = join_paths(sysconfdir, user_network_conf_opt)
lxc_user_network_db = join_paths(runtimepath, user_network_db_opt)
+pam_security = join_paths(libdir, 'security')
conf.set_quoted('BINDIR', bindir)
conf.set_quoted('DATADIR', datadir)
cgrouppattern = get_option('cgroup-pattern')
wants_io_uring = get_option('io-uring-event-loop')
want_examples = get_option('examples')
+want_pam_cgroup = get_option('pam-cgroup')
want_mans = get_option('man')
want_tests = get_option('tests')
conf.set10('HAVE_STATIC_LIBCAP', libcap_static.found())
## PAM.
-pam = cc.find_library('pam',
- has_headers: 'security/pam_modules.h')
+pam = cc.find_library('pam', has_headers: 'security/pam_modules.h', required: want_pam_cgroup)
conf.set10('HAVE_PAM', pam.found())
pkgconfig_libs += pam
['SELinux'],
['libcap'],
['static libcap'],
+ ['pam'],
['openssl'],
['liburing'],
]
# Early sub-directories.
subdir('src/include')
subdir('src/lxc')
+if want_pam_cgroup == true
+ subdir('src/lxc/pam')
+endif
# Library.
liblxc_dependencies = [
option('usernet-db-path', type: 'string', value: 'lxc/nics',
description: 'User network database file path')
+
+option('pam-cgroup', type: 'boolean', value: 'false',
+ description: 'build and install the pam cgroup module')
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+
+pam_cgfs_includes = include_directories(
+ '.',
+ '../',
+ '../cgroups',
+ '../../include',
+ '../../../')
+
+pam_cgfs_sources = files(
+ 'pam_cgfs.c',
+ '../file_utils.c',
+ '../file_utils.h',
+ '../macro.h',
+ '../memory_utils.h',
+ '../string_utils.c',
+ '../string_utils.h') + include_sources
+
+pam_cgfs = shared_module(
+ 'pam_cgfs',
+ include_directories: pam_cgfs_includes,
+ sources: pam_cgfs_sources,
+ dependencies: [pkgconfig_libs],
+ name_prefix: '',
+ install_mode: 'rw-r--r--', # 644
+ install: true,
+ install_dir: pam_security)