Bugzilla – Bug 722
Are there behavior changes for sudo-1.8.6p3-15.x86_64 (RHEL6.6) as compared to sudo-1.6.9p17-6?
Last modified: 2015-11-01 15:24:57 MST
We found that there is a behavioural changes in sudo-1.8.6p3-15.x86_64 (RHEL6.6) as compared to sudo-1.6.9p17-6 (RHEL 5.8). It has been observed if a script called through sudo, and if CtrlC (SIGINT) is sent to the foreground process, then the control returns to the parent process instead of terminal. Steps to Reproduce: We have executed below 2 scripts on RHEL5 and RHEL6.6 machine. parent.sh (Parent) #!/bin/bash sudo /root/child.sh echo "Parent Process" child.sh (Child) #!/bin/bash echo "hello" sleep 90 Expected results: Behaviour of this in RHEL5 (with sudo 1.6.9) Whenever we send SIGINT to the parent, the child as well as parent got killed and control returns to the terminal. # sh parent.sh hello ------> Ctrl+C pressed here ---> Both parent and child got killed. parent.sh(14867) -> child.sh(14869) -> sleep(14870) Actual results: In RHEL 6.6 (with sudo-1.8.6p3), if SIGINT is sent to efg.sh, only child process is getting killed and afterwards parent continues execution until it's graceful exit or again sending SIGINT by user. # sh parent.sh hello --------> Ctrl+C pressed here Parent Process --> Parent still exist, but child killed -------> Ctrl+C pressed here parent.sh(14867) -> sudo(14868) -> child.sh(14869) -> sleep(14870) Here, extra sudo process is generated in new sudo package but older package it is not created.
Could you please reply on urgently. 1. Is there any behavior changes done in upper package of sudo.1.6.9p17? 2. Is there any patch available for this issue, So that we can reverted older behavior? 3. What are changes done in later package of sudo? Is there any issue or bug fixed? Please share details of this changes.
The extra sudo process is there to clean up the PAM session when the command finishes and is needed for correct PAM session support. In sudo 1.8.8 and higher you can work around this with a line like the following in sudoers: Defaults !pam_session,!pam_setcred This will disable the PAM session support and there will not be an extra sudo process. If you are using the RedHat you can get the same effect with: Defaults cmnd_no_wait in sudoers.
Thanks Miller sir. Yes, it is working fine.
Created attachment 462 [details] Patch to make sudo kill itself with the same signal the command it runs dies from The attached patch, relative to sudo 1.8.15b4 should make sudo have the behavior that bash expects.
Fixed in sudo 1.8.15