[system-tools] g-s-t 1.2.0 does not work on FreeBSD



In a nutshell, it hangs. It really depends on the FreeBSD version as to where it hangs. On 5.X and 6.X, it will hand after authenticating the user. Basically, since gst-auth.c closes stderr, this causes su to SIGSTOP the tool's backend process, and thus gst-tool.c gets stuck in an infinite poll() loop.

On FreeBSD 4.X, the user never sees the authentication dialog. If the tool is run as root, everything seems to work, but hangs when quitting. I added some debugging, and found that under 4.X, g-s-t never reads anything from the backend su process. That is, it never sees the "Password:" prompt, and thus hangs in a poll() loop forever.

Everything used to work on all versions before the switch to use pipes. Attached are patches that get the tools working under 5.X and 6.X again, but I'd like to know if there's anything I should be looking at for the 4.X problems (i.e. the hang when run as non-root, and the hang on exit). What would be lost if g-s-t reverted to the old master file descriptor on FreeBSD only? Thanks.

Joe

--
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome FreeBSD org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome
--- src/common/gst-tool.c.orig	Thu Mar 10 14:39:54 2005
+++ src/common/gst-tool.c	Thu Mar 10 14:40:00 2005
@@ -1653,7 +1653,7 @@ poll_backend (GstTool *tool)
 	struct pollfd fd;
 
 	fd.fd = tool->read_fd;
-	fd.events = POLLIN || POLLPRI;
+	fd.events = POLLIN | POLLPRI;
 
 	while (poll (&fd, 1, 100) <= 0) {
 		while (gtk_events_pending ())
--- src/common/gst-auth.c.orig	Thu Mar 10 14:39:18 2005
+++ src/common/gst-auth.c	Thu Mar 10 14:39:50 2005
@@ -142,12 +142,12 @@ gst_auth_run_term (GstTool *tool, gchar 
 		unsetenv("LANG");
 		unsetenv("LANGUAGE");
 
-		dup2 (p[1], 1);
-		dup2 (p[1], 2);
+		dup2 (p[1], STDOUT_FILENO);
+		/*dup2 (p[1], 2);*/
 		close (p[0]);
 
 		execv (args[0], args);
-		exit (255);
+		_exit (255);
 	} else {
 #ifndef __FreeBSD__
 		/* Linux's su works ok with echo disabling */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]