sudo auth fails in terminal starting a process with &

Bug #104824 reported by ChrisMoultrie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-terminal (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This is on feisty fawn beta, Linux tebriel-laptop 2.6.20-14-powerpc #3 Mon Apr 2 17:15:34 UTC 2007 ppc GNU/Linux.
Steps:
1. Open a new, fresh terminal.
2. type in a command such as: "sudo nautilus &" (w/o quotes of course)
3. it asks for your password, but actually the cursor is on the next line and outputs your pass to screen. Even if you properly type in the password it breaks, terminal output shown below:

tebriel@tebriel-laptop:~$ sudo nautilus &
[1] 10539
tebriel@tebriel-laptop:~$ Password:
qwerty

[1]+ Stopped sudo nautilus
bash: qwerty: command not found

[1]+ Stopped sudo nautilus

although it assigns nautilus a process id: [1] 10539 nautilus does not start, i assume because i haven't authorized myself as su.

To work around:
1. sudo any command such as: "sudo ifconfig"
2. authenticate
3. type: "sudo nautilus &" and it works fine

this does not seem like a planned behavior, please ask me for any other information, I've confirmed that other people experience this bug as well.

Revision history for this message
jcfp (jcfp) wrote :

Thank you for your report. This problem is not a bug but user error. Sudo manual ("man sudo" in your terminal) will inform you that 'The -b (background) option tells sudo to run the given command in the background'. Using this option will ask for your password in the foreground, and then run the process ("nautilus" in your case) in the background and give you back your terminal.

Your method of using "&" puts the sudo process itself in the background, which makes it impossible to enter the password. It is sudo's pid that is printed; sudo then waits in the background for the password that never comes. Anything you type ("qwerty") next gets interpreted as a new command.

It is also no surprise that it works if you first properly use sudo for something else, since in that case, no password is required for some time after. Thus sudo can run succesfully without any user input.

Changed in gnome-terminal:
status: Unconfirmed → Rejected
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.