1 |
commit: f9e388bc278bd56c96fbf193ba36947092b4489c |
2 |
Author: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 2 14:39:34 2016 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 2 15:14:35 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9e388bc |
7 |
|
8 |
sys-auth/consolekit: Remove root restrictions, bug 585688 |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
sys-auth/consolekit/consolekit-1.1.0-r1.ebuild | 119 +++++++++++++++++++++ |
13 |
...ove-the-root-restriction-for-runtime-dirs.patch | 57 ++++++++++ |
14 |
2 files changed, 176 insertions(+) |
15 |
|
16 |
diff --git a/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild b/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild |
17 |
new file mode 100644 |
18 |
index 0000000..61010e4 |
19 |
--- /dev/null |
20 |
+++ b/sys-auth/consolekit/consolekit-1.1.0-r1.ebuild |
21 |
@@ -0,0 +1,119 @@ |
22 |
+# Copyright 1999-2016 Gentoo Foundation |
23 |
+# Distributed under the terms of the GNU General Public License v2 |
24 |
+# $Id$ |
25 |
+ |
26 |
+EAPI=6 |
27 |
+inherit linux-info pam |
28 |
+ |
29 |
+MY_PN=ConsoleKit2 |
30 |
+MY_P=${MY_PN}-${PV} |
31 |
+ |
32 |
+DESCRIPTION="Framework for defining and tracking users, login sessions and seats" |
33 |
+HOMEPAGE="https://github.com/ConsoleKit2/ConsoleKit2 https://www.freedesktop.org/wiki/Software/ConsoleKit" |
34 |
+SRC_URI="https://github.com/${MY_PN}/${MY_PN}/releases/download/${PV}/${MY_P}.tar.bz2" |
35 |
+ |
36 |
+LICENSE="GPL-2" |
37 |
+SLOT="0" |
38 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux" |
39 |
+IUSE="acl cgroups debug doc kernel_linux pam pm-utils policykit selinux test" |
40 |
+ |
41 |
+COMMON_DEPEND=">=dev-libs/glib-2.40:2=[dbus] |
42 |
+ >=sys-devel/gettext-0.19 |
43 |
+ sys-apps/dbus |
44 |
+ sys-libs/zlib:= |
45 |
+ x11-libs/libX11:= |
46 |
+ acl? ( |
47 |
+ sys-apps/acl:= |
48 |
+ >=virtual/udev-200 |
49 |
+ ) |
50 |
+ cgroups? ( |
51 |
+ app-admin/cgmanager |
52 |
+ >=sys-libs/libnih-1.0.2[dbus] |
53 |
+ ) |
54 |
+ pam? ( virtual/pam ) |
55 |
+ policykit? ( >=sys-auth/polkit-0.110 )" |
56 |
+# pm-utils: bug 557432 |
57 |
+RDEPEND="${COMMON_DEPEND} |
58 |
+ kernel_linux? ( sys-apps/coreutils[acl?] ) |
59 |
+ pm-utils? ( sys-power/pm-utils ) |
60 |
+ selinux? ( sec-policy/selinux-consolekit )" |
61 |
+DEPEND="${COMMON_DEPEND} |
62 |
+ dev-libs/libxslt |
63 |
+ virtual/pkgconfig |
64 |
+ doc? ( app-text/xmlto ) |
65 |
+ test? ( |
66 |
+ app-text/docbook-xml-dtd:4.1.2 |
67 |
+ app-text/xmlto |
68 |
+ )" |
69 |
+ |
70 |
+S=${WORKDIR}/${MY_P} |
71 |
+ |
72 |
+QA_MULTILIB_PATHS="usr/lib/ConsoleKit/.*" |
73 |
+ |
74 |
+PATCHES=( "${FILESDIR}/${P}-Remove-the-root-restriction-for-runtime-dirs.patch" ) |
75 |
+ |
76 |
+pkg_setup() { |
77 |
+ if use kernel_linux; then |
78 |
+ # This is from https://bugs.gentoo.org/376939 |
79 |
+ use acl && CONFIG_CHECK="~TMPFS_POSIX_ACL" |
80 |
+ # This is required to get login-session-id string with pam_ck_connector.so |
81 |
+ use pam && CONFIG_CHECK+=" ~AUDITSYSCALL" |
82 |
+ linux-info_pkg_setup |
83 |
+ fi |
84 |
+} |
85 |
+ |
86 |
+src_prepare() { |
87 |
+ sed -i -e '/SystemdService/d' data/org.freedesktop.ConsoleKit.service.in || die |
88 |
+ |
89 |
+ default |
90 |
+} |
91 |
+ |
92 |
+src_configure() { |
93 |
+ econf \ |
94 |
+ XMLTO_FLAGS='--skip-validation' \ |
95 |
+ --libexecdir="${EPREFIX}"/usr/lib/ConsoleKit \ |
96 |
+ --localstatedir="${EPREFIX}"/var \ |
97 |
+ $(use_enable pam pam-module) \ |
98 |
+ $(use_enable doc docbook-docs) \ |
99 |
+ $(use_enable test docbook-docs) \ |
100 |
+ $(use_enable debug) \ |
101 |
+ $(use_enable policykit polkit) \ |
102 |
+ $(use_enable acl udev-acl) \ |
103 |
+ $(use_enable cgroups) \ |
104 |
+ $(use_enable test tests) \ |
105 |
+ --with-dbus-services="${EPREFIX}"/usr/share/dbus-1/services \ |
106 |
+ --with-pam-module-dir="$(getpam_mod_dir)" \ |
107 |
+ --with-xinitrc-dir=/etc/X11/xinit/xinitrc.d \ |
108 |
+ --without-systemdsystemunitdir |
109 |
+} |
110 |
+ |
111 |
+src_install() { |
112 |
+ emake \ |
113 |
+ DESTDIR="${D}" \ |
114 |
+ htmldocdir="${EPREFIX}"/usr/share/doc/${PF}/html \ |
115 |
+ install |
116 |
+ |
117 |
+ dosym /usr/lib/ConsoleKit /usr/lib/${PN} |
118 |
+ |
119 |
+ dodoc AUTHORS HACKING NEWS README TODO |
120 |
+ |
121 |
+ newinitd "${FILESDIR}"/${PN}-1.0.0.initd consolekit |
122 |
+ |
123 |
+ keepdir /usr/lib/ConsoleKit/run-seat.d |
124 |
+ keepdir /usr/lib/ConsoleKit/run-session.d |
125 |
+ keepdir /etc/ConsoleKit/run-session.d |
126 |
+ keepdir /var/log/ConsoleKit |
127 |
+ |
128 |
+ exeinto /etc/X11/xinit/xinitrc.d |
129 |
+ newexe "${FILESDIR}"/90-consolekit-3 90-consolekit |
130 |
+ |
131 |
+ if use kernel_linux; then |
132 |
+ # bug 571524 |
133 |
+ exeinto /usr/lib/ConsoleKit/run-session.d |
134 |
+ doexe "${FILESDIR}"/pam-foreground-compat.ck |
135 |
+ fi |
136 |
+ |
137 |
+ prune_libtool_files --all # --all for pam_ck_connector.la |
138 |
+ |
139 |
+ rm -rf "${ED}"/var/run || die # let the init script create the directory |
140 |
+} |
141 |
|
142 |
diff --git a/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch |
143 |
new file mode 100644 |
144 |
index 0000000..301c68f |
145 |
--- /dev/null |
146 |
+++ b/sys-auth/consolekit/files/consolekit-1.1.0-Remove-the-root-restriction-for-runtime-dirs.patch |
147 |
@@ -0,0 +1,57 @@ |
148 |
+From 664d2fdbd966764836b1f4da2dbc5750c7f01f0f Mon Sep 17 00:00:00 2001 |
149 |
+From: Eric Koegel <eric.koegel@×××××.com> |
150 |
+Date: Sun, 10 Apr 2016 11:20:24 +0300 |
151 |
+Subject: [PATCH] Remove the root restriction for runtime dirs |
152 |
+ |
153 |
+--- |
154 |
+ src/ck-sysdeps-unix.c | 5 ----- |
155 |
+ tools/ck-remove-directory.c | 10 ---------- |
156 |
+ 2 files changed, 15 deletions(-) |
157 |
+ |
158 |
+diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c |
159 |
+index 67d8eac..ecd176a 100644 |
160 |
+--- a/src/ck-sysdeps-unix.c |
161 |
++++ b/src/ck-sysdeps-unix.c |
162 |
+@@ -409,11 +409,6 @@ ck_generate_runtime_dir_for_user (guint uid) |
163 |
+ |
164 |
+ TRACE (); |
165 |
+ |
166 |
+- if (uid < 1) { |
167 |
+- g_debug ("We do not create runtime dirs for root"); |
168 |
+- return NULL; |
169 |
+- } |
170 |
+- |
171 |
+ errno = 0; |
172 |
+ pwent = getpwuid (uid); |
173 |
+ if (pwent == NULL) { |
174 |
+diff --git a/tools/ck-remove-directory.c b/tools/ck-remove-directory.c |
175 |
+index cf44fd6..b1a5722 100644 |
176 |
+--- a/tools/ck-remove-directory.c |
177 |
++++ b/tools/ck-remove-directory.c |
178 |
+@@ -51,11 +51,6 @@ become_user (uid_t uid, const gchar* dest) |
179 |
+ int res; |
180 |
+ struct passwd *pwent; |
181 |
+ |
182 |
+- if (uid < 1) { |
183 |
+- g_critical ("invalid UID"); |
184 |
+- exit (1); |
185 |
+- } |
186 |
+- |
187 |
+ if (dest == NULL) { |
188 |
+ g_critical ("invalid dest"); |
189 |
+ exit (1); |
190 |
+@@ -148,11 +143,6 @@ main (int argc, |
191 |
+ exit (1); |
192 |
+ } |
193 |
+ |
194 |
+- if (user_id < 1) { |
195 |
+- g_warning ("Invalid UID"); |
196 |
+- exit (1); |
197 |
+- } |
198 |
+- |
199 |
+ /* Ensure we have a dest and that it starts with the correct prefix |
200 |
+ * so we don't remove something important. |
201 |
+ */ |
202 |
+-- |
203 |
+2.7.3 |
204 |
+ |