I keep record of it :)<br><br>Thank you a lot !<br><br><div class="gmail_quote">2010/7/15 Stephen Smalley <span dir="ltr">&lt;<a href="mailto:sds@tycho.nsa.gov">sds@tycho.nsa.gov</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Thu, 2010-07-15 at 12:10 +0200, giovanni testing wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;ve fixed it (thanks to &quot;/sbin/ausearch -i | grep nano | grep avc&quot;),<br>
&gt; and the allow lines needed are:<br>
&gt;<br>
&gt; allow MyPolicy_t bin_t:file entrypoint;<br>
<br>
</div>This is fine for testing purposes, but for real use, you only want<br>
MyPolicy to have entrypoint permission to MyPolicy_exec_t, i.e. the<br>
MyPolicy_t domain can only be entered by executing a program labeled<br>
MyPolicy_exec_t.  This can be done using the domain_entry_file()<br>
interface.<br>
<div class="im"><br>
&gt; allow MyPolicy_t usr_t:file { read open };<br>
&gt;<br>
&gt; I think that the second one is not appropiated, because MyPolicy now<br>
&gt; can access to every &quot;usr_t&quot; file (but is only needed to access to<br>
&gt; &quot;/usr/share/terminfo/x/xterm&quot;).<br>
&gt;<br>
&gt; To fix that, I&#39;m thinking in a solution that I don&#39;t know if is<br>
&gt; possible: label the file &quot;/usr/share/terminfo/x/xterm&quot; with &quot;xterm_t&quot;<br>
&gt; instead of &quot;usr_t&quot;, but maybe it can block other applications to use<br>
&gt; &quot;/usr/share/terminfo/x/xterm&quot;, so the &quot;xterm_t&quot; needs to be equivalent<br>
&gt; to &quot;usr_t&quot;. To do it I&#39;m thinking to use an alias, but if is<br>
&gt; bidirectional it will be insecure again. As these lines can seem a bit<br>
&gt; confusing, there is a little scheme:<br>
&gt;<br>
&gt; I need:<br>
&gt; - &quot;MyPolicy_t&quot; can use &quot;xterm_t&quot;<br>
&gt; - &quot;MyPolicy_t&quot; cannot &quot;usr_t&quot;<br>
&gt; - Other policies continue being able to use<br>
&gt; &quot;/usr/share/terminfo/x/xterm&quot; while they allow use &quot;usr_t&quot; and they<br>
&gt; have not specified to allow &quot;xterm_t&quot;.<br>
&gt;<br>
&gt; So accessing to &quot;usr_t&quot; needs to be able to access to &quot;xterm_t&quot;, but<br>
&gt; accessing to &quot;xterm_t&quot; not needs to be able to access to &quot;usr_t&quot; (this<br>
&gt; is what I say that it not needs to be bidirectional). Maybe it can be<br>
&gt; done that way (putting the following lines instead the two before):<br>
&gt;<br>
&gt; allow MyPolicy_t bin_t:file entrypoint;<br>
&gt; allow usr_t xterm_t:file manage_file_perms;<br>
&gt; allow MyPolicy_t xterm_t:file { read open };<br>
<br>
</div>I would suggest introducing a generic terminfo_t type or similar for all<br>
of the files under /usr/share/terminfo, and then allowing most or all<br>
domains to read that type.  That would need to be upstreamed to the main<br>
policy as it modifies the type of a base system file.<br>
<br>
The second allow rule is not what you want, as it doesn&#39;t mean anything<br>
(no process runs in usr_t).  You could however do:<br>
allow domain terminfo_t:file read_file_perms;<br>
<font color="#888888"><br>
--<br>
</font><div><div></div><div class="h5">Stephen Smalley<br>
National Security Agency<br>
<br>
</div></div></blockquote></div><br>