sudo-rs
sudo-rs copied to clipboard
sudo cannot set the foreground process group of the pseudoterminal
Describe the bug
Sudo is not able set the foreground process group of the pseudoterminal when the use_pty option is enabled.
To Reproduce Steps to reproduce the behavior:
- Compile 'sudo-rs' with the
devfeature enabled - Write a
/etc/sudoers.testfile with theDefaults use_ptyopttion. - Run the
sudo yes - Stop the command with
^Z - Resume the command with
fg - Terminate the command with
^C. - Check the
devlogs
development logs are enabled
sudo is runnning in the foreground
received command PID (334848) from monitor
monitor received SIGCHLD from 334848
command (334848) was stopped by SIGTSTP
command was stopped by SIGTSTP, suspending parent
parent is in foreground (cooked -> raw)
scheduling message with SIGCONT_FG for monitor
sending message Signal(SIGCONT_FG) to monitor over backchannel
sending SIGCONT_FG from parent to command
cannot set the foreground process group to command (334848): Inappropriate ioctl for device (os error 25)
monitor received SIGCHLD from 334848
monitor received SIGCHLD from 334848
command (334848) was terminated by SIGINT
cannot set foreground process group to monitor (334847): Inappropriate ioctl for device (os error 25)
command was terminated by SIGINT
Expected behavior Sudho should be able to set the foreground process group.
Environment (please complete the following information):
- Linux distribution: Arch Linux with kernel 6.3.8
sudo-rscommit hash: c49f6bf2699e9feb3d8e4414b7ef67008894d557