Devan Goodwin wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

Agree with Devan on this. "/usr/bin/env python" is more farsighted for users who have weird install locations. Else they i'll have to link /usr/bin/python each time they have new version. /usr/bin/env is more adaptable. I suggest changing the rest to this.

~ Prad

- -- Devan Goodwin <dgood...@redhat.com>
    Software Engineer                              Spacewalk / RHN
Satellite Halifax, Canada
650.567.9039x79267 "Coming back to Java after a few months off is like
a slap in the face."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAklt4UYACgkQAyHWaPV9my4/qACbBZ1YE/c9Vl0Xt4lxTR293Oth
cJgAnR3duyp7zEM02m64byk9vEfB6Uiq
=8N1T
-----END PGP SIGNATURE-----

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to