Sorry, just to clarify the main bit I missed out somehow, if I change Permissive to Disabled and don't touch the script, the script would still run fine without the exec format error.<br><br>
<div><span class="gmail_quote">On 10/4/06, <b class="gmail_sendername">Ian mu</b> <<a href="mailto:mu.llamas@gmail.com">mu.llamas@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hiya, I tried to replicate as much of it as I could on my home pc and hit a few problems I hadn't initially thought about with selinux (it's pretty much my first experience with it, so I may be barking up the wrong tree as some of the scripts aren't mine). I can't replicate to be 100% sure, but the problems extremely similar.
</div>
<div> </div>
<div>Basically to test, I used sudo (as quite a few of our scripts do) with permissive on. If a shell isn't specified in a script, test.sh is just something like echo "hello" with no #!/bin/bash at first (naturally sudoers file set up).
</div>
<div> </div>
<div>sudo -H -u ian ./test.sh this will return with "sesh: Error execing ./test.sh: Exec format error</div>
<div> </div>
<div>If I add #!/bin/bash to the start it will be fine.</div>
<div> </div>
<div>I'm assuming here, the problem is with sudo using sesh and interaction with selinux. I had assumed permissive on was purely logging only and no difference in execution other than that. I'm also assuming this is by design, and not a bug (as the problem likely wouldn't be there with better designed scripts).
</div>
<div> </div>
<div>Naturally some problems can be got around easily by just adding the shell, but there's a few where not so simple (original problem was with cron), so was looking for a quicker fix to temp get them working by turning permissive off.
</div>
<div> </div>
<div>Thanks, Ian</div>
<div><span class="e" id="q_10e130306ebb17e4_1">
<div> </div>
<div><br><br> </div>
<div><span class="gmail_quote">On 10/3/06, <b class="gmail_sendername">Karanbir Singh</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mail-lists@karan.org" target="_blank">mail-lists@karan.org
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Ian mu wrote:<br>> Hiya all,<br>><br>> After some problems the other day, I've tracked down a problem I've been
<br>> having fairly definitely to selinux being on in permissive mode.<br>> sestatus shows it enabled and permissive.<br><br>how did you track the problem down to being a SELinux in permissive mode ?<br><br>and no, afaik, you cant move from permissive to disabled, since selinux
<br>code comes down from kernelspace.<br><br>--<br>Karanbir Singh : <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.karan.org/" target="_blank">http://www.karan.org/</a> : 2522219@icq<br>_______________________________________________
<br>CentOS mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:CentOS@centos.org" target="_blank">CentOS@centos.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">
http://lists.centos.org/mailman/listinfo/centos</a><br></blockquote></div><br></span></div></blockquote></div><br>