Received: from jazzdrum.ncsc.mil (zombie.ncsc.mil [144.51.88.131]) by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with SMTP id l2R0PCwv001364 for ; Mon, 26 Mar 2007 20:25:12 -0400 Received: from aston.electric.net (jazzdrum.ncsc.mil [144.51.5.7]) by jazzdrum.ncsc.mil (8.12.10/8.12.10) with ESMTP id l2R0PAok021519 for ; Tue, 27 Mar 2007 00:25:10 GMT Received: from root by aston.electric.net with emc1-ok (Exim 4.62) (envelope-from ) id 1HVzUs-0000Fd-Th for selinux@tycho.nsa.gov; Mon, 26 Mar 2007 17:25:10 -0700 Received: from [24.83.96.109] (helo=yonglaptop) by aston.electric.net with esmtpa (Exim 4.62) (envelope-from ) id 1HVzUr-0000FJ-To for selinux@tycho.nsa.gov; Mon, 26 Mar 2007 17:25:09 -0700 From: "Yong Lee" To: Subject: runcon problems Date: Mon, 26 Mar 2007 17:25:10 -0700 Message-ID: <012201c77006$615c44a0$aa5a0a0a@yonglaptop> MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_NextPart_000_0123_01C76FCB.B4FD6CA0" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov This is a multi-part message in MIME format. ------=_NextPart_000_0123_01C76FCB.B4FD6CA0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0124_01C76FCB.B4FD6CA0" ------=_NextPart_001_0124_01C76FCB.B4FD6CA0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi all, I'm rather new to selinux and was hoping that someone could help me with a problem I am having. I'm running on redhat WS 4 2.6.9-42. I'm trying to get a php based web application to make a system call to do a java compile. I was getting a bunch of avc issues trying to do this and rather than try to change the selinux policy I was hoping to make use of the runcon command to run a script which would do my java compile call. So I have a script that looks something like this : #!/bin/sh exec /usr/bin/java -jar $2 $3 $4 $5 and I'm trying to call it using a system call from php : /usr/bin/runcon /home/test/runjava a b c d denied { write } for pid=727 comm="runcon" name="exec" dev=proc ino=47644693 scontext=root:system_r:httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass=file when I edit my targeted policy and recompile to allow the write on exec, I get : Mar 26 16:54:14 localhost kernel: audit(1174953254.268:1216): avc: denied { setexec } for pid=1097 comm="runcon" scontext=root:system_r:httpd_sys_script_t tcontext=root:system_r:httpd_sys_script_t tclass=process I was going to add allow httpd_sys_script_t self:process setexec; to the policy rules but I'm thinking that this may not be a good idea and there must be a better way to get this done. I'm hoping that some of u gurus with a lot more experience in this area could help shed some light on the best way of allowing my php script to successfully call the java binary without making so many changes to the existing selinux policy. thanks, Yong. Yong Lee Developer ylee@EQO.com direct: +1.604.273.8173 x113 mobile: +1.604.418.4470 fax: +1.604.273.8172 web: www.EQO.com EQO ID: yonglee ------=_NextPart_001_0124_01C76FCB.B4FD6CA0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all,

 

I’m rather new to selinux and was hoping that = someone could help me with a problem I am having.  I’m running on = redhat WS 4 2.6.9-42.  I’m trying to get a php based web application to = make a system call to do a java compile.  I was getting a bunch of avc = issues trying to do this and rather than try to change the selinux policy I was = hoping to make use of the runcon command to run a script which would do my java compile call.

 

So I have a script that looks something like this = :

 

#!/bin/sh

 

exec /usr/bin/java –jar $2 $3 $4 = $5

 

 

and I’m trying to call it using a system call = from php :

 

/usr/bin/runcon /home/test/runjava a b c = d

 

denied  { write } for  pid=3D727 = comm=3D"runcon" name=3D"exec" dev=3Dproc ino=3D47644693 = scontext=3Droot:system_r:httpd_sys_script_t tcontext=3Droot:system_r:httpd_sys_script_t = tclass=3Dfile

 

when I edit my targeted policy and recompile to allow = the write on exec, I get :

 

Mar 26 16:54:14 localhost kernel: = audit(1174953254.268:1216): avc:  denied  { setexec } for  pid=3D1097 = comm=3D"runcon" scontext=3Droot:system_r:httpd_sys_script_t tcontext=3Droot:system_r:httpd_sys_script_t = tclass=3Dprocess

 

I was going to add

 

allow httpd_sys_script_t self:process = setexec;

 

to the policy rules but I’m thinking that this = may not be a good idea and there must be a better way to get this done.  = I’m hoping that some of u gurus with a lot more experience in this area = could help shed some light on the best way of allowing my php script to = successfully call the java binary without making so many changes to the existing selinux = policy.

 

thanks,

Yong.

 

 

Yong = Lee

Developer

ylee@EQO.com

= <= /p>

direct:      +1.604.273.8173 = x113

mobile:    +1.604.418.4470

fax:         = +1.604.273.8172

web:    = ;    www.EQO.com

EQO ID:   yonglee

 

 

------=_NextPart_001_0124_01C76FCB.B4FD6CA0-- ------=_NextPart_000_0123_01C76FCB.B4FD6CA0 Content-Type: image/jpeg; name="image001.jpg" Content-Transfer-Encoding: base64 Content-ID: /9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIf IiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7 Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozv/wAARCAA1AF8DASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE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D2G3XsbOkTiaSUqMLIqTqPTcOf1B/OtMVj6BEUE pBykapbqR0OxcEj/AIESPwrZFelRVoHn1fjFrN1Gxa4ZbiDAuIwVAb7sinqp9vfsa0qK0lFSVmQm 07o4gRXNhO39m3C2rMctZ3XygH/ZJ4I9xUst94gdNrvZ2ingyGQfpya6yWGKZds0SSL6MARUcen2 cLbo7WFW9QgBrl+rdE2l5PQ6vrHVxTfmjk49Jh+yPJLFdT7zua8AIKt6qvUr6mnJe63bxkW8ttqM aDIYN8+B6jg5rs8VRvNLtrzL7fKmBysyABlPrnv9DS+q8usHb0GsTfSauvM4y41D/hINTgtjdtFb OuWhAwysOo9yexojCROZtKnOnTg7Xt7g5ViO248Z+tad74ammuBJLaRzSA5FxbS+UxPqVPGfoat2 ul3b38Ms1sEVFImkkdWMy4wFKrweecn0rFUZtvm1d99b/edDrQSXLtbbS33GPJqXiMoVKWMQ/wCe vmLge/X+lGj6NcXV2brzmuLhuGvGB2Rjvsz95scZ6CuvGlWCvuWzgDeoiH+FW8ADHauhULtOTbsc zxOjUYpEVrbRWlukES7Y0GFFTUUtdSSSsjkbbd2FFFFMAooooAKKKKACiiigAooooAKKKKAP/9k= ------=_NextPart_000_0123_01C76FCB.B4FD6CA0-- -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.