Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/openrc/files/, sys-apps/openrc/
Date: Mon, 22 Nov 2021 11:45:02
Message-Id: 1637581486.f4fdf74bad1aa4db3522939aa70c2ed2e948cc22.sam@gentoo
1 commit: f4fdf74bad1aa4db3522939aa70c2ed2e948cc22
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 22 11:44:30 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 22 11:44:46 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f4fdf74b
7
8 sys-apps/openrc: backport SELinux + no PAM build fixes
9
10 Closes: https://bugs.gentoo.org/825286
11 Closes: https://bugs.gentoo.org/824954
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 .../files/openrc-0.44.8-selinux-no-pam.patch | 89 ++++++++++++++++++++++
15 sys-apps/openrc/openrc-0.44.8.ebuild | 5 ++
16 2 files changed, 94 insertions(+)
17
18 diff --git a/sys-apps/openrc/files/openrc-0.44.8-selinux-no-pam.patch b/sys-apps/openrc/files/openrc-0.44.8-selinux-no-pam.patch
19 new file mode 100644
20 index 000000000000..28749433f69f
21 --- /dev/null
22 +++ b/sys-apps/openrc/files/openrc-0.44.8-selinux-no-pam.patch
23 @@ -0,0 +1,89 @@
24 +https://github.com/OpenRC/openrc/commit/bd5cdaafadf997c0ab3c4ad362dbdfd7dc6fd987.patch
25 +https://github.com/OpenRC/openrc/commit/f3f0fde861b438c80f99afdd49fe175e9d0a68ca
26 +
27 +From: Sam James <sam@g.o>
28 +Date: Sat, 20 Nov 2021 12:05:56 +0000
29 +Subject: [PATCH] meson: fix pam_misc_dep definition
30 +
31 +X-Gentoo-Bug: 824954
32 +X-Gentoo-Bug-URL: https://bugs.gentoo.org/824954
33 +Fixes: https://github.com/OpenRC/openrc/issues/470
34 +Fixes: https://github.com/OpenRC/openrc/pull/477
35 +--- a/meson.build
36 ++++ b/meson.build
37 +@@ -94,6 +94,7 @@ rc_sbindir = rc_libexecdir / 'sbin'
38 + sbindir = rootprefix / get_option('sbindir')
39 +
40 + selinux_dep = dependency('libselinux', required : get_option('selinux'))
41 ++pam_misc_dep = []
42 + if selinux_dep.found()
43 + cc_selinux_flags = '-DHAVE_SELINUX'
44 + if pam_dep.found() and get_option('pam')
45 +@@ -107,7 +108,6 @@ if selinux_dep.found()
46 + endif
47 + else
48 + cc_selinux_flags = []
49 +- pam_misc_dep = []
50 + endif
51 +
52 + termcap = get_option('termcap')
53 +
54 +From: Sam James <sam@g.o>
55 +Date: Sat, 20 Nov 2021 12:06:37 +0000
56 +Subject: [PATCH] meson: link against libcrypt for SELinux if no PAM
57 +
58 +We use libcrypt's crypt() if we're _not_ using PAM
59 +in the SELinux code (rc-selinux, specifically).
60 +
61 +X-Gentoo-Bug: 824954
62 +X-Gentoo-Bug-URL: https://bugs.gentoo.org/824954
63 +Fixes: https://github.com/openrc/openrc/pull/477
64 +--- a/meson.build
65 ++++ b/meson.build
66 +@@ -93,6 +93,8 @@ rc_bindir = rc_libexecdir / 'bin'
67 + rc_sbindir = rc_libexecdir / 'sbin'
68 + sbindir = rootprefix / get_option('sbindir')
69 +
70 ++crypt_dep = dependency('libcrypt', required : not get_option('pam'))
71 ++
72 + selinux_dep = dependency('libselinux', required : get_option('selinux'))
73 + pam_misc_dep = []
74 + if selinux_dep.found()
75 +--- a/src/rc/meson.build
76 ++++ b/src/rc/meson.build
77 +@@ -50,7 +50,7 @@ executable('openrc-run',
78 + rc_selinux_c, version_h],
79 + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
80 + link_with: [libeinfo, librc],
81 +- dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep],
82 ++ dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, selinux_dep, util_dep, crypt_dep],
83 + include_directories: [incdir, einfo_incdir, rc_incdir],
84 + install: true,
85 + install_dir: sbindir)
86 +@@ -85,7 +85,7 @@ executable('runscript',
87 + rc_selinux_c, version_h],
88 + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
89 + link_with: [libeinfo, librc],
90 +- dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep],
91 ++ dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep],
92 + include_directories: [incdir, einfo_incdir, rc_incdir],
93 + install: true,
94 + install_dir: sbindir)
95 +@@ -95,7 +95,7 @@ executable('start-stop-daemon',
96 + rc_selinux_c, usage_c, version_h],
97 + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
98 + link_with: [libeinfo, librc],
99 +- dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep],
100 ++ dependencies: [audit_dep, dl_dep, pam_dep, pam_misc_dep, util_dep, selinux_dep, crypt_dep],
101 + include_directories: [incdir, einfo_incdir, rc_incdir],
102 + install: true,
103 + install_dir: sbindir)
104 +@@ -169,7 +169,7 @@ executable('checkpath',
105 + c_args : [cc_audit_flags, cc_branding_flags, cc_pam_flags, cc_selinux_flags],
106 + include_directories: [incdir, einfo_incdir, rc_incdir],
107 + link_with: [libeinfo, librc],
108 +- dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep],
109 ++ dependencies: [audit_dep, pam_dep, pam_misc_dep, selinux_dep, crypt_dep],
110 + install: true,
111 + install_dir: rc_bindir)
112 +
113
114 diff --git a/sys-apps/openrc/openrc-0.44.8.ebuild b/sys-apps/openrc/openrc-0.44.8.ebuild
115 index 4e57ae57a034..182e1761f233 100644
116 --- a/sys-apps/openrc/openrc-0.44.8.ebuild
117 +++ b/sys-apps/openrc/openrc-0.44.8.ebuild
118 @@ -55,6 +55,11 @@ RDEPEND="${COMMON_DEPEND}
119
120 PDEPEND="netifrc? ( net-misc/netifrc )"
121
122 +PATCHES=(
123 + # Backported from master
124 + "${FILESDIR}"/${P}-selinux-no-pam.patch
125 +)
126 +
127 src_configure() {
128 local emesonargs=(
129 $(meson_feature audit)