Re: sudo ignores child return code
Radovan Sroka <[email protected]>
| Newsgroups | gmane.comp.tools.sudo.devel |
|---|---|
| Message-ID | <[email protected]> |
What shell are you using? I'm using ZSH mostly. $ ./test.sh; echo $?; zsh: ./test.sh: bad interpreter: /bin/dsadas: no such file or directory 127 When I run this command via bash/sh result will be: $ sh|bash ./test.sh $ echo $? 0 But in this use case bash|sh will not exec our script just interpret it. "bash -c ./test.sh" exec it and will fail. So I still think that if sudo exec this script it should fail too. --------------------------------------------------------- Radovan Sroka Security Technologies | Red hat, Inc. ----- Original Message ----- From: "Todd C. Miller" <[email protected]> To: "Radovan Sroka" <[email protected]> Cc: [email protected] Sent: Tuesday, August 30, 2016 4:47:04 PM Subject: Re: [sudo-workers] sudo ignores child return code I don't think this is a bug, the shell behaves the same way: $ cat test.sh #/bin/asdsadsa #useless script $ ./test.sh; echo $? 0 If the interpreter is not found, the script is passed through sh. - todd ____________________________________________________________ sudo-workers mailing list <[email protected]> For list information, options, or to unsubscribe, visit: https://www.sudo.ws/mailman/listinfo/sudo-workers