race condition when sudo can not resolve hostname

Bug #237325 reported by Michael Vogt on 2008-06-04
36
Affects Status Importance Assigned to Milestone
libgksu (Ubuntu)
Undecided
Michael Vogt
Hardy
Undecided
Unassigned

Bug Description

Binary package hint: gksu

When sudo can not resolve the hostname there is a race condition that prevents gksu from detecting the password prompt.

TEST CASE:
1. install hardy
2. gedit /etc/hosts and remove the 127.0.0.1 line
3. run gksu id
4. press enter
5. run gksu id again
6. verify that it hangs

7. install the upate
8. repeat steps 3-5
9. verify that it no longer hangs

Martin Pitt (pitti) wrote :

Accepted into -proposed, please test and give feedback here

Changed in gksu:
status: New → Fix Committed

Before installing this update, any command called with gksu/gksudo would just hang without error message if /etc/hosts did not include my local machine name.
I've originally worked around the original bug (#55172) by modifying the first line of /etc/hosts so that i reads "127.0.0.1 localhost johndoe-desktop", where johndoe-desktop is my machine name.
Restoring the line to its original state brought the bug back, as expected.

After installing the proposed update, gksudo/gksu no longer hangs if my machine name is not included in /etc/hosts, so i would say that it works as intended.

Instead of using "gksu id", i used "gksu gedit" for testing.

P.S. There is something strange that i notice if i completely comment out my 127.0.0.1 line in /etc/hosts. Running gksu gedit still works and the gdit window appears as it should.
But upon closing of gksu gedit, the following message appears in my terminal:
    Usage:program_name [address][:port]Usage:program_name [address][:port]
Sometimes, this message is repeated several times.
This does not occur if the line is not commented out.

Martin Pitt (pitti) wrote :

Intrepid has a newer version, cannot copy hardy-proposed to intrepid. Michael, please fix this in intrepid ASAP.

Changed in libgksu:
assignee: nobody → mvo
milestone: none → intrepid-alpha-1
status: New → Fix Committed
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in libgksu:
status: Fix Committed → Fix Released
Michael Vogt (mvo) wrote :

Hm, this should have been autoclosed on June 04 by my intrepid upload, not sure why it was not.

Changed in libgksu:
status: Fix Committed → Fix Released
Leroy Wolins (corlee) wrote :

As you can tell from the attachment, I can't remove the the line.

Leroy Wolins (corlee) wrote :

Under the tuteledge of Thomas Kluyver, I executed the first 6 lines in "TEST CASE," above. It did not hang. I did not attempt to execute lines 7 through 9.

Michael Vogt (mvo) wrote :

@Leroy: Thanks for your test, I updated the text to explicitely mention that "gedit" instead of edit should be used.

description: updated
Leroy Wolins (corlee) wrote :

Despite the apparent success, the problems persists and there are more of them. For example, I can not remove any application, and , when composing an Email message using Evolution, I can type faster than the cursor moves -- I use two, maybe three, fingers. I suspect that the only solution is reinstall. However, I feel obliged to offer not to do this immediately so as not to waste your previous investments. But I am getting impatient. How about this? What are my obligations?

Leroy Wolins (corlee) wrote :

I'm still trying. To review a little bit: 1) The download arrow on the tool bar does not work. When I click on it the rotating ball rotates indefinitely. 2) apt-get update, does not work, but sudo synaptic --upgrade-mode, does work. I used this before but only installed the current updates. this time I selected "ALL". this resulted in the following message in the terminal.

lee@P5KU:~$ sudo synaptic --upgrade-mode
sudo: unable to resolve host P5KU

(synaptic:6644): Gtk-CRITICAL **: gtk_tree_view_unref_tree_helper: assertion `node != NULL' failed
lee@P5KU:~$

Thomas Kluyver (takluyver) wrote :

@Leroy: The thing about composing e-mail in Evolution is, as far as I can see, completely unrelated--try looking at other bug reports or forum posts to see if anyone else has experienced that.

Anything that would normally use gksudo--including the upgrade manager and synaptic being launched the normal way, will not work. You should still be able to run any of them (as a work-around) by using a command line and doing "sudo whatever", e.g. "sudo synaptic", "sudo update-manager".

"apt-get update", like any command that affects the system for all users, will need "sudo" before it. If "sudo apt-get update" isn't working, then that would be another problem...

It appears to me that there are too many things wrong with P5KU to make
it worthwhile for me -, or anyone else-, to spend more time trying to
fix it. I'm going to reinstall. I have done that often for Windows, and
it has usually solved the problems.

That machine is generally sluggish. If it were a windows machine, I
would us MSCONFIG and systematically remove applications from STARTUP. I
could also remove programs, something that no longer works on that
machine. I could even edit the registry. Here, I am shackled by
my ignorance.

Thanks for your help.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments