After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 346191 - gnome-system-tools hangs while polling /bin/su
gnome-system-tools hangs while polling /bin/su
Status: RESOLVED WONTFIX
Product: gnome-system-tools
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Carlos Garnacho
Carlos Garnacho
Depends on:
Blocks:
 
 
Reported: 2006-06-29 10:57 UTC by Daniel Drake
Modified: 2006-07-05 19:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.13/2.14


Attachments
Fix (2.47 KB, patch)
2006-06-29 10:59 UTC, Daniel Drake
none Details | Review

Description Daniel Drake 2006-06-29 10:57:40 UTC
All gnome-system-tools components fails on both of my systems, the windows open with all widgets inactive, and then just hang forever.

After investigating further, I have found that it is hanging in poll() while waiting for su to print the "Password:" prompt. My su definitely works from the console as normal.

My su writes the "Password:" prompt to /dev/tty (rather than the more usual /dev/stdout). It appears that things written to /dev/tty do not appear on the read end of the pipe used in gst-auth.c

The fix is quite simple: just access the pty fd directly, rather than using a pipe. The pty fd will see all output, including both stdout and /dev/tty.
Comment 1 Daniel Drake 2006-06-29 10:59:22 UTC
Created attachment 68158 [details] [review]
Fix

I can commit this if it is acceptable.
Comment 2 Carlos Garnacho 2006-07-05 17:38:13 UTC
I'm very sorry, this solution is very similar to the previous code, and backends communication has proven to be a really delicate piece of code. I don't feel like committing this to the stable branch (and potentially breaking what now works for the vast majority). Regarding the unstable branch, it now uses DBus as the communication layer, so it doesn't require forkpty() hacks.

Closing it as WONTFIX. I'm sorry
Comment 3 Daniel Drake 2006-07-05 17:47:45 UTC
I think you might have misunderstood the patch. It doesn't change the communication between backends, it just changes how data is passed to and from the pseudo-term where /bin/su is run for authentication. I don't see how calling /bin/su could be reimplemented with dbus?
Comment 4 Carlos Garnacho 2006-07-05 18:50:35 UTC
That's exactly what I'm afraid of, despending on the OS/distribution, there are different forkpty() implementations, different default terminal attributes and different su implementations out there, the piece of code you've modified has given me *lots* of headaches (some of them related to data loss, and hence configuration being modified/deleted without control, many others with similar symptoms to yours)

I may understand that you don't like this decision, but I don't want to put at those risks again the current stable branch, the current implementation works for most people, I'm sorry if it doesn't for you.

As for DBus, the backends are a system service, and privileges checking is done by PolicyKit. This brings heaps of immediate and non-immediate benefits (better error checking, bidirectional communication and many more)
Comment 5 Daniel Drake 2006-07-05 19:30:11 UTC
Ok, I'll upgrade to the CVS version and see if things work any better with the new stuff. Thanks for the explanation.