selinux not letting a "root preexec" samba script run

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Basically, this script is for creating a user's home directory, if it does not already exist. I found some Redhat documentation that says to put samba scripts (preexec, root preexec, etc) in /var/lib/samba/scripts/. This directory did not exist, so I created it and ran "sudo /sbin/restorecon -R -v /var/lib/samba/scripts" (as per the same documenation), and then copied my script in there.

The script does not run, but if I disable selinux and reboot, then the script does run. Any help?
 

hp660c

Member
Mar 11, 2001
68
0
0
Hi Brazen,
Check /var/log/audit/audit.log. It will give some hints as to why selinux is blocking it.

Also, run "sealert -a /var/log/audit/audit.log". This will process that file and present you some descriptions, recommendations, etc on how to fix the problem. You'll need the 'setroubleshoot' package.
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
Thanks, I disabled selinux for just samba (man page told me how) for the time being because I had to get this server in place, but I will check out your suggestions on a test machine.