From: Joshua Brindle <method@manicmethod.com>
To: hechao55429 <hechao55429@126.com>
Cc: selinux <selinux@tycho.nsa.gov>
Subject: Re: write selinux policy
Date: Sat, 16 May 2009 12:02:54 -0400 [thread overview]
Message-ID: <4A0EE3AE.7020509@manicmethod.com> (raw)
In-Reply-To: <17697801.901261242485650930.JavaMail.coremail@bj126app52.126.com>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=x-gbk; format=flowed, Size: 1361 bytes --]
hechao55429 wrote:
> 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(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?
you didn't specify a type transition from unconfined, you can do this in your
module using the unconfined_run_to() interface.
--
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.
next prev parent reply other threads:[~2009-05-16 16:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-16 14:54 write selinux policy hechao55429
2009-05-16 16:02 ` Joshua Brindle [this message]
2009-05-16 16:25 ` Dominick Grift
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A0EE3AE.7020509@manicmethod.com \
--to=method@manicmethod.com \
--cc=hechao55429@126.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.