Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2009 22:00:18 GMT
From:      john hood <jh@sandstorm.net>, sandstorm-ni@sandstorm.net
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/141149: gksu port hangs, never displays stdout or exits [libgksu bug + patch]
Message-ID:  <200912032200.nB3M0IKF074011@www.freebsd.org>
Resent-Message-ID: <200912032210.nB3MA1su030128@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         141149
>Category:       ports
>Synopsis:       gksu port hangs, never displays stdout or exits [libgksu bug + patch]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 03 22:10:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     john hood
>Release:        8.0-RELEASE
>Organization:
Sandstorm Enterprises
>Environment:
FreeBSD lister.sandstorm.net 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Tue Dec  1 20:49:34 EST 2009     jh@lister.sandstorm.net:/usr/src/sys/amd64/compile/NOCD  amd64

>Description:
our ancient 'gksu' port is broken-- it hangs after running the su/sudo command, and so output from the command never appears and gksu never exits.

the problem is twofold-- a bug in libgksu, which calls tcdrain() on the master side of a pty; and a bug in kernel, which hangs rather than returning an error on the tty ioctl.

patch against libgksu-1.3.8_3 attached.

(and yes, i know, this version of gksu is not worth spending much time on.)

kernel bug report coming soon.

>How-To-Repeat:
sudo pkg_add -r gksu
gdb gksu id
^C

>Fix:
patch attached, tested against libgksu-1.3.8_3 on 7.1 and 8.0-RELEASE


Patch attached with submission follows:

--- files/patch-libgksu_gksu-context.c.orig	2006-05-22 17:24:14.000000000 -0400
+++ files/patch-libgksu_gksu-context.c	2009-12-02 18:09:02.000000000 -0500
@@ -1,5 +1,5 @@
---- libgksu/gksu-context.c.orig	Mon May  1 01:08:30 2006
-+++ libgksu/gksu-context.c	Mon May 22 14:06:23 2006
+--- libgksu/gksu-context.c.orig	2006-04-30 17:08:30.000000000 -0400
++++ libgksu/gksu-context.c	2009-12-02 16:59:43.000000000 -0500
 @@ -23,9 +23,14 @@
  #include <unistd.h>
  #include <string.h>
@@ -80,7 +80,16 @@
  		   strerror(errno));
  	}
  
-@@ -1097,7 +1104,7 @@
+@@ -942,8 +949,6 @@
+ 	  write (fdpty, line, strlen(line));
+ 	  g_free (line);
+ 
+-	  tcdrain (fdpty);
+-
+ 	  bzero (buf, 256);
+ 	  read (fdpty, buf, 256);
+ 	}
+@@ -1097,7 +1102,7 @@
    argcount = 0;
  
    /* sudo binary */
@@ -89,7 +98,7 @@
    argcount++;
  
    /* Make sudo read from STDIN */
-@@ -1276,7 +1283,7 @@
+@@ -1276,7 +1281,7 @@
    argcount = 0;
  
    /* sudo binary */


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912032200.nB3M0IKF074011>