Devan Goodwin wrote:
On Wed, 14 Jan 2009 12:13:20 +0100
Jan Pazdziora <jpazdzi...@redhat.com> wrote:
On Wed, Jan 14, 2009 at 10:36:37AM +0100, Jan Pazdziora wrote:
I propose to phase out
#!/usr/bin/env python
in favour of
#!/usr/bin/python
in our python scripts.
Speak now or forever hold your peace.
Note that we already use the second form 182 times in non-test
scripts, while we use env 63 times.
The current problem that I'm solving is that osa-dispatcher, when
started via /usr/bin/env, will search directories for python, which
generates SELinux AVC denials like
type=AVC msg=audit(1231924839.798:5971): avc: denied { search }
for pid=15336 comm="python" name="root" dev=dm-0 ino=784129
scontext=root:system_r:osa_dispatcher_t:s0
tcontext=root:object_r:user_home_dir_t:s0 tclass=dir
Actually, this AVC denial is about different problem. So it was not
a good example.
But nevertheless: shouldn't we decide for env or direct path in the
shebang line and be consistent about it?
+1. I'd go the other direction though and stick with "/usr/bin/env
python", iirc that's considered best practice to accommodate people
with Python installed in a weird location or using multiple versions.
Devan
I agree with Devan, and prefer the "env" usage.
_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel