sux "cannot set terminal process group ...." error

Started by dibl, 2012/02/17, 22:35:57

Previous topic - Next topic

dibl

After d-u today, when you run "sux" in the terminal to become root, you can expect to see an error like this:

bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell



There is a bug report:  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=659878

The error does not prevent root from doing root work.
System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

devil


dibl

System76 Oryx Pro, Intel Core i7-11800H, ASRock B860 Pro-A, Intel Core Ultra 7 265KF, Nvidia GTX-1060, SSD 990 EVO Plus.

devil

The reason for this is to be found in the changelog of login:
Quote* New upstream release:
- su: Fix possible tty hijacking by dropping the controlling terminal when
executing a command (CVE-2005-4890). Closes: #628843

greetz
devil

braveheartleo

What is broken by the change, which is indicated by this message, is the ability to control foreground jobs (e.g., ctrl+c) from the terminal after logging in from sux.

su, gksu and others are not affected by the change, and can still control and terminate hang-up jobs running in the foreground by doing job control key combinations in the terminal.

To demonstrate:
$ su
Passsword: (enter root password)
# cat /dev/zero > /dev/null
(terminal hangs, ctrl+c to kill the job)

$ sux
Passsword: (enter root password)
# cat /dev/zero > /dev/null
(terminal hangs, ctrl+c ends the session with:
Session terminated, terminating shell...^C
but the job is left running. kill the job from another terminal)


quoted from here:
QuoteThis needs to be investigated further (in particular to check what sux is
doing, and whether this could be fixed on the sux side).
(The fix removes the controlling terminal for non-interactive executions)

anticapitalista