From c007eee298858284558b0ffe50ee8103c8e7c6d7 Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 18:26:33 +0300 Subject: [PATCH 1/7] New package: libgksu-2.0.12 --- srcpkgs/libgksu-devel | 1 + .../patches/0_libgksu-2.0.0-fbsd.patch | 60 +++ .../patches/1_libgksu-2.0.7-libs.patch | 76 ++++ .../patches/2_libgksu-2.0.7-polinguas.patch | 40 ++ .../3_libgksu-2.0.12-revert-forkpty.patch | 359 ++++++++++++++++++ .../4_libgksu-2.0.12-fix-make-3.82.patch | 19 + .../patches/5_libgksu-2.0.12-notests.patch | 26 ++ .../6_libgksu-2.0.12-automake-1.11.2.patch | 25 ++ srcpkgs/libgksu/template | 32 ++ 9 files changed, 638 insertions(+) create mode 120000 srcpkgs/libgksu-devel create mode 100644 srcpkgs/libgksu/patches/0_libgksu-2.0.0-fbsd.patch create mode 100644 srcpkgs/libgksu/patches/1_libgksu-2.0.7-libs.patch create mode 100644 srcpkgs/libgksu/patches/2_libgksu-2.0.7-polinguas.patch create mode 100644 srcpkgs/libgksu/patches/3_libgksu-2.0.12-revert-forkpty.patch create mode 100644 srcpkgs/libgksu/patches/4_libgksu-2.0.12-fix-make-3.82.patch create mode 100644 srcpkgs/libgksu/patches/5_libgksu-2.0.12-notests.patch create mode 100644 srcpkgs/libgksu/patches/6_libgksu-2.0.12-automake-1.11.2.patch create mode 100644 srcpkgs/libgksu/template diff --git a/srcpkgs/libgksu-devel b/srcpkgs/libgksu-devel new file mode 120000 index 00000000000..c8790a5c9b1 --- /dev/null +++ b/srcpkgs/libgksu-devel @@ -0,0 +1 @@ +libgksu/ \ No newline at end of file diff --git a/srcpkgs/libgksu/patches/0_libgksu-2.0.0-fbsd.patch b/srcpkgs/libgksu/patches/0_libgksu-2.0.0-fbsd.patch new file mode 100644 index 00000000000..5c007be5b4b --- /dev/null +++ b/srcpkgs/libgksu/patches/0_libgksu-2.0.0-fbsd.patch @@ -0,0 +1,60 @@ +diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/libgksu.c libgksu-2.0.0/libgksu/libgksu.c +--- libgksu-2.0.0.orig/libgksu/libgksu.c 2006-09-14 22:35:51.000000000 -0400 ++++ libgksu-2.0.0/libgksu/libgksu.c 2006-12-12 11:28:01.000000000 -0500 +@@ -23,7 +23,12 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#include ++#else + #include ++#endif + #include + #include + #include +diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.am libgksu-2.0.0/libgksu/Makefile.am +--- libgksu-2.0.0.orig/libgksu/Makefile.am 2006-09-14 22:35:52.000000000 -0400 ++++ libgksu-2.0.0/libgksu/Makefile.am 2006-12-12 11:28:01.000000000 -0500 +@@ -30,6 +30,6 @@ gksu_run_helper_SOURCES = gksu-run-helpe + noinst_PROGRAMS = test-gksu + test_gksu_SOURCES = test-gksu.c + test_gksu_LDADD = libgksu2.la +-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` ++test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` + + EXTRA_DIST = libgksu.ver +diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.in libgksu-2.0.0/libgksu/Makefile.in +--- libgksu-2.0.0.orig/libgksu/Makefile.in 2006-09-23 15:37:44.000000000 -0400 ++++ libgksu-2.0.0/libgksu/Makefile.in 2006-12-12 11:30:09.000000000 -0500 +@@ -283,7 +283,7 @@ gksu_run_helper_LDFLAGS = `pkg-config -- + gksu_run_helper_SOURCES = gksu-run-helper.c + test_gksu_SOURCES = test-gksu.c + test_gksu_LDADD = libgksu2.la +-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` ++test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` + EXTRA_DIST = libgksu.ver + all: all-am + +diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.am libgksu-2.0.0/libgksuui/Makefile.am +--- libgksu-2.0.0.orig/libgksuui/Makefile.am 2006-09-14 22:35:31.000000000 -0400 ++++ libgksu-2.0.0/libgksuui/Makefile.am 2006-12-12 11:28:01.000000000 -0500 +@@ -12,4 +12,4 @@ includedir = ${prefix}/include/$(PACKAGE + noinst_PROGRAMS = test-gksuui + test_gksuui_SOURCES = test-gksuui.c + test_gksuui_LDADD = libgksuui1.0.la +-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0` ++test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` +diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.in libgksu-2.0.0/libgksuui/Makefile.in +--- libgksu-2.0.0.orig/libgksuui/Makefile.in 2006-09-23 15:37:44.000000000 -0400 ++++ libgksu-2.0.0/libgksuui/Makefile.in 2006-12-12 11:30:22.000000000 -0500 +@@ -250,7 +250,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h + test_gksuui_SOURCES = test-gksuui.c + test_gksuui_LDADD = libgksuui1.0.la +-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0` ++test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` + all: all-am + + .SUFFIXES: diff --git a/srcpkgs/libgksu/patches/1_libgksu-2.0.7-libs.patch b/srcpkgs/libgksu/patches/1_libgksu-2.0.7-libs.patch new file mode 100644 index 00000000000..b9fb77f2714 --- /dev/null +++ b/srcpkgs/libgksu/patches/1_libgksu-2.0.7-libs.patch @@ -0,0 +1,76 @@ +# https://savannah.nongnu.org/bugs/?25362 +# https://bugs.gentoo.org/show_bug.cgi?id=226837 +diff -Nura a/configure.ac b/configure.ac +--- a/configure.ac 2009-01-19 22:15:30.000000000 +0100 ++++ b/configure.ac 2009-01-19 22:18:10.000000000 +0100 +@@ -43,6 +43,9 @@ + PKG_CHECK_MODULES(LIBGKSU, [gtk+-2.0 >= 2.4.0, gconf-2.0, libstartup-notification-1.0, gnome-keyring-1, libgtop-2.0]) + PKG_CHECK_MODULES(GKSU_PROPERTIES, [gtk+-2.0 >= 2.4.0, gconf-2.0, libglade-2.0]) + ++PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0]) ++PKG_CHECK_MODULES(GTK, [gtk+-2.0 gconf-2.0]) ++ + # Checks for library functions. + ALL_LINGUAS="ca cs da de es eu fr hu it ko lt pl pt_BR ro ru sk sv nb nl zh_CN" + +diff -Nura a/gksu-properties/Makefile.am b/gksu-properties/Makefile.am +--- a/gksu-properties/Makefile.am 2009-01-19 22:15:59.000000000 +0100 ++++ b/gksu-properties/Makefile.am 2009-01-19 22:19:13.000000000 +0100 +@@ -3,7 +3,7 @@ + AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" -DDATA_DIR=\"$(datadir)\" -DPREFIX=\"$(prefix)\" + + bin_PROGRAMS = gksu-properties +-gksu_properties_LDFLAGS = ${GKSU_PROPERTIES_LIBS} ++gksu_properties_LDADD = ${GKSU_PROPERTIES_LIBS} + gksu_properties_SOURCES = gksu-properties.c + + gladedir = ${prefix}/share/${PACKAGE} +diff -Nura a/libgksu/Makefile.am b/libgksu/Makefile.am +--- a/libgksu/Makefile.am 2009-01-19 22:15:59.000000000 +0100 ++++ b/libgksu/Makefile.am 2009-01-19 22:18:25.000000000 +0100 +@@ -8,8 +8,8 @@ + # major -> breaks backward compatibility (changes to existing ABI) + # minor -> keeps compatibility (additions to the API) + # micro -> no change to the API/ABI +-libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la +-libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1 -lutil ${LIBGKSU_LIBS} ++libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la -lutil ${LIBGKSU_LIBS} ++libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1 + if USE_VERSION_SCRIPT + libgksu2_la_LDFLAGS += -Wl,--version-script=libgksu.ver + endif +@@ -24,12 +24,11 @@ + + pkglibdir = ${libdir}/${PACKAGE} + pkglib_PROGRAMS = gksu-run-helper +-gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0` ++gksu_run_helper_LDADD = ${GLIB_LIBS} + gksu_run_helper_SOURCES = gksu-run-helper.c + + noinst_PROGRAMS = test-gksu + test_gksu_SOURCES = test-gksu.c +-test_gksu_LDADD = libgksu2.la +-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` ++test_gksu_LDADD = libgksu2.la ${GLIB_LIBS} + + EXTRA_DIST = libgksu.ver +diff -Nura a/libgksuui/Makefile.am b/libgksuui/Makefile.am +--- a/libgksuui/Makefile.am 2009-01-19 22:15:59.000000000 +0100 ++++ b/libgksuui/Makefile.am 2009-01-19 22:18:54.000000000 +0100 +@@ -4,12 +4,13 @@ + + noinst_LTLIBRARIES = libgksuui1.0.la + libgksuui1_0_la_SOURCES = gksuui-dialog.c +-libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-config --libs gtk+-2.0 gconf-2.0` ++libgksuui1_0_la_LDFLAGS = -Wl,-O1 ++libgksuui1_0_la_LIBADD = ${GTK_LIBS} + + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h + includedir = ${prefix}/include/$(PACKAGE) + + noinst_PROGRAMS = test-gksuui + test_gksuui_SOURCES = test-gksuui.c +-test_gksuui_LDADD = libgksuui1.0.la +-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` ++test_gksuui_LDADD = libgksuui1.0.la ${GLIB_LIBS} ++ diff --git a/srcpkgs/libgksu/patches/2_libgksu-2.0.7-polinguas.patch b/srcpkgs/libgksu/patches/2_libgksu-2.0.7-polinguas.patch new file mode 100644 index 00000000000..e423af16b44 --- /dev/null +++ b/srcpkgs/libgksu/patches/2_libgksu-2.0.7-polinguas.patch @@ -0,0 +1,40 @@ +# https://savannah.nongnu.org/bugs/?25360 +diff -Nura a/configure.ac b/configure.ac +--- a/configure.ac 2009-01-19 21:50:57.000000000 +0100 ++++ b/configure.ac 2009-01-19 21:53:21.000000000 +0100 +@@ -50,7 +50,7 @@ + GETTEXT_PACKAGE=AC_PACKAGE_NAME + AC_SUBST(GETTEXT_PACKAGE) + +-IT_PROG_INTLTOOL ++IT_PROG_INTLTOOL([0.35.5]) + AM_GLIB_GNU_GETTEXT + + ################################################## +diff -Nura a/po/LINGUAS b/po/LINGUAS +--- a/po/LINGUAS 1970-01-01 01:00:00.000000000 +0100 ++++ b/po/LINGUAS 2009-01-19 21:54:24.000000000 +0100 +@@ -0,0 +1,23 @@ ++# please keep this list sorted alphabetically ++# http://live.gnome.org/GnomeGoals/PoLinguas ++# ++ca ++cs ++da ++de ++es ++eu ++fr ++hu ++it ++ko ++lt ++pl ++pt_BR ++ro ++ru ++sk ++sv ++nb ++nl ++zh_CN diff --git a/srcpkgs/libgksu/patches/3_libgksu-2.0.12-revert-forkpty.patch b/srcpkgs/libgksu/patches/3_libgksu-2.0.12-revert-forkpty.patch new file mode 100644 index 00000000000..2c3a8cc786b --- /dev/null +++ b/srcpkgs/libgksu/patches/3_libgksu-2.0.12-revert-forkpty.patch @@ -0,0 +1,359 @@ +diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN libgksu-2.0.12.orig/libgksu/libgksu.c libgksu-2.0.12/libgksu/libgksu.c +--- libgksu-2.0.12.orig/libgksu/libgksu.c 2009-06-29 13:48:24.000000000 -0400 ++++ libgksu-2.0.12/libgksu/libgksu.c 2010-01-12 07:32:10.450657456 -0500 +@@ -1,7 +1,6 @@ + /* + * Gksu -- a library providing access to su functionality + * Copyright (C) 2004-2009 Gustavo Noronha Silva +- * Portions Copyright (C) 2009 VMware, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public +@@ -56,9 +55,6 @@ + static void + gksu_context_launch_complete (GksuContext *context); + +-static void +-read_line (int fd, gchar *buffer, int n); +- + GType + gksu_error_get_type (void) + { +@@ -2009,8 +2005,6 @@ gksu_su_fuller (GksuContext *context, + for (i = 0 ; cmd[i] != NULL ; i++) + g_free (cmd[i]); + g_free(cmd); +- +- _exit(1); + } + else if (pid == -1) + { +@@ -2125,10 +2119,10 @@ gksu_su_fuller (GksuContext *context, + /* drop the \n echoed on password entry if su did request + a password */ + if (password_needed) +- read_line (fdpty, buf, 255); ++ read (fdpty, buf, 255); + if (context->debug) + fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf); +- read_line (fdpty, buf, 255); ++ read (fdpty, buf, 255); + if (context->debug) + fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf); + } +@@ -2142,9 +2136,7 @@ gksu_su_fuller (GksuContext *context, + { + int retval = 0; + +- /* Red Hat's su shows the full path to su in its error messages. */ +- if (!strncmp (buf, "su:", 3) || +- !strncmp (buf, "/bin/su:", 7)) ++ if (!strncmp (buf, "su", 2)) + { + gchar **strings; + +@@ -2155,11 +2147,7 @@ gksu_su_fuller (GksuContext *context, + } + + strings = g_strsplit (buf, ":", 2); +- +- /* Red Hat and Fedora use 'incorrect password'. */ +- if (strings[1] && +- (g_str_has_prefix(strings[1], " Authentication failure") || +- g_str_has_prefix(strings[1], " incorrect password"))) ++ if (strings[1] && !strncmp (strings[1], " Authentication failure", 23)) + { + if (used_gnome_keyring) + g_set_error (error, gksu_quark, +@@ -2473,12 +2461,6 @@ gksu_sudo_fuller (GksuContext *context, + { + char **cmd; + char buffer[256] = {0}; +- char *child_stderr = NULL; +- /* This command is used to gain a token */ +- char *const verifycmd[] = +- { +- "/usr/bin/sudo", "-p", "GNOME_SUDO_PASS", "-v", NULL +- }; + int argcount = 8; + int i, j; + +@@ -2489,8 +2471,9 @@ gksu_sudo_fuller (GksuContext *context, + + pid_t pid; + int status; +- FILE *fdfile = NULL; +- int fdpty = -1; ++ FILE *infile, *outfile; ++ int parent_pipe[2]; /* For talking to the parent */ ++ int child_pipe[2]; /* For talking to the child */ + + context->sudo_mode = TRUE; + +@@ -2565,10 +2548,6 @@ gksu_sudo_fuller (GksuContext *context, + cmd[argcount] = g_strdup("-S"); + argcount++; + +- /* Make sudo noninteractive (we should already have a token) */ +- cmd[argcount] = g_strdup("-n"); +- argcount++; +- + /* Make sudo use next arg as prompt */ + cmd[argcount] = g_strdup("-p"); + argcount++; +@@ -2647,21 +2626,26 @@ gksu_sudo_fuller (GksuContext *context, + fprintf (stderr, "cmd[%d]: %s\n", i, cmd[i]); + } + +- pid = forkpty(&fdpty, NULL, NULL, NULL); +- if (pid == 0) ++ if ((pipe(parent_pipe)) == -1) + { +- // Child +- setsid(); // make us session leader +- +- execv(verifycmd[0], verifycmd); ++ g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, ++ _("Error creating pipe: %s"), ++ strerror(errno)); ++ sudo_reset_xauth (context, xauth, xauth_env); ++ return FALSE; ++ } + +- g_set_error (error, gksu_quark, GKSU_ERROR_EXEC, +- _("Failed to exec new process: %s"), ++ if ((pipe(child_pipe)) == -1) ++ { ++ g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, ++ _("Error creating pipe: %s"), + strerror(errno)); + sudo_reset_xauth (context, xauth, xauth_env); + return FALSE; + } +- else if (pid == -1) ++ ++ pid = fork(); ++ if (pid == -1) + { + g_set_error (error, gksu_quark, GKSU_ERROR_FORK, + _("Failed to fork new process: %s"), +@@ -2669,26 +2653,56 @@ gksu_sudo_fuller (GksuContext *context, + sudo_reset_xauth (context, xauth, xauth_env); + return FALSE; + } ++ else if (pid == 0) ++ { ++ // Child ++ setsid(); // make us session leader ++ close(child_pipe[1]); ++ dup2(child_pipe[0], STDIN_FILENO); ++ dup2(parent_pipe[1], STDERR_FILENO); + ++ execv(cmd[0], cmd); ++ ++ g_set_error (error, gksu_quark, GKSU_ERROR_EXEC, ++ _("Failed to exec new process: %s"), ++ strerror(errno)); ++ sudo_reset_xauth (context, xauth, xauth_env); ++ return FALSE; ++ } + else + { + gint counter = 0; + gchar *cmdline = NULL; +- struct termios tio; + + // Parent +- fdfile = fdopen(fdpty, "w+"); ++ close(parent_pipe[1]); + +- /* make sure we notice that ECHO is turned off, if it gets +- turned off */ +- tcgetattr (fdpty, &tio); +- for (counter = 0; (tio.c_lflag & ECHO) && counter < 15; counter++) +- { +- usleep (1000); +- tcgetattr (fdpty, &tio); +- } ++ infile = fdopen(parent_pipe[0], "r"); ++ if (!infile) ++ { ++ g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, ++ _("Error opening pipe: %s"), ++ strerror(errno)); ++ sudo_reset_xauth (context, xauth, xauth_env); ++ return FALSE; ++ } + +- fcntl (fdpty, F_SETFL, O_NONBLOCK); ++ outfile = fdopen(child_pipe[1], "w"); ++ if (!outfile) ++ { ++ g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, ++ _("Error opening pipe: %s"), ++ strerror(errno)); ++ sudo_reset_xauth (context, xauth, xauth_env); ++ return FALSE; ++ } ++ ++ /* ++ we are expecting to receive a GNOME_SUDO_PASS ++ if we don't there are two possibilities: an error ++ or a password is not needed ++ */ ++ fcntl (parent_pipe[0], F_SETFL, O_NONBLOCK); + + { /* no matter if we can read, since we're using + O_NONBLOCK; this is just to avoid the prompt +@@ -2697,11 +2711,11 @@ gksu_sudo_fuller (GksuContext *context, + struct timeval tv; + + FD_ZERO(&rfds); +- FD_SET(fdpty, &rfds); ++ FD_SET(parent_pipe[0], &rfds); + tv.tv_sec = 1; + tv.tv_usec = 0; + +- select (fdpty + 1, &rfds, NULL, NULL, &tv); ++ select (parent_pipe[0] + 1, &rfds, NULL, NULL, &tv); + } + + /* Try hard to find the prompt; it may happen that we're +@@ -2713,7 +2727,7 @@ gksu_sudo_fuller (GksuContext *context, + if (strncmp (buffer, "GNOME_SUDO_PASS", 15) == 0) + break; + +- read_line (fdpty, buffer, 256); ++ read_line (parent_pipe[0], buffer, 256); + + if (context->debug) + fprintf (stderr, "buffer: -%s-\n", buffer); +@@ -2747,17 +2761,18 @@ gksu_sudo_fuller (GksuContext *context, + + usleep (1000); + +- write (fdpty, password, strlen(password) + 1); +- write (fdpty, "\n", 1); ++ fprintf (outfile, "%s\n", password); ++ fclose (outfile); + + nullify_password (password); + +- fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK); ++ /* turn NONBLOCK off */ ++ fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK); + /* ignore the first newline that comes right after sudo receives + the password */ +- fgets (buffer, 255, fdfile); +- /* this is the status we are interested in */ +- fgets (buffer, 255, fdfile); ++ fgets (buffer, 255, infile); ++ /* this is the status we are interessted in */ ++ fgets (buffer, 255, infile); + } + else + { +@@ -2766,7 +2781,7 @@ gksu_sudo_fuller (GksuContext *context, + fprintf (stderr, "No password prompt found; we'll assume we don't need a password.\n"); + + /* turn NONBLOCK off, also if have no prompt */ +- fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK); ++ fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK); + + should_display = gconf_client_get_bool (context->gconf_client, + BASE_PATH "display-no-pass-info", NULL); +@@ -2785,9 +2800,14 @@ gksu_sudo_fuller (GksuContext *context, + fprintf (stderr, "%s", buffer); + } + +- if (g_str_has_prefix (buffer, "Sorry, try again.")) ++ if (!strcmp (buffer, "Sorry, try again.\n")) + g_set_error (error, gksu_quark, GKSU_ERROR_WRONGPASS, + _("Wrong password.")); ++ else if (!strncmp (buffer, "Sorry, user ", 12)) ++ g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED, ++ _("The underlying authorization mechanism (sudo) " ++ "does not allow you to run this program. Contact " ++ "the system administrator.")); + else + { + gchar *haystack = buffer; +@@ -2805,10 +2825,6 @@ gksu_sudo_fuller (GksuContext *context, + } + } + +- /* If we have an error, let's just stop sudo right there. */ +- if (error) +- close(fdpty); +- + cmdline = g_strdup("sudo"); + /* wait for the child process to end or become something other + than sudo */ +@@ -2825,23 +2841,17 @@ gksu_sudo_fuller (GksuContext *context, + if (context->sn_context) + gksu_context_launch_complete (context); + ++ while (read (parent_pipe[0], buffer, 255) > 0) ++ { ++ fprintf (stderr, "%s", buffer); ++ bzero(buffer, 256); ++ } ++ + /* if the process is still active waitpid() on it */ + if (pid_exited != pid) + waitpid(pid, &status, 0); + sudo_reset_xauth (context, xauth, xauth_env); + +- /* +- * Did token acquisition succeed? If so, spawn sudo in +- * non-interactive mode. It should either succeed or die +- * immediately if you're not allowed to run the command. +- */ +- if (WEXITSTATUS(status) == 0) +- { +- g_spawn_sync(NULL, cmd, NULL, 0, NULL, NULL, +- NULL, &child_stderr, &status, +- error); +- } +- + if (exit_status) + { + if (WIFEXITED(status)) { +@@ -2853,13 +2863,6 @@ gksu_sudo_fuller (GksuContext *context, + + if (WEXITSTATUS(status)) + { +- if (g_str_has_prefix(child_stderr, "Sorry, user ")) +- { +- g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED, +- _("The underlying authorization mechanism (sudo) " +- "does not allow you to run this program. Contact " +- "the system administrator.")); +- } + if(cmdline) + { + /* sudo already exec()ed something else, don't report +@@ -2868,7 +2871,6 @@ gksu_sudo_fuller (GksuContext *context, + if (!g_str_has_suffix (cmdline, "sudo")) + { + g_free (cmdline); +- g_free (child_stderr); + return FALSE; + } + g_free (cmdline); +@@ -2881,11 +2883,11 @@ gksu_sudo_fuller (GksuContext *context, + } + } + +- fprintf(stderr, child_stderr); +- g_free(child_stderr); +- + /* if error is set we have found an error condition */ +- return (error == NULL); ++ if (error) ++ return FALSE; ++ ++ return TRUE; + } + + /** diff --git a/srcpkgs/libgksu/patches/4_libgksu-2.0.12-fix-make-3.82.patch b/srcpkgs/libgksu/patches/4_libgksu-2.0.12-fix-make-3.82.patch new file mode 100644 index 00000000000..7616a6dc7b4 --- /dev/null +++ b/srcpkgs/libgksu/patches/4_libgksu-2.0.12-fix-make-3.82.patch @@ -0,0 +1,19 @@ +--- a/Makefile.am-orig 2010-08-22 16:11:19.872577459 -0500 ++++ b/Makefile.am 2010-08-22 16:11:55.289599110 -0500 +@@ -17,11 +17,11 @@ + + if GCONF_SCHEMAS_INSTALL + install-data-local: +- if test -z "$(DESTDIR)" ; then \ +- for p in $(schemas_DATA) ; do \ +- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \ +- done \ +- fi ++ if test -z "$(DESTDIR)" ; then \ ++ for p in $(schemas_DATA) ; do \ ++ GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \ ++ done \ ++ fi + else + install-data-local: + endif diff --git a/srcpkgs/libgksu/patches/5_libgksu-2.0.12-notests.patch b/srcpkgs/libgksu/patches/5_libgksu-2.0.12-notests.patch new file mode 100644 index 00000000000..3787ef6bfc1 --- /dev/null +++ b/srcpkgs/libgksu/patches/5_libgksu-2.0.12-notests.patch @@ -0,0 +1,26 @@ +Index: libgksu-2.0.12/libgksu/Makefile.am +=================================================================== +--- libgksu-2.0.12.orig/libgksu/Makefile.am ++++ libgksu-2.0.12/libgksu/Makefile.am +@@ -27,7 +27,7 @@ pkglib_PROGRAMS = gksu-run-helper + gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0` + gksu_run_helper_SOURCES = gksu-run-helper.c + +-noinst_PROGRAMS = test-gksu ++EXTRA_PROGRAMS = test-gksu + test_gksu_SOURCES = test-gksu.c + test_gksu_LDADD = libgksu2.la + test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` +Index: libgksu-2.0.12/libgksuui/Makefile.am +=================================================================== +--- libgksu-2.0.12.orig/libgksuui/Makefile.am ++++ libgksu-2.0.12/libgksuui/Makefile.am +@@ -9,7 +9,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h + includedir = ${prefix}/include/$(PACKAGE) + +-noinst_PROGRAMS = test-gksuui ++EXTRA_PROGRAMS = test-gksuui + test_gksuui_SOURCES = test-gksuui.c + test_gksuui_LDADD = libgksuui1.0.la + test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0` diff --git a/srcpkgs/libgksu/patches/6_libgksu-2.0.12-automake-1.11.2.patch b/srcpkgs/libgksu/patches/6_libgksu-2.0.12-automake-1.11.2.patch new file mode 100644 index 00000000000..0f22166fb8b --- /dev/null +++ b/srcpkgs/libgksu/patches/6_libgksu-2.0.12-automake-1.11.2.patch @@ -0,0 +1,25 @@ +Due to the following change, pkglib_PROGRAMS is invalid: + http://git.savannah.gnu.org/cgit/automake.git/commit/?id=9ca632642b006ac6b0fc4ce0ae5b34023faa8cbf + +https://savannah.nongnu.org/bugs/index.php?35241 +https://bugs.gentoo.org/show_bug.cgi?id=397411 + +--- + libgksu/Makefile.am | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libgksu/Makefile.am b/libgksu/Makefile.am +index 49362f9..3cb1090 100644 +--- a/libgksu/Makefile.am ++++ b/libgksu/Makefile.am +@@ -22,8 +22,8 @@ includedir = ${prefix}/include/${PACKAGE} + pkgconfigdir = ${libdir}/pkgconfig + pkgconfig_DATA = libgksu2.pc + +-pkglibdir = ${libdir}/${PACKAGE} +-pkglib_PROGRAMS = gksu-run-helper ++gksulibdir = ${libdir}/${PACKAGE} ++gksulib_PROGRAMS = gksu-run-helper + gksu_run_helper_LDADD = ${GLIB_LIBS} + gksu_run_helper_SOURCES = gksu-run-helper.c + diff --git a/srcpkgs/libgksu/template b/srcpkgs/libgksu/template new file mode 100644 index 00000000000..5017d75857c --- /dev/null +++ b/srcpkgs/libgksu/template @@ -0,0 +1,32 @@ +# Template file for 'libgksu' +pkgname=libgksu +version=2.0.12 +revision=1 +build_style=gnu-configure +configure_args="--disable-static" +hostmakedepends="pkg-config intltool" +makedepends="gtk-doc gtk+-devel GConf-devel libgnome-keyring-devel libgtop-devel startup-notification-devel gettext-devel" +short_desc="gksu authorization library" +maintainer="Alexey Rochev " +homepage="http://www.nongnu.org/gksu/index.html" +license="GPL-2" +distfiles="http://people.debian.org/~kov/gksu/$pkgname-$version.tar.gz" +checksum=22f9cfc3627dcb6774b9aff66c6ea6554f3b34b82bbfa2467b821e67874c3faf + +patch_args="-Np1" + +pre_configure() { + touch NEWS README + autoreconf -fi +} + +libgksu-devel_package() { + depends="libgksu glib-devel startup-notification-devel libgnome-keyring-devel GConf-devel" + short_desc+=" - development files" + pkg_install() { + vmove usr/include + vmove usr/lib/pkgconfig + vmove "usr/lib/*.so" + vmove usr/share/gtk-doc + } +} From f6bf0a2e8c1e697f1b89cf55c7249c0f5a704f78 Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 18:27:06 +0300 Subject: [PATCH 2/7] New package: gksu-2.0.2 --- srcpkgs/gksu/template | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 srcpkgs/gksu/template diff --git a/srcpkgs/gksu/template b/srcpkgs/gksu/template new file mode 100644 index 00000000000..e6324d869f7 --- /dev/null +++ b/srcpkgs/gksu/template @@ -0,0 +1,15 @@ +# Template file for 'gksu' +pkgname=gksu +version=2.0.2 +revision=1 +build_style=gnu-configure +configure_args="--disable-static --disable-nautilus-extension" +hostmakedepends="pkg-config intltool" +makedepends="gtk-doc libgksu-devel" +depends="xauth" +short_desc="A graphical frontend for su" +maintainer="Alexey Rochev " +homepage="http://www.nongnu.org/gksu/index.html" +license="GPL-2" +distfiles="http://people.debian.org/~kov/gksu/$pkgname-$version.tar.gz" +checksum=a1de3dca039d88c195fcdc9516379439a1d699750417f1e655aa2101a955ee5a From c7ab2d587ab0cd75d02858745334d5bd8d3ad9dd Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 18:28:03 +0300 Subject: [PATCH 3/7] New package: caja-extensions-common-1.8.0 --- srcpkgs/caja-extensions-common/template | 71 +++++++++++++++++++++++++ srcpkgs/caja-gksu | 1 + srcpkgs/caja-image-converter | 1 + srcpkgs/caja-open-terminal | 1 + srcpkgs/caja-sendto | 1 + srcpkgs/caja-share | 1 + 6 files changed, 76 insertions(+) create mode 100644 srcpkgs/caja-extensions-common/template create mode 120000 srcpkgs/caja-gksu create mode 120000 srcpkgs/caja-image-converter create mode 120000 srcpkgs/caja-open-terminal create mode 120000 srcpkgs/caja-sendto create mode 120000 srcpkgs/caja-share diff --git a/srcpkgs/caja-extensions-common/template b/srcpkgs/caja-extensions-common/template new file mode 100644 index 00000000000..0d9b3b93a0b --- /dev/null +++ b/srcpkgs/caja-extensions-common/template @@ -0,0 +1,71 @@ +# Template file for 'caja-extensions-common' +pkgname=caja-extensions-common +version=1.8.0 +revision=1 +build_style=gnu-configure +configure_args="--with-gtk=2.0" +hostmakedepends="pkg-config intltool" +makedepends="libcaja-devel mate-desktop-devel dbus-glib-devel gupnp-devel" +depends="caja" +short_desc="Common files for Caja extensions." +maintainer="Alexey Rochev " +license="GPL-2" +homepage="http://mate-desktop.org" +distfiles="http://pub.mate-desktop.org/releases/1.8/${pkgname%-*}-${version}.tar.xz" +checksum=71b4353236b4f13e1984a8497ff80ed63d74141833ba47a32629a5d3505bbc91 + +wrksrc="${pkgname%-*}-${version}" + +caja-gksu_package() { + short_desc="A Caja extension for executing files with elevated privileges." + depends="gksu" + pkg_install() { + vmove usr/lib/caja/extensions-2.0/libcaja-gksu.so + } +} + +caja-image-converter_package() { + short_desc="A Caja extension for simple image conversions." + depends="caja-extensions-common imagemagick" + pkg_install() { + vmove usr/lib/caja/extensions-2.0/libcaja-image-converter.so + vmove usr/share/caja-extensions/caja-image-resize.ui + vmove usr/share/caja-extensions/caja-image-rotate.ui + } +} + +caja-open-terminal_package() { + short_desc="A Caja extension for opening terminals in arbitrary local paths." + depends="caja-extensions-common" + pkg_install() { + vmove usr/lib/caja/extensions-2.0/libcaja-open-terminal.so + vmove usr/share/MateConf/gsettings/caja-open-terminal.convert + vmove usr/share/glib-2.0/schemas/org.mate.caja-open-terminal.gschema.xml + } +} + +caja-sendto_package() { + short_desc="A Caja extension for sending files." + depends="caja-extensions-common" + pkg_install() { + vmove usr/bin/caja-sendto + vmove usr/include/caja-sendto/* + vmove usr/lib/caja-sendto/* + vmove usr/lib/caja/extensions-2.0/libcaja-sendto.so + vmove usr/lib/pkgconfig/caja-sendto.pc + vmove usr/share/MateConf/gsettings/caja-sendto-convert + vmove usr/share/caja-extensions/caja-sendto.ui + vmove usr/share/glib-2.0/schemas/org.mate.Caja.Sendto.gschema.xml + vmove usr/share/gtk-doc/html/caja-sendto/* + vmove usr/share/man/man1/caja-sendto.1 + } +} + +caja-share_package() { + short_desc="A Caja extension to quickly share a folder." + depends="caja-extensions-common samba" + pkg_install() { + vmove usr/lib/caja/extensions-2.0/libcaja-share.so + vmove usr/share/caja-extensions/share-dialog.ui + } +} diff --git a/srcpkgs/caja-gksu b/srcpkgs/caja-gksu new file mode 120000 index 00000000000..3a114984207 --- /dev/null +++ b/srcpkgs/caja-gksu @@ -0,0 +1 @@ +caja-extensions-common \ No newline at end of file diff --git a/srcpkgs/caja-image-converter b/srcpkgs/caja-image-converter new file mode 120000 index 00000000000..3a114984207 --- /dev/null +++ b/srcpkgs/caja-image-converter @@ -0,0 +1 @@ +caja-extensions-common \ No newline at end of file diff --git a/srcpkgs/caja-open-terminal b/srcpkgs/caja-open-terminal new file mode 120000 index 00000000000..3a114984207 --- /dev/null +++ b/srcpkgs/caja-open-terminal @@ -0,0 +1 @@ +caja-extensions-common \ No newline at end of file diff --git a/srcpkgs/caja-sendto b/srcpkgs/caja-sendto new file mode 120000 index 00000000000..3a114984207 --- /dev/null +++ b/srcpkgs/caja-sendto @@ -0,0 +1 @@ +caja-extensions-common \ No newline at end of file diff --git a/srcpkgs/caja-share b/srcpkgs/caja-share new file mode 120000 index 00000000000..3a114984207 --- /dev/null +++ b/srcpkgs/caja-share @@ -0,0 +1 @@ +caja-extensions-common \ No newline at end of file From a08c55c3965a18b3f0749b093c23dd0237f73d37 Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 22:14:44 +0300 Subject: [PATCH 4/7] caja-extensions-common: fixed descriptions --- srcpkgs/caja-extensions-common/template | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/srcpkgs/caja-extensions-common/template b/srcpkgs/caja-extensions-common/template index 0d9b3b93a0b..a2ea2838191 100644 --- a/srcpkgs/caja-extensions-common/template +++ b/srcpkgs/caja-extensions-common/template @@ -7,7 +7,7 @@ configure_args="--with-gtk=2.0" hostmakedepends="pkg-config intltool" makedepends="libcaja-devel mate-desktop-devel dbus-glib-devel gupnp-devel" depends="caja" -short_desc="Common files for Caja extensions." +short_desc="Common files for Caja extensions" maintainer="Alexey Rochev " license="GPL-2" homepage="http://mate-desktop.org" @@ -17,7 +17,7 @@ checksum=71b4353236b4f13e1984a8497ff80ed63d74141833ba47a32629a5d3505bbc91 wrksrc="${pkgname%-*}-${version}" caja-gksu_package() { - short_desc="A Caja extension for executing files with elevated privileges." + short_desc="A Caja extension for executing files with elevated privileges" depends="gksu" pkg_install() { vmove usr/lib/caja/extensions-2.0/libcaja-gksu.so @@ -25,7 +25,7 @@ caja-gksu_package() { } caja-image-converter_package() { - short_desc="A Caja extension for simple image conversions." + short_desc="A Caja extension for simple image conversions" depends="caja-extensions-common imagemagick" pkg_install() { vmove usr/lib/caja/extensions-2.0/libcaja-image-converter.so @@ -35,7 +35,7 @@ caja-image-converter_package() { } caja-open-terminal_package() { - short_desc="A Caja extension for opening terminals in arbitrary local paths." + short_desc="A Caja extension for opening terminals in arbitrary local paths" depends="caja-extensions-common" pkg_install() { vmove usr/lib/caja/extensions-2.0/libcaja-open-terminal.so @@ -45,7 +45,7 @@ caja-open-terminal_package() { } caja-sendto_package() { - short_desc="A Caja extension for sending files." + short_desc="A Caja extension for sending files" depends="caja-extensions-common" pkg_install() { vmove usr/bin/caja-sendto @@ -62,7 +62,7 @@ caja-sendto_package() { } caja-share_package() { - short_desc="A Caja extension to quickly share a folder." + short_desc="A Caja extension to quickly share a folder" depends="caja-extensions-common samba" pkg_install() { vmove usr/lib/caja/extensions-2.0/libcaja-share.so From 111efe3e88c09626a63bba9f45c89b8988d8f32b Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 22:15:32 +0300 Subject: [PATCH 5/7] libgksu: fixed dependencies --- srcpkgs/libgksu/template | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/srcpkgs/libgksu/template b/srcpkgs/libgksu/template index 5017d75857c..1364ad7bbb5 100644 --- a/srcpkgs/libgksu/template +++ b/srcpkgs/libgksu/template @@ -4,9 +4,9 @@ version=2.0.12 revision=1 build_style=gnu-configure configure_args="--disable-static" -hostmakedepends="pkg-config intltool" -makedepends="gtk-doc gtk+-devel GConf-devel libgnome-keyring-devel libgtop-devel startup-notification-devel gettext-devel" -short_desc="gksu authorization library" +hostmakedepends="pkg-config intltool gtk-doc gettext-devel" +makedepends="gtk+-devel GConf-devel libgnome-keyring-devel libgtop-devel startup-notification-devel" +short_desc="A gksu authorization library" maintainer="Alexey Rochev " homepage="http://www.nongnu.org/gksu/index.html" license="GPL-2" @@ -21,7 +21,7 @@ pre_configure() { } libgksu-devel_package() { - depends="libgksu glib-devel startup-notification-devel libgnome-keyring-devel GConf-devel" + depends="${sourcepkg}>=${version}_${revision} glib-devel startup-notification-devel libgnome-keyring-devel GConf-devel" short_desc+=" - development files" pkg_install() { vmove usr/include From 3adf2cd7d6fe2f9a7e46445238bf0ed33594a6c5 Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 22:15:44 +0300 Subject: [PATCH 6/7] gksu: fixed dependencies --- srcpkgs/gksu/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/gksu/template b/srcpkgs/gksu/template index e6324d869f7..e9f7230d361 100644 --- a/srcpkgs/gksu/template +++ b/srcpkgs/gksu/template @@ -4,8 +4,8 @@ version=2.0.2 revision=1 build_style=gnu-configure configure_args="--disable-static --disable-nautilus-extension" -hostmakedepends="pkg-config intltool" -makedepends="gtk-doc libgksu-devel" +hostmakedepends="pkg-config intltool gtk-doc" +makedepends="libgksu-devel" depends="xauth" short_desc="A graphical frontend for su" maintainer="Alexey Rochev " From fc86697f988b61ded587988ce220297c4a5b9f49 Mon Sep 17 00:00:00 2001 From: equeim Date: Wed, 3 Dec 2014 22:22:26 +0300 Subject: [PATCH 7/7] caja-extensions-common: fixed dependencies --- srcpkgs/caja-extensions-common/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/caja-extensions-common/template b/srcpkgs/caja-extensions-common/template index a2ea2838191..840b2691534 100644 --- a/srcpkgs/caja-extensions-common/template +++ b/srcpkgs/caja-extensions-common/template @@ -26,7 +26,7 @@ caja-gksu_package() { caja-image-converter_package() { short_desc="A Caja extension for simple image conversions" - depends="caja-extensions-common imagemagick" + depends="caja-extensions-common ImageMagick" pkg_install() { vmove usr/lib/caja/extensions-2.0/libcaja-image-converter.so vmove usr/share/caja-extensions/caja-image-resize.ui