ports/sysutils/libgksu/files/patch-libgksu_libgksu.c
Ben Woods 1747513894 sysutils/gksu and sysutils/libgksu: Fix gksudo not running command
This fixes an issue where gksudo would successfully authenticate
the user, but fail to run the requested command. This was caused by
gksudo forking a new PTY, meaning that different TTY was used for the
"sudo -v" command and subsequent "sudo -n ..." command. Whilst this used
to work, newer versions of sudo used per TTY authentication caching.
Patch taken from Arch Linux: https://aur.archlinux.org/packages/libgksu/

Also fixed:
- Made Nautilus plugin optional, so gksu can be installed without GNOME
- Added license details, pet portlint
- Tidied patches: move path fixes into port Makefile
2018-07-01 15:15:34 +00:00

28 lines
655 B
C

--- libgksu/libgksu.c.orig 2009-03-04 18:53:02.000000000 +0000
+++ libgksu/libgksu.c 2011-04-12 16:45:53.000000000 +0000
@@ -23,13 +23,15 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
-#include <pty.h>
#include <pwd.h>
+#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/select.h>
#include <errno.h>
+#include <termios.h>
+#include <libutil.h>
#include <glibtop.h>
#include <glibtop/procstate.h>
@@ -2190,8 +2192,6 @@
write (fdpty, line, strlen(line));
g_free (line);
- tcdrain (fdpty);
-
bzero (buf, 256);
read (fdpty, buf, 255);