sudo-rs icon indicating copy to clipboard operation
sudo-rs copied to clipboard

sudo cannot set the foreground process group of the pseudoterminal

Open pvdrz opened this issue 2 years ago • 0 comments

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:

  1. Compile 'sudo-rs' with the dev feature enabled
  2. Write a /etc/sudoers.test file with the Defaults use_pty opttion.
  3. Run the sudo yes
  4. Stop the command with ^Z
  5. Resume the command with fg
  6. Terminate the command with ^C.
  7. Check the dev logs
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-rs commit hash: c49f6bf2699e9feb3d8e4414b7ef67008894d557

pvdrz avatar Jun 27 '23 18:06 pvdrz