1 |
commit: b2d385b19200e3a77322e25d28ddd6dcb7d137fc |
2 |
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Sep 3 14:08:26 2017 +0000 |
4 |
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Sep 3 16:15:32 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b2d385b1 |
7 |
|
8 |
x11-libs/gksu: fix build with format-security, bug #517664 |
9 |
|
10 |
Bump to EAPI=6. Fix non-existant gtk-doc support. Use src_configure instead of G2CONF. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/show_bug.cgi?id=517664 |
13 |
|
14 |
Package-Manager: Portage-2.3.8, Repoman-2.3.3 |
15 |
|
16 |
.../gksu/files/gksu-2.0.2-format_security.patch | 37 ++++++++++ |
17 |
x11-libs/gksu/gksu-2.0.2-r2.ebuild | 85 ++++++++++++++++++++++ |
18 |
2 files changed, 122 insertions(+) |
19 |
|
20 |
diff --git a/x11-libs/gksu/files/gksu-2.0.2-format_security.patch b/x11-libs/gksu/files/gksu-2.0.2-format_security.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..ca87e9af995 |
23 |
--- /dev/null |
24 |
+++ b/x11-libs/gksu/files/gksu-2.0.2-format_security.patch |
25 |
@@ -0,0 +1,37 @@ |
26 |
+Description: Fix possible format string vulnerabilities |
27 |
+Author: Michael Biebl <biebl@××××××.org> |
28 |
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=643389 |
29 |
+Index: gksu-2.0.2/gksu/gksu.c |
30 |
+=================================================================== |
31 |
+--- gksu-2.0.2.orig/gksu/gksu.c 2009-03-04 19:25:32.000000000 +0100 |
32 |
++++ gksu-2.0.2/gksu/gksu.c 2011-10-10 18:31:04.599677143 +0200 |
33 |
+@@ -146,9 +146,12 @@ |
34 |
+ msg = g_strdup_vprintf(format, ap); |
35 |
+ va_end(ap); |
36 |
+ |
37 |
+- diag_win = gtk_message_dialog_new_with_markup (NULL, GTK_DIALOG_MODAL, |
38 |
+- type, GTK_BUTTONS_CLOSE, |
39 |
+- msg); |
40 |
++ diag_win = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, |
41 |
++ type, GTK_BUTTONS_CLOSE, |
42 |
++ NULL); |
43 |
++ |
44 |
++ gtk_message_dialog_set_markup (GTK_MESSAGE_DIALOG(diag_win), |
45 |
++ msg); |
46 |
+ |
47 |
+ gtk_signal_connect_object (GTK_OBJECT(diag_win), "delete_event", |
48 |
+ GTK_SIGNAL_FUNC(gtk_main_quit), |
49 |
+@@ -176,12 +179,7 @@ |
50 |
+ g_key_file_load_from_file (desktop, file_name, G_KEY_FILE_NONE, &error); |
51 |
+ if (error) |
52 |
+ { |
53 |
+- gchar *error_msg; |
54 |
+- |
55 |
+- error_msg = g_strdup_printf ("Could not load desktop file: %s", |
56 |
+- error->message); |
57 |
+- g_warning (error_msg); |
58 |
+- g_free (error_msg); |
59 |
++ g_warning ("Could not load desktop file: %s", error->message); |
60 |
+ g_error_free (error); |
61 |
+ g_key_file_free (desktop); |
62 |
+ return; |
63 |
|
64 |
diff --git a/x11-libs/gksu/gksu-2.0.2-r2.ebuild b/x11-libs/gksu/gksu-2.0.2-r2.ebuild |
65 |
new file mode 100644 |
66 |
index 00000000000..13bd353f972 |
67 |
--- /dev/null |
68 |
+++ b/x11-libs/gksu/gksu-2.0.2-r2.ebuild |
69 |
@@ -0,0 +1,85 @@ |
70 |
+# Copyright 1999-2017 Gentoo Foundation |
71 |
+# Distributed under the terms of the GNU General Public License v2 |
72 |
+ |
73 |
+EAPI=6 |
74 |
+ |
75 |
+inherit autotools gnome2 fixheadtails |
76 |
+ |
77 |
+DESCRIPTION="A gtk+ frontend for libgksu" |
78 |
+HOMEPAGE="http://www.nongnu.org/gksu/" |
79 |
+SRC_URI="https://people.debian.org/~kov/gksu/${P}.tar.gz" |
80 |
+ |
81 |
+LICENSE="GPL-2" |
82 |
+SLOT="0" |
83 |
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" |
84 |
+IUSE="gnome" |
85 |
+ |
86 |
+RDEPEND=" |
87 |
+ >=x11-libs/libgksu-2.0.8 |
88 |
+ >=x11-libs/gtk+-2.4:2 |
89 |
+ >=gnome-base/gconf-2 |
90 |
+ gnome? ( |
91 |
+ >=gnome-base/nautilus-2 |
92 |
+ x11-terms/gnome-terminal ) |
93 |
+" |
94 |
+DEPEND="${RDEPEND} |
95 |
+ dev-util/gtk-doc-am |
96 |
+ dev-util/intltool |
97 |
+ virtual/pkgconfig |
98 |
+" |
99 |
+ |
100 |
+src_prepare() { |
101 |
+ ht_fix_file "${S}/gksu-migrate-conf.sh" |
102 |
+ |
103 |
+ # https://savannah.nongnu.org/bugs/index.php?36127 |
104 |
+ eapply "${FILESDIR}"/${PN}-2.0.2-glib-2.31.patch |
105 |
+ |
106 |
+ if use gnome ; then |
107 |
+ sed 's/x-terminal-emulator/gnome-terminal/' \ |
108 |
+ -i gksu.desktop || die "sed 1 failed" |
109 |
+ |
110 |
+ # Conditional patch to avoid eautoreconf |
111 |
+ # https://savannah.nongnu.org/bugs/index.php?36129 |
112 |
+ eapply "${FILESDIR}"/${PN}-2.0.2-nautilus-dir.patch |
113 |
+ |
114 |
+ sed -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' \ |
115 |
+ -i configure.ac || die #467024 |
116 |
+ |
117 |
+ eautoreconf |
118 |
+ else |
119 |
+ sed 's/dist_desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)/dist_desktop_DATA =/' \ |
120 |
+ -i Makefile.am Makefile.in || die "sed 2 failed" |
121 |
+ fi |
122 |
+ |
123 |
+ # Fix build with format-security, bug #517664 |
124 |
+ eapply "${FILESDIR}"/${PN}-2.0.2-format_security.patch |
125 |
+ |
126 |
+ gnome2_src_prepare |
127 |
+} |
128 |
+ |
129 |
+src_configure() { |
130 |
+ gnome2_src_configure \ |
131 |
+ --disable-static \ |
132 |
+ $(use_enable gnome nautilus-extension) |
133 |
+} |
134 |
+ |
135 |
+src_install() { |
136 |
+ gnome2_src_install |
137 |
+ chmod +x "${D}/usr/share/gksu/gksu-migrate-conf.sh" |
138 |
+} |
139 |
+ |
140 |
+pkg_postinst() { |
141 |
+ gnome2_pkg_postinst |
142 |
+ einfo 'updating configuration' |
143 |
+ "${ROOT}"/usr/share/gksu/gksu-migrate-conf.sh |
144 |
+ einfo "" |
145 |
+ einfo "A note on gksudo: It actually runs sudo to get it's work done" |
146 |
+ einfo "However, by default, Gentoo's sudo wipes your environment." |
147 |
+ einfo "This means that gksudo will fail to run any X-based programs." |
148 |
+ einfo "You need to either add yourself to wheel and uncomment this line" |
149 |
+ einfo "in your /etc/sudoers:" |
150 |
+ einfo "Defaults:%wheel !env_reset" |
151 |
+ einfo "Or remove the env_reset line entirely. This can cause security" |
152 |
+ einfo "problems; if you don't trust your users, don't do this, use gksu" |
153 |
+ einfo "instead." |
154 |
+} |