]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r221012: sh: Check setuid()/setgid() return values.
authorjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 5 May 2011 22:07:02 +0000 (22:07 +0000)
committerjilles <jilles@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 5 May 2011 22:07:02 +0000 (22:07 +0000)
commit1faaf1052a17be9d51bd107a252e91d52d83e252
tree553927adf927e2521d741033b75cafb289791e08
parent2016f65d13faab2c955d73bc4b45793bbde19503
MFC r221012: sh: Check setuid()/setgid() return values.

If the -p option is turned off, privileges from a setuid or setgid binary
are dropped. Make sure to check if this succeeds. If it fails, this is an
error which will cause the shell to abort except in interactive mode or if
'command' was used to make 'set' or an outer 'eval' or '.' non-special.

Note that taking advantage of this feature and writing setuid shell scripts
seems unwise.

git-svn-id: svn://svn.freebsd.org/base/stable/8@221515 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
bin/sh/options.c