meson: link against libcrypt for SELinux if no PAM

We use libcrypt's crypt() if we're _not_ using PAM
in the SELinux code (rc-selinux, specifically).

X-Gentoo-Bug: 824954
X-Gentoo-Bug-URL: https://bugs.gentoo.org/824954
Fixes: https://github.com/openrc/openrc/pull/477
This commit is contained in:
Sam James 2021-11-20 12:06:37 +00:00 committed by William Hubbs
parent bd5cdaafad
commit f3f0fde861
2 changed files with 6 additions and 4 deletions

View File

@ -93,6 +93,8 @@ rc_bindir = rc_libexecdir / 'bin'
rc_sbindir = rc_libexecdir / 'sbin' rc_sbindir = rc_libexecdir / 'sbin'
sbindir = rootprefix / get_option('sbindir') sbindir = rootprefix / get_option('sbindir')
crypt_dep = dependency('libcrypt', required : not get_option('pam'))
selinux_dep = dependency('libselinux', required : get_option('selinux')) selinux_dep = dependency('libselinux', required : get_option('selinux'))
pam_misc_dep = [] pam_misc_dep = []
if selinux_dep.found() if selinux_dep.found()

View File

@ -50,7 +50,7 @@ executable('openrc-run',
rc_selinux_c, version_h], rc_selinux_c, version_h],
c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
link_with: [libeinfo, librc], link_with: [libeinfo, librc],
dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep], dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep, crypt_dep],
include_directories: [incdir, einfo_incdir, rc_incdir], include_directories: [incdir, einfo_incdir, rc_incdir],
install: true, install: true,
install_dir: sbindir) install_dir: sbindir)
@ -85,7 +85,7 @@ executable('runscript',
rc_selinux_c, version_h], rc_selinux_c, version_h],
c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
link_with: [libeinfo, librc], link_with: [libeinfo, librc],
dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep], dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep],
include_directories: [incdir, einfo_incdir, rc_incdir], include_directories: [incdir, einfo_incdir, rc_incdir],
install: true, install: true,
install_dir: sbindir) install_dir: sbindir)
@ -95,7 +95,7 @@ executable('start-stop-daemon',
rc_selinux_c, usage_c, version_h], rc_selinux_c, usage_c, version_h],
c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
link_with: [libeinfo, librc], link_with: [libeinfo, librc],
dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep], dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep],
include_directories: [incdir, einfo_incdir, rc_incdir], include_directories: [incdir, einfo_incdir, rc_incdir],
install: true, install: true,
install_dir: sbindir) install_dir: sbindir)
@ -169,7 +169,7 @@ executable('checkpath',
c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags], c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
include_directories: [incdir, einfo_incdir, rc_incdir], include_directories: [incdir, einfo_incdir, rc_incdir],
link_with: [libeinfo, librc], link_with: [libeinfo, librc],
dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep], dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep, crypt_dep],
install: true, install: true,
install_dir: rc_bindir) install_dir: rc_bindir)