From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from msux-gh1-uea01.nsa.gov (msux-gh1-uea01.nsa.gov [63.239.67.1]) by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id n4GEsSj6019389 for ; Sat, 16 May 2009 10:54:29 -0400 Received: from m15-52.126.com (localhost [127.0.0.1]) by msux-gh1-uea01.nsa.gov (8.12.10/8.12.10) with SMTP id n4GEsNnA004252 for ; Sat, 16 May 2009 14:54:24 GMT Date: Sat, 16 May 2009 22:54:10 +0800 (CST) From: hechao55429 To: selinux Message-ID: <17697801.901261242485650930.JavaMail.coremail@bj126app52.126.com> Subject: write selinux policy MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_239305_32157965.1242485650929" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov ------=_Part_239305_32157965.1242485650929 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit hello everyone: I'm now studying selinux policy on fedora 10 . I wrote a policy module like this: myapp.if ## this si to constraint gedit myapp.te policy_module(myapp,1.0.0) type myapp_t; # Access to shared libraries libs_use_ld_so(myapp_t) libs_use_shared_libs(myapp_t) miscfiles_read_localization(myapp_t) type myapp_exec_t; type myapp_rw_t; files_type(myapp_exec_t) files_type(myapp_rw_t) init_domain(myapp_t,myapp_exec_t) allow myapp_t myapp_rw_t :file ~{write}; myapp.fc /usr/bin/gedit -- gen_context(system_u:object_r:myapp_exec_t,s0) /root/share/a/as -- gen_context(system_u:object_r:myapp_rw_t,s0) Then i compiled it and it created myapp.pp with no error. And then i used the command that semodule -i myapp.pp and it succeeded. Then i relabeled the files by using the restorecon command and reboot . But after it reboot ,the /usr/bin/gedit still ran on the unconfined_t domain. why? ------=_Part_239305_32157965.1242485650929 Content-Type: text/html; charset=gbk Content-Transfer-Encoding: quoted-printable
hello everyone:
   I'm now studying selinux policy on fedora 10  . = ; I wrote a policy module like this:
        myapp.if
## <summary>this si to constraint gedit</summary>
        myapp.te
policy_module(m= yapp,1.0.0)
type myapp_t;
# Access to shared libraries
libs_use_ld_so(myapp_= t)
libs_use_shared_libs(myapp_t)
miscfiles_read_localization(myapp_t)
type myapp_exec_t;
type mya= pp_rw_t;
files_type(myapp_exec_t)
files_type(myapp_rw_t)
init_doma= in(myapp_t,myapp_exec_t)  
allow myapp_t myapp_rw_t :file ~{wr= ite};
  myapp.fc
/usr/bin/gedit -- gen_context(system_u:object_r:myapp_exec_t= ,s0)  
/root/share/a/as -- gen_context(system_u:object_r:myapp= _rw_t,s0)
Then i compiled it and it created myapp.pp with no error.
And then i used the command that semodule -i myapp.pp and it succeeded=
 Then i relabeled the files by using the restorecon com= mand and reboot .
But after it reboot ,the  /usr/bin/gedit  still  r= an on the unconfined_t domain.
why?


=B4=A9=D4=BD=B5=D8=D5=F0=B4=F8 =BC=CD=C4=EE=E3=EB=B4=A8=B5=D8=D5=F0= =D2=BB=D6=DC=C4=EA ------=_Part_239305_32157965.1242485650929-- -- 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.