Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

New packages: libgksu, gksu

authored by José Romildo Malaquias and committed by Rok Garbas ba9bfd39 297599a2

+769
+48
pkgs/applications/misc/gksu/default.nix
··· 1 + { stdenv, fetchurl, pkgconfig, makeWrapper, gtk, gnome3, libgksu, 2 + intltool, libstartup_notification, gtk_doc 3 + }: 4 + 5 + stdenv.mkDerivation rec { 6 + version = "2.0.2"; 7 + pname = "gksu"; 8 + name = "${pname}-${version}"; 9 + 10 + src = fetchurl { 11 + url = "http://people.debian.org/~kov/gksu/${name}.tar.gz"; 12 + sha256 = "0npfanlh28daapkg25q4fncxd89rjhvid5fwzjaw324x0g53vpm1"; 13 + }; 14 + 15 + patches = [ 16 + # https://savannah.nongnu.org/bugs/index.php?36127 17 + ./gksu-2.0.2-glib-2.31.patch 18 + ]; 19 + 20 + postPatch = '' 21 + sed -i -e 's|/usr/bin/x-terminal-emulator|-l gnome-terminal|g' gksu.desktop 22 + ''; 23 + 24 + configureFlags = "--disable-nautilus-extension"; 25 + 26 + buildInputs = [ 27 + pkgconfig makeWrapper gtk gnome3.gconf intltool 28 + libstartup_notification gnome3.libgnome_keyring gtk_doc 29 + ]; 30 + 31 + propagatedBuildInputs = [ 32 + libgksu 33 + ]; 34 + 35 + meta = { 36 + description = "A graphical frontend for libgksu"; 37 + longDescription = '' 38 + GKSu is a library that provides a Gtk+ frontend to su and sudo. 39 + It supports login shells and preserving environment when acting as 40 + a su frontend. It is useful to menu items or other graphical 41 + programs that need to ask a user's password to run another program 42 + as another user. 43 + ''; 44 + homepage = "http://www.nongnu.org/gksu/"; 45 + license = stdenv.lib.licenses.gpl2; 46 + maintainers = [ stdenv.lib.maintainers.romildo ]; 47 + }; 48 + }
+29
pkgs/applications/misc/gksu/gksu-2.0.2-glib-2.31.patch
··· 1 + From 10c7e67e11a56e2fe1acf9b085772bc995d35bc0 Mon Sep 17 00:00:00 2001 2 + From: Alexandre Rostovtsev <tetromino@gentoo.org> 3 + Date: Sat, 7 Apr 2012 17:57:36 -0400 4 + Subject: [PATCH] Fix glib includes for building with >=glib-2.31 5 + 6 + glib-2.31 and newer no longer allow most glib subheaders to be included 7 + directly. 8 + 9 + https://savannah.nongnu.org/bugs/index.php?36127 10 + --- 11 + nautilus-gksu/libnautilus-gksu.c | 2 +- 12 + 1 files changed, 1 insertions(+), 1 deletions(-) 13 + 14 + diff --git a/nautilus-gksu/libnautilus-gksu.c b/nautilus-gksu/libnautilus-gksu.c 15 + index 8e44d29..4acf3f8 100644 16 + --- a/nautilus-gksu/libnautilus-gksu.c 17 + +++ b/nautilus-gksu/libnautilus-gksu.c 18 + @@ -5,7 +5,7 @@ 19 + #include <string.h> 20 + #include <pthread.h> 21 + 22 + -#include <glib/gkeyfile.h> 23 + +#include <glib.h> 24 + #include <gtk/gtk.h> 25 + #include <gio/gio.h> 26 + #include <libnautilus-extension/nautilus-extension-types.h> 27 + -- 28 + 1.7.8.5 29 +
+83
pkgs/development/libraries/libgksu/default.nix
··· 1 + { stdenv, fetchurl, pkgconfig, makeWrapper, gtk, gnome, gnome3, 2 + libstartup_notification, libgtop, perl, perlXMLParser, autoconf, 3 + automake, libtool, intltool, gtk_doc, docbook_xsl, xauth, sudo 4 + }: 5 + 6 + stdenv.mkDerivation rec { 7 + version = "2.0.12"; 8 + pname = "libgksu"; 9 + name = "${pname}-${version}"; 10 + 11 + src = fetchurl { 12 + url = "http://people.debian.org/~kov/gksu/${name}.tar.gz"; 13 + sha256 = "1brz9j3nf7l2gd3a5grbp0s3nksmlrp6rxmgp5s6gjvxcb1wzy92"; 14 + }; 15 + 16 + patches = [ 17 + # Patches from the gentoo ebuild 18 + 19 + # Fix compilation on bsdc 20 + ./libgksu-2.0.0-fbsd.patch 21 + 22 + # Fix wrong usage of LDFLAGS, gentoo bug #226837 23 + ./libgksu-2.0.7-libs.patch 24 + 25 + # Use po/LINGUAS 26 + ./libgksu-2.0.7-polinguas.patch 27 + 28 + # Don't forkpty; gentoo bug #298289 29 + ./libgksu-2.0.12-revert-forkpty.patch 30 + 31 + # Make this gmake-3.82 compliant, gentoo bug #333961 32 + ./libgksu-2.0.12-fix-make-3.82.patch 33 + 34 + # Do not build test programs that are never executed; also fixes gentoo bug #367397 (underlinking issues). 35 + ./libgksu-2.0.12-notests.patch 36 + 37 + # Fix automake-1.11.2 compatibility, gentoo bug #397411 38 + ./libgksu-2.0.12-automake-1.11.2.patch 39 + ]; 40 + 41 + postPatch = '' 42 + # gentoo bug #467026 43 + sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac 44 + 45 + # Fix some binary paths 46 + sed -i -e 's|/usr/bin/xauth|${xauth}/bin/xauth|g' libgksu/gksu-run-helper.c libgksu/libgksu.c 47 + sed -i -e 's|/usr/bin/sudo|${sudo}/bin/sudo|g' libgksu/libgksu.c 48 + sed -i -e 's|/bin/su\([^d]\)|/var/setuid-wrappers/su\1|g' libgksu/libgksu.c 49 + 50 + touch NEWS README 51 + ''; 52 + 53 + preConfigure = '' 54 + intltoolize --force --copy --automake 55 + autoreconf -vfi 56 + ''; 57 + 58 + buildInputs = [ 59 + pkgconfig makeWrapper gtk gnome.GConf libstartup_notification 60 + gnome3.libgnome_keyring libgtop gnome.libglade perl perlXMLParser 61 + autoconf automake libtool intltool gtk_doc docbook_xsl 62 + ]; 63 + 64 + preFixup = '' 65 + wrapProgram "$out/bin/gksu-properties" \ 66 + --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" 67 + ''; 68 + 69 + enableParallelBuilding = true; 70 + 71 + meta = { 72 + description = "A library for integration of su into applications"; 73 + longDescription = '' 74 + This library comes from the gksu program. It provides a simple API 75 + to use su and sudo in programs that need to execute tasks as other 76 + user. It provides X authentication facilities for running 77 + programs in an X session. 78 + ''; 79 + homepage = "http://www.nongnu.org/gksu/"; 80 + license = stdenv.lib.licenses.lgpl2; 81 + maintainers = [ stdenv.lib.maintainers.romildo ]; 82 + }; 83 + }
+60
pkgs/development/libraries/libgksu/libgksu-2.0.0-fbsd.patch
··· 1 + diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/libgksu.c libgksu-2.0.0/libgksu/libgksu.c 2 + --- libgksu-2.0.0.orig/libgksu/libgksu.c 2006-09-14 22:35:51.000000000 -0400 3 + +++ libgksu-2.0.0/libgksu/libgksu.c 2006-12-12 11:28:01.000000000 -0500 4 + @@ -23,7 +23,12 @@ 5 + #include <unistd.h> 6 + #include <string.h> 7 + #include <fcntl.h> 8 + +#ifdef __FreeBSD__ 9 + +#include <libutil.h> 10 + +#include <termios.h> 11 + +#else 12 + #include <pty.h> 13 + +#endif 14 + #include <pwd.h> 15 + #include <sys/types.h> 16 + #include <sys/wait.h> 17 + diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.am libgksu-2.0.0/libgksu/Makefile.am 18 + --- libgksu-2.0.0.orig/libgksu/Makefile.am 2006-09-14 22:35:52.000000000 -0400 19 + +++ libgksu-2.0.0/libgksu/Makefile.am 2006-12-12 11:28:01.000000000 -0500 20 + @@ -30,6 +30,6 @@ gksu_run_helper_SOURCES = gksu-run-helpe 21 + noinst_PROGRAMS = test-gksu 22 + test_gksu_SOURCES = test-gksu.c 23 + test_gksu_LDADD = libgksu2.la 24 + -test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` 25 + +test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 26 + 27 + EXTRA_DIST = libgksu.ver 28 + diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.in libgksu-2.0.0/libgksu/Makefile.in 29 + --- libgksu-2.0.0.orig/libgksu/Makefile.in 2006-09-23 15:37:44.000000000 -0400 30 + +++ libgksu-2.0.0/libgksu/Makefile.in 2006-12-12 11:30:09.000000000 -0500 31 + @@ -283,7 +283,7 @@ gksu_run_helper_LDFLAGS = `pkg-config -- 32 + gksu_run_helper_SOURCES = gksu-run-helper.c 33 + test_gksu_SOURCES = test-gksu.c 34 + test_gksu_LDADD = libgksu2.la 35 + -test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` 36 + +test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 37 + EXTRA_DIST = libgksu.ver 38 + all: all-am 39 + 40 + diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.am libgksu-2.0.0/libgksuui/Makefile.am 41 + --- libgksu-2.0.0.orig/libgksuui/Makefile.am 2006-09-14 22:35:31.000000000 -0400 42 + +++ libgksu-2.0.0/libgksuui/Makefile.am 2006-12-12 11:28:01.000000000 -0500 43 + @@ -12,4 +12,4 @@ includedir = ${prefix}/include/$(PACKAGE 44 + noinst_PROGRAMS = test-gksuui 45 + test_gksuui_SOURCES = test-gksuui.c 46 + test_gksuui_LDADD = libgksuui1.0.la 47 + -test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0` 48 + +test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 49 + diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.in libgksu-2.0.0/libgksuui/Makefile.in 50 + --- libgksu-2.0.0.orig/libgksuui/Makefile.in 2006-09-23 15:37:44.000000000 -0400 51 + +++ libgksu-2.0.0/libgksuui/Makefile.in 2006-12-12 11:30:22.000000000 -0500 52 + @@ -250,7 +250,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c 53 + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h 54 + test_gksuui_SOURCES = test-gksuui.c 55 + test_gksuui_LDADD = libgksuui1.0.la 56 + -test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0` 57 + +test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 58 + all: all-am 59 + 60 + .SUFFIXES:
+25
pkgs/development/libraries/libgksu/libgksu-2.0.12-automake-1.11.2.patch
··· 1 + Due to the following change, pkglib_PROGRAMS is invalid: 2 + http://git.savannah.gnu.org/cgit/automake.git/commit/?id=9ca632642b006ac6b0fc4ce0ae5b34023faa8cbf 3 + 4 + https://savannah.nongnu.org/bugs/index.php?35241 5 + https://bugs.gentoo.org/show_bug.cgi?id=397411 6 + 7 + --- 8 + libgksu/Makefile.am | 4 ++-- 9 + 1 files changed, 2 insertions(+), 2 deletions(-) 10 + 11 + diff --git a/libgksu/Makefile.am b/libgksu/Makefile.am 12 + index 49362f9..3cb1090 100644 13 + --- a/libgksu/Makefile.am 14 + +++ b/libgksu/Makefile.am 15 + @@ -22,8 +22,8 @@ includedir = ${prefix}/include/${PACKAGE} 16 + pkgconfigdir = ${libdir}/pkgconfig 17 + pkgconfig_DATA = libgksu2.pc 18 + 19 + -pkglibdir = ${libdir}/${PACKAGE} 20 + -pkglib_PROGRAMS = gksu-run-helper 21 + +gksulibdir = ${libdir}/${PACKAGE} 22 + +gksulib_PROGRAMS = gksu-run-helper 23 + gksu_run_helper_LDADD = ${GLIB_LIBS} 24 + gksu_run_helper_SOURCES = gksu-run-helper.c 25 +
+19
pkgs/development/libraries/libgksu/libgksu-2.0.12-fix-make-3.82.patch
··· 1 + --- libgksu/Makefile.am-orig 2010-08-22 16:11:19.872577459 -0500 2 + +++ libgksu/Makefile.am 2010-08-22 16:11:55.289599110 -0500 3 + @@ -17,11 +17,11 @@ 4 + 5 + if GCONF_SCHEMAS_INSTALL 6 + install-data-local: 7 + - if test -z "$(DESTDIR)" ; then \ 8 + - for p in $(schemas_DATA) ; do \ 9 + - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \ 10 + - done \ 11 + - fi 12 + + if test -z "$(DESTDIR)" ; then \ 13 + + for p in $(schemas_DATA) ; do \ 14 + + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \ 15 + + done \ 16 + + fi 17 + else 18 + install-data-local: 19 + endif
+26
pkgs/development/libraries/libgksu/libgksu-2.0.12-notests.patch
··· 1 + Index: libgksu-2.0.12/libgksu/Makefile.am 2 + =================================================================== 3 + --- libgksu-2.0.12.orig/libgksu/Makefile.am 4 + +++ libgksu-2.0.12/libgksu/Makefile.am 5 + @@ -27,7 +27,7 @@ pkglib_PROGRAMS = gksu-run-helper 6 + gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0` 7 + gksu_run_helper_SOURCES = gksu-run-helper.c 8 + 9 + -noinst_PROGRAMS = test-gksu 10 + +EXTRA_PROGRAMS = test-gksu 11 + test_gksu_SOURCES = test-gksu.c 12 + test_gksu_LDADD = libgksu2.la 13 + test_gksu_LDFLAGS = `pkg-config --libs glib-2.0` 14 + Index: libgksu-2.0.12/libgksuui/Makefile.am 15 + =================================================================== 16 + --- libgksu-2.0.12.orig/libgksuui/Makefile.am 17 + +++ libgksu-2.0.12/libgksuui/Makefile.am 18 + @@ -9,7 +9,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c 19 + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h 20 + includedir = ${prefix}/include/$(PACKAGE) 21 + 22 + -noinst_PROGRAMS = test-gksuui 23 + +EXTRA_PROGRAMS = test-gksuui 24 + test_gksuui_SOURCES = test-gksuui.c 25 + test_gksuui_LDADD = libgksuui1.0.la 26 + test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0`
+359
pkgs/development/libraries/libgksu/libgksu-2.0.12-revert-forkpty.patch
··· 1 + diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN libgksu-2.0.12.orig/libgksu/libgksu.c libgksu-2.0.12/libgksu/libgksu.c 2 + --- libgksu-2.0.12.orig/libgksu/libgksu.c 2009-06-29 13:48:24.000000000 -0400 3 + +++ libgksu-2.0.12/libgksu/libgksu.c 2010-01-12 07:32:10.450657456 -0500 4 + @@ -1,7 +1,6 @@ 5 + /* 6 + * Gksu -- a library providing access to su functionality 7 + * Copyright (C) 2004-2009 Gustavo Noronha Silva 8 + - * Portions Copyright (C) 2009 VMware, Inc. 9 + * 10 + * This library is free software; you can redistribute it and/or 11 + * modify it under the terms of the GNU Lesser General Public 12 + @@ -56,9 +55,6 @@ 13 + static void 14 + gksu_context_launch_complete (GksuContext *context); 15 + 16 + -static void 17 + -read_line (int fd, gchar *buffer, int n); 18 + - 19 + GType 20 + gksu_error_get_type (void) 21 + { 22 + @@ -2009,8 +2005,6 @@ gksu_su_fuller (GksuContext *context, 23 + for (i = 0 ; cmd[i] != NULL ; i++) 24 + g_free (cmd[i]); 25 + g_free(cmd); 26 + - 27 + - _exit(1); 28 + } 29 + else if (pid == -1) 30 + { 31 + @@ -2125,10 +2119,10 @@ gksu_su_fuller (GksuContext *context, 32 + /* drop the \n echoed on password entry if su did request 33 + a password */ 34 + if (password_needed) 35 + - read_line (fdpty, buf, 255); 36 + + read (fdpty, buf, 255); 37 + if (context->debug) 38 + fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf); 39 + - read_line (fdpty, buf, 255); 40 + + read (fdpty, buf, 255); 41 + if (context->debug) 42 + fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf); 43 + } 44 + @@ -2142,9 +2136,7 @@ gksu_su_fuller (GksuContext *context, 45 + { 46 + int retval = 0; 47 + 48 + - /* Red Hat's su shows the full path to su in its error messages. */ 49 + - if (!strncmp (buf, "su:", 3) || 50 + - !strncmp (buf, "/bin/su:", 7)) 51 + + if (!strncmp (buf, "su", 2)) 52 + { 53 + gchar **strings; 54 + 55 + @@ -2155,11 +2147,7 @@ gksu_su_fuller (GksuContext *context, 56 + } 57 + 58 + strings = g_strsplit (buf, ":", 2); 59 + - 60 + - /* Red Hat and Fedora use 'incorrect password'. */ 61 + - if (strings[1] && 62 + - (g_str_has_prefix(strings[1], " Authentication failure") || 63 + - g_str_has_prefix(strings[1], " incorrect password"))) 64 + + if (strings[1] && !strncmp (strings[1], " Authentication failure", 23)) 65 + { 66 + if (used_gnome_keyring) 67 + g_set_error (error, gksu_quark, 68 + @@ -2473,12 +2461,6 @@ gksu_sudo_fuller (GksuContext *context, 69 + { 70 + char **cmd; 71 + char buffer[256] = {0}; 72 + - char *child_stderr = NULL; 73 + - /* This command is used to gain a token */ 74 + - char *const verifycmd[] = 75 + - { 76 + - "/usr/bin/sudo", "-p", "GNOME_SUDO_PASS", "-v", NULL 77 + - }; 78 + int argcount = 8; 79 + int i, j; 80 + 81 + @@ -2489,8 +2471,9 @@ gksu_sudo_fuller (GksuContext *context, 82 + 83 + pid_t pid; 84 + int status; 85 + - FILE *fdfile = NULL; 86 + - int fdpty = -1; 87 + + FILE *infile, *outfile; 88 + + int parent_pipe[2]; /* For talking to the parent */ 89 + + int child_pipe[2]; /* For talking to the child */ 90 + 91 + context->sudo_mode = TRUE; 92 + 93 + @@ -2565,10 +2548,6 @@ gksu_sudo_fuller (GksuContext *context, 94 + cmd[argcount] = g_strdup("-S"); 95 + argcount++; 96 + 97 + - /* Make sudo noninteractive (we should already have a token) */ 98 + - cmd[argcount] = g_strdup("-n"); 99 + - argcount++; 100 + - 101 + /* Make sudo use next arg as prompt */ 102 + cmd[argcount] = g_strdup("-p"); 103 + argcount++; 104 + @@ -2647,21 +2626,26 @@ gksu_sudo_fuller (GksuContext *context, 105 + fprintf (stderr, "cmd[%d]: %s\n", i, cmd[i]); 106 + } 107 + 108 + - pid = forkpty(&fdpty, NULL, NULL, NULL); 109 + - if (pid == 0) 110 + + if ((pipe(parent_pipe)) == -1) 111 + { 112 + - // Child 113 + - setsid(); // make us session leader 114 + - 115 + - execv(verifycmd[0], verifycmd); 116 + + g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, 117 + + _("Error creating pipe: %s"), 118 + + strerror(errno)); 119 + + sudo_reset_xauth (context, xauth, xauth_env); 120 + + return FALSE; 121 + + } 122 + 123 + - g_set_error (error, gksu_quark, GKSU_ERROR_EXEC, 124 + - _("Failed to exec new process: %s"), 125 + + if ((pipe(child_pipe)) == -1) 126 + + { 127 + + g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, 128 + + _("Error creating pipe: %s"), 129 + strerror(errno)); 130 + sudo_reset_xauth (context, xauth, xauth_env); 131 + return FALSE; 132 + } 133 + - else if (pid == -1) 134 + + 135 + + pid = fork(); 136 + + if (pid == -1) 137 + { 138 + g_set_error (error, gksu_quark, GKSU_ERROR_FORK, 139 + _("Failed to fork new process: %s"), 140 + @@ -2669,26 +2653,56 @@ gksu_sudo_fuller (GksuContext *context, 141 + sudo_reset_xauth (context, xauth, xauth_env); 142 + return FALSE; 143 + } 144 + + else if (pid == 0) 145 + + { 146 + + // Child 147 + + setsid(); // make us session leader 148 + + close(child_pipe[1]); 149 + + dup2(child_pipe[0], STDIN_FILENO); 150 + + dup2(parent_pipe[1], STDERR_FILENO); 151 + 152 + + execv(cmd[0], cmd); 153 + + 154 + + g_set_error (error, gksu_quark, GKSU_ERROR_EXEC, 155 + + _("Failed to exec new process: %s"), 156 + + strerror(errno)); 157 + + sudo_reset_xauth (context, xauth, xauth_env); 158 + + return FALSE; 159 + + } 160 + else 161 + { 162 + gint counter = 0; 163 + gchar *cmdline = NULL; 164 + - struct termios tio; 165 + 166 + // Parent 167 + - fdfile = fdopen(fdpty, "w+"); 168 + + close(parent_pipe[1]); 169 + 170 + - /* make sure we notice that ECHO is turned off, if it gets 171 + - turned off */ 172 + - tcgetattr (fdpty, &tio); 173 + - for (counter = 0; (tio.c_lflag & ECHO) && counter < 15; counter++) 174 + - { 175 + - usleep (1000); 176 + - tcgetattr (fdpty, &tio); 177 + - } 178 + + infile = fdopen(parent_pipe[0], "r"); 179 + + if (!infile) 180 + + { 181 + + g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, 182 + + _("Error opening pipe: %s"), 183 + + strerror(errno)); 184 + + sudo_reset_xauth (context, xauth, xauth_env); 185 + + return FALSE; 186 + + } 187 + 188 + - fcntl (fdpty, F_SETFL, O_NONBLOCK); 189 + + outfile = fdopen(child_pipe[1], "w"); 190 + + if (!outfile) 191 + + { 192 + + g_set_error (error, gksu_quark, GKSU_ERROR_PIPE, 193 + + _("Error opening pipe: %s"), 194 + + strerror(errno)); 195 + + sudo_reset_xauth (context, xauth, xauth_env); 196 + + return FALSE; 197 + + } 198 + + 199 + + /* 200 + + we are expecting to receive a GNOME_SUDO_PASS 201 + + if we don't there are two possibilities: an error 202 + + or a password is not needed 203 + + */ 204 + + fcntl (parent_pipe[0], F_SETFL, O_NONBLOCK); 205 + 206 + { /* no matter if we can read, since we're using 207 + O_NONBLOCK; this is just to avoid the prompt 208 + @@ -2697,11 +2711,11 @@ gksu_sudo_fuller (GksuContext *context, 209 + struct timeval tv; 210 + 211 + FD_ZERO(&rfds); 212 + - FD_SET(fdpty, &rfds); 213 + + FD_SET(parent_pipe[0], &rfds); 214 + tv.tv_sec = 1; 215 + tv.tv_usec = 0; 216 + 217 + - select (fdpty + 1, &rfds, NULL, NULL, &tv); 218 + + select (parent_pipe[0] + 1, &rfds, NULL, NULL, &tv); 219 + } 220 + 221 + /* Try hard to find the prompt; it may happen that we're 222 + @@ -2713,7 +2727,7 @@ gksu_sudo_fuller (GksuContext *context, 223 + if (strncmp (buffer, "GNOME_SUDO_PASS", 15) == 0) 224 + break; 225 + 226 + - read_line (fdpty, buffer, 256); 227 + + read_line (parent_pipe[0], buffer, 256); 228 + 229 + if (context->debug) 230 + fprintf (stderr, "buffer: -%s-\n", buffer); 231 + @@ -2747,17 +2761,18 @@ gksu_sudo_fuller (GksuContext *context, 232 + 233 + usleep (1000); 234 + 235 + - write (fdpty, password, strlen(password) + 1); 236 + - write (fdpty, "\n", 1); 237 + + fprintf (outfile, "%s\n", password); 238 + + fclose (outfile); 239 + 240 + nullify_password (password); 241 + 242 + - fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK); 243 + + /* turn NONBLOCK off */ 244 + + fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK); 245 + /* ignore the first newline that comes right after sudo receives 246 + the password */ 247 + - fgets (buffer, 255, fdfile); 248 + - /* this is the status we are interested in */ 249 + - fgets (buffer, 255, fdfile); 250 + + fgets (buffer, 255, infile); 251 + + /* this is the status we are interessted in */ 252 + + fgets (buffer, 255, infile); 253 + } 254 + else 255 + { 256 + @@ -2766,7 +2781,7 @@ gksu_sudo_fuller (GksuContext *context, 257 + fprintf (stderr, "No password prompt found; we'll assume we don't need a password.\n"); 258 + 259 + /* turn NONBLOCK off, also if have no prompt */ 260 + - fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK); 261 + + fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK); 262 + 263 + should_display = gconf_client_get_bool (context->gconf_client, 264 + BASE_PATH "display-no-pass-info", NULL); 265 + @@ -2785,9 +2800,14 @@ gksu_sudo_fuller (GksuContext *context, 266 + fprintf (stderr, "%s", buffer); 267 + } 268 + 269 + - if (g_str_has_prefix (buffer, "Sorry, try again.")) 270 + + if (!strcmp (buffer, "Sorry, try again.\n")) 271 + g_set_error (error, gksu_quark, GKSU_ERROR_WRONGPASS, 272 + _("Wrong password.")); 273 + + else if (!strncmp (buffer, "Sorry, user ", 12)) 274 + + g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED, 275 + + _("The underlying authorization mechanism (sudo) " 276 + + "does not allow you to run this program. Contact " 277 + + "the system administrator.")); 278 + else 279 + { 280 + gchar *haystack = buffer; 281 + @@ -2805,10 +2825,6 @@ gksu_sudo_fuller (GksuContext *context, 282 + } 283 + } 284 + 285 + - /* If we have an error, let's just stop sudo right there. */ 286 + - if (error) 287 + - close(fdpty); 288 + - 289 + cmdline = g_strdup("sudo"); 290 + /* wait for the child process to end or become something other 291 + than sudo */ 292 + @@ -2825,23 +2841,17 @@ gksu_sudo_fuller (GksuContext *context, 293 + if (context->sn_context) 294 + gksu_context_launch_complete (context); 295 + 296 + + while (read (parent_pipe[0], buffer, 255) > 0) 297 + + { 298 + + fprintf (stderr, "%s", buffer); 299 + + bzero(buffer, 256); 300 + + } 301 + + 302 + /* if the process is still active waitpid() on it */ 303 + if (pid_exited != pid) 304 + waitpid(pid, &status, 0); 305 + sudo_reset_xauth (context, xauth, xauth_env); 306 + 307 + - /* 308 + - * Did token acquisition succeed? If so, spawn sudo in 309 + - * non-interactive mode. It should either succeed or die 310 + - * immediately if you're not allowed to run the command. 311 + - */ 312 + - if (WEXITSTATUS(status) == 0) 313 + - { 314 + - g_spawn_sync(NULL, cmd, NULL, 0, NULL, NULL, 315 + - NULL, &child_stderr, &status, 316 + - error); 317 + - } 318 + - 319 + if (exit_status) 320 + { 321 + if (WIFEXITED(status)) { 322 + @@ -2853,13 +2863,6 @@ gksu_sudo_fuller (GksuContext *context, 323 + 324 + if (WEXITSTATUS(status)) 325 + { 326 + - if (g_str_has_prefix(child_stderr, "Sorry, user ")) 327 + - { 328 + - g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED, 329 + - _("The underlying authorization mechanism (sudo) " 330 + - "does not allow you to run this program. Contact " 331 + - "the system administrator.")); 332 + - } 333 + if(cmdline) 334 + { 335 + /* sudo already exec()ed something else, don't report 336 + @@ -2868,7 +2871,6 @@ gksu_sudo_fuller (GksuContext *context, 337 + if (!g_str_has_suffix (cmdline, "sudo")) 338 + { 339 + g_free (cmdline); 340 + - g_free (child_stderr); 341 + return FALSE; 342 + } 343 + g_free (cmdline); 344 + @@ -2881,11 +2883,11 @@ gksu_sudo_fuller (GksuContext *context, 345 + } 346 + } 347 + 348 + - fprintf(stderr, child_stderr); 349 + - g_free(child_stderr); 350 + - 351 + /* if error is set we have found an error condition */ 352 + - return (error == NULL); 353 + + if (error) 354 + + return FALSE; 355 + + 356 + + return TRUE; 357 + } 358 + 359 + /**
+76
pkgs/development/libraries/libgksu/libgksu-2.0.7-libs.patch
··· 1 + # https://savannah.nongnu.org/bugs/?25362 2 + # https://bugs.gentoo.org/show_bug.cgi?id=226837 3 + diff -Nura a/configure.ac b/configure.ac 4 + --- a/configure.ac 2009-01-19 22:15:30.000000000 +0100 5 + +++ b/configure.ac 2009-01-19 22:18:10.000000000 +0100 6 + @@ -43,6 +43,9 @@ 7 + PKG_CHECK_MODULES(LIBGKSU, [gtk+-2.0 >= 2.4.0, gconf-2.0, libstartup-notification-1.0, gnome-keyring-1, libgtop-2.0]) 8 + PKG_CHECK_MODULES(GKSU_PROPERTIES, [gtk+-2.0 >= 2.4.0, gconf-2.0, libglade-2.0]) 9 + 10 + +PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0]) 11 + +PKG_CHECK_MODULES(GTK, [gtk+-2.0 gconf-2.0]) 12 + + 13 + # Checks for library functions. 14 + ALL_LINGUAS="ca cs da de es eu fr hu it ko lt pl pt_BR ro ru sk sv nb nl zh_CN" 15 + 16 + diff -Nura a/gksu-properties/Makefile.am b/gksu-properties/Makefile.am 17 + --- a/gksu-properties/Makefile.am 2009-01-19 22:15:59.000000000 +0100 18 + +++ b/gksu-properties/Makefile.am 2009-01-19 22:19:13.000000000 +0100 19 + @@ -3,7 +3,7 @@ 20 + AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" -DDATA_DIR=\"$(datadir)\" -DPREFIX=\"$(prefix)\" 21 + 22 + bin_PROGRAMS = gksu-properties 23 + -gksu_properties_LDFLAGS = ${GKSU_PROPERTIES_LIBS} 24 + +gksu_properties_LDADD = ${GKSU_PROPERTIES_LIBS} 25 + gksu_properties_SOURCES = gksu-properties.c 26 + 27 + gladedir = ${prefix}/share/${PACKAGE} 28 + diff -Nura a/libgksu/Makefile.am b/libgksu/Makefile.am 29 + --- a/libgksu/Makefile.am 2009-01-19 22:15:59.000000000 +0100 30 + +++ b/libgksu/Makefile.am 2009-01-19 22:18:25.000000000 +0100 31 + @@ -8,8 +8,8 @@ 32 + # major -> breaks backward compatibility (changes to existing ABI) 33 + # minor -> keeps compatibility (additions to the API) 34 + # micro -> no change to the API/ABI 35 + -libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la 36 + -libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1 -lutil ${LIBGKSU_LIBS} 37 + +libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la -lutil ${LIBGKSU_LIBS} 38 + +libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1 39 + if USE_VERSION_SCRIPT 40 + libgksu2_la_LDFLAGS += -Wl,--version-script=libgksu.ver 41 + endif 42 + @@ -24,12 +24,11 @@ 43 + 44 + pkglibdir = ${libdir}/${PACKAGE} 45 + pkglib_PROGRAMS = gksu-run-helper 46 + -gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0` 47 + +gksu_run_helper_LDADD = ${GLIB_LIBS} 48 + gksu_run_helper_SOURCES = gksu-run-helper.c 49 + 50 + noinst_PROGRAMS = test-gksu 51 + test_gksu_SOURCES = test-gksu.c 52 + -test_gksu_LDADD = libgksu2.la 53 + -test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 54 + +test_gksu_LDADD = libgksu2.la ${GLIB_LIBS} 55 + 56 + EXTRA_DIST = libgksu.ver 57 + diff -Nura a/libgksuui/Makefile.am b/libgksuui/Makefile.am 58 + --- a/libgksuui/Makefile.am 2009-01-19 22:15:59.000000000 +0100 59 + +++ b/libgksuui/Makefile.am 2009-01-19 22:18:54.000000000 +0100 60 + @@ -4,12 +4,13 @@ 61 + 62 + noinst_LTLIBRARIES = libgksuui1.0.la 63 + libgksuui1_0_la_SOURCES = gksuui-dialog.c 64 + -libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-config --libs gtk+-2.0 gconf-2.0` 65 + +libgksuui1_0_la_LDFLAGS = -Wl,-O1 66 + +libgksuui1_0_la_LIBADD = ${GTK_LIBS} 67 + 68 + noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h 69 + includedir = ${prefix}/include/$(PACKAGE) 70 + 71 + noinst_PROGRAMS = test-gksuui 72 + test_gksuui_SOURCES = test-gksuui.c 73 + -test_gksuui_LDADD = libgksuui1.0.la 74 + -test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0` 75 + +test_gksuui_LDADD = libgksuui1.0.la ${GLIB_LIBS} 76 + +
+40
pkgs/development/libraries/libgksu/libgksu-2.0.7-polinguas.patch
··· 1 + # https://savannah.nongnu.org/bugs/?25360 2 + diff -Nura a/configure.ac b/configure.ac 3 + --- a/configure.ac 2009-01-19 21:50:57.000000000 +0100 4 + +++ b/configure.ac 2009-01-19 21:53:21.000000000 +0100 5 + @@ -50,7 +50,7 @@ 6 + GETTEXT_PACKAGE=AC_PACKAGE_NAME 7 + AC_SUBST(GETTEXT_PACKAGE) 8 + 9 + -IT_PROG_INTLTOOL 10 + +IT_PROG_INTLTOOL([0.35.5]) 11 + AM_GLIB_GNU_GETTEXT 12 + 13 + ################################################## 14 + diff -Nura a/po/LINGUAS b/po/LINGUAS 15 + --- a/po/LINGUAS 1970-01-01 01:00:00.000000000 +0100 16 + +++ b/po/LINGUAS 2009-01-19 21:54:24.000000000 +0100 17 + @@ -0,0 +1,23 @@ 18 + +# please keep this list sorted alphabetically 19 + +# http://live.gnome.org/GnomeGoals/PoLinguas 20 + +# 21 + +ca 22 + +cs 23 + +da 24 + +de 25 + +es 26 + +eu 27 + +fr 28 + +hu 29 + +it 30 + +ko 31 + +lt 32 + +pl 33 + +pt_BR 34 + +ro 35 + +ru 36 + +sk 37 + +sv 38 + +nb 39 + +nl 40 + +zh_CN
+4
pkgs/top-level/all-packages.nix
··· 5207 5207 5208 5208 libgdiplus = callPackage ../development/libraries/libgdiplus { }; 5209 5209 5210 + libgksu = callPackage ../development/libraries/libgksu { }; 5211 + 5210 5212 libgpgerror = callPackage ../development/libraries/libgpg-error { }; 5211 5213 5212 5214 libgphoto2 = callPackage ../development/libraries/libgphoto2 { }; ··· 8616 8618 fvwm = callPackage ../applications/window-managers/fvwm { }; 8617 8619 8618 8620 geany = callPackage ../applications/editors/geany { }; 8621 + 8622 + gksu = callPackage ../applications/misc/gksu { }; 8619 8623 8620 8624 gnuradio = callPackage ../applications/misc/gnuradio { 8621 8625 inherit (pythonPackages) lxml numpy scipy matplotlib pyopengl;