Description of problem: I'm trying to set the security context of a program to be shell_exec_t, but this fails. Version-Release number of selected component (if applicable): policycoreutils=2.1.10-26.fc17.x86_64 How reproducible: 100% Steps to Reproduce: 1.create binary called /bin/esh 2./usr/sbin/semanage fcontext -a -t shell_exec_t /bin/esh 3./sbin/restorecon /bin/esh Actual results: ls -Z /bin/esh -rwxr-xr-x. root root system_u:object_r:bin_t:s0 /bin/esh Expected results: ls -Z /bin/esh -rwxr-xr-x. root root system_u:object_r:shell_exec_t:s0 /bin/esh Additional info: No errors are reported semanage -o - shows as last line: fcontext -a -f 'all files' -t shell_exec_t '/bin/esh' All commands were of course run as root.
Try /usr/sbin/semanage fcontext -a -t shell_exec_t /usr/bin/esh
This is weird. I didn't expect this to help since the path that is specified is not the path of the binary, but it did help: # ls -Z /bin/esh -rwxr-xr-x. root root system_u:object_r:bin_t:s0 /bin/esh # /usr/sbin/semanage fcontext -a -t shell_exec_t /usr/bin/esh # /usr/sbin/semanage -o - | grep esh fcontext -a -f 'all files' -t shell_exec_t '/bin/esh' fcontext -a -f 'all files' -t shell_exec_t '/usr/bin/esh' # /sbin/restorecon /bin/esh # ls -Z /bin/esh -rwxr-xr-x. root root system_u:object_r:shell_exec_t:s0 /bin/esh
/bin is a symbolic link to /usr/bin
But I take it esh should be labeled as a shell_exec_t?
(In reply to comment #3) > /bin is a symbolic link to /usr/bin That explains it! (In reply to comment #4) > But I take it esh should be labeled as a shell_exec_t? Not by Fedora. It's something of my own.
Well google actually says it exists as the "easy" shell. http://linux.about.com/cs/linux101/g/esh.htm