From 7581cd781c21940f22e0cebabc3a154bbde10751 Mon Sep 17 00:00:00 2001 From: jasper Date: Sat, 2 Feb 2008 20:42:04 +0000 Subject: [PATCH] roll in a diff to fix the xterm location. ok ajacoutot@ --- sysutils/libgksu/Makefile | 4 +-- .../libgksu/patches/patch-libgksu_libgksu_c | 26 +++++++++++--- .../libgksu/patches/patch-libgksu_test-gksu_c | 36 +++++++++++++++++++ 3 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 sysutils/libgksu/patches/patch-libgksu_test-gksu_c diff --git a/sysutils/libgksu/Makefile b/sysutils/libgksu/Makefile index 94516066579..5630e81c27c 100644 --- a/sysutils/libgksu/Makefile +++ b/sysutils/libgksu/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.2 2008/01/23 21:08:39 ajacoutot Exp $ +# $OpenBSD: Makefile,v 1.3 2008/02/02 20:42:04 jasper Exp $ COMMENT= library providing su and sudo functionality DISTNAME= libgksu-2.0.5 -PKGNAME= ${DISTNAME}p0 +PKGNAME= ${DISTNAME}p1 SHARED_LIBS= gksu2 0.0 # .0.1 CATEGORIES= sysutils diff --git a/sysutils/libgksu/patches/patch-libgksu_libgksu_c b/sysutils/libgksu/patches/patch-libgksu_libgksu_c index 52b925be0a0..87d4adbf4e0 100644 --- a/sysutils/libgksu/patches/patch-libgksu_libgksu_c +++ b/sysutils/libgksu/patches/patch-libgksu_libgksu_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-libgksu_libgksu_c,v 1.1.1.1 2008/01/17 18:45:56 jasper Exp $ +$OpenBSD: patch-libgksu_libgksu_c,v 1.2 2008/02/02 20:42:04 jasper Exp $ --- libgksu/libgksu.c.orig Sun Jun 10 20:28:43 2007 -+++ libgksu/libgksu.c Sat Dec 15 22:12:24 2007 ++++ libgksu/libgksu.c Thu Jan 31 20:57:44 2008 @@ -23,7 +23,12 @@ #include #include @@ -14,7 +14,25 @@ $OpenBSD: patch-libgksu_libgksu_c,v 1.1.1.1 2008/01/17 18:45:56 jasper Exp $ #include #include #include -@@ -1897,7 +1902,7 @@ gksu_su_full (GksuContext *context, +@@ -1081,6 +1086,7 @@ get_xauth_token (GksuContext *context, gchar *display) + FILE *xauth_output; + gchar *tmp = NULL; + gchar *xauth = g_new0 (gchar, 256); ++ size_t r; + + /* find out where the xauth binary is located */ + if (g_file_test ("/usr/bin/xauth", G_FILE_TEST_IS_EXECUTABLE)) +@@ -1108,7 +1114,8 @@ get_xauth_token (GksuContext *context, gchar *display) + strerror(errno)); + return NULL; + } +- fread (xauth, sizeof(char), 255, xauth_output); ++ r = fread (xauth, sizeof(char), 256, xauth_output); ++ xauth[r] = '\0'; + pclose (xauth_output); + g_free (tmp); + +@@ -1897,7 +1904,7 @@ gksu_su_full (GksuContext *context, gchar **cmd = g_malloc (sizeof(gchar*)*7); setsid(); // make us session leader @@ -23,7 +41,7 @@ $OpenBSD: patch-libgksu_libgksu_c,v 1.1.1.1 2008/01/17 18:45:56 jasper Exp $ if (context->login_shell) { cmd[i] = g_strdup ("-"); i++; -@@ -1919,7 +1924,7 @@ gksu_su_full (GksuContext *context, +@@ -1919,7 +1926,7 @@ gksu_su_full (GksuContext *context, if (execv (cmd[0], cmd) == -1) { fprintf (stderr, diff --git a/sysutils/libgksu/patches/patch-libgksu_test-gksu_c b/sysutils/libgksu/patches/patch-libgksu_test-gksu_c new file mode 100644 index 00000000000..59a53a423c1 --- /dev/null +++ b/sysutils/libgksu/patches/patch-libgksu_test-gksu_c @@ -0,0 +1,36 @@ +$OpenBSD: patch-libgksu_test-gksu_c,v 1.1 2008/02/02 20:42:04 jasper Exp $ +--- libgksu/test-gksu.c.orig Thu Jan 31 21:00:44 2008 ++++ libgksu/test-gksu.c Thu Jan 31 21:01:04 2008 +@@ -63,12 +63,12 @@ main (int argc, char **argv) + context = gksu_context_new (); + + context->debug = TRUE; +- context->command = g_strdup ("/usr/bin/xterm"); ++ context->command = g_strdup ("/usr/X11R6/bin/xterm"); + + if (try_su) + { + printf ("Testing gksu_su...\n"); +- gksu_su ("/usr/bin/xterm", &error); ++ gksu_su ("/usr/X11R6/bin/xterm", &error); + if (error) + fprintf (stderr, "gksu_su failed: %s\n", error->message); + +@@ -85,7 +85,7 @@ main (int argc, char **argv) + { + printf ("Testing gksu_sudo...\n"); + error = NULL; +- gksu_sudo ("/usr/bin/xterm", &error); ++ gksu_sudo ("/usr/X11R6/bin/xterm", &error); + if (error) + fprintf (stderr, "gksu_sudo failed: %s\n", error->message); + +@@ -103,7 +103,7 @@ main (int argc, char **argv) + { + printf ("Testing gksu_run...\n"); + error = NULL; +- gksu_run ("/usr/bin/xterm", &error); ++ gksu_run ("/usr/X11R6/bin/xterm", &error); + if (error) + fprintf (stderr, "gksu_run failed: %s\n", error->message); +