<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Stuck in init_t</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><B><I><FONT COLOR="#008000" FACE="Arial">Classification: UNCLASSIFIED</FONT></I></B><I></I>
</P>

<P><FONT SIZE=2 FACE="Courier New">Hi,</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">I've got a small application that I'm trying to get running as a service on and FC8 SELinux box. I've got an entry in my inittab file to kick start the app, but all my attempts at writing an appropriate policy leaves that app running in the init_t domain.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New">The inittab file entry is:</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New"> cds:2345:respawn:/usr/bin/CDSserver -l -p 2732</FONT>

<BR><FONT SIZE=2 FACE="Courier New"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">ps -efZ (observing this as a 'root' user) gives:</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">system_u:system_r:init_t:s0 root 2663 1 0 10:01 ?  00:00:00 /usr/bin/CDSserver -l -p 2732</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">My .te file contains:</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   policy_module(cdsserver,1.0.3) </FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   ########################################</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   #</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   # Declarations</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   #</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   ########################################</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   # Type declarations</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   ###################</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   # the target domain:</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   type cds_t;</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   # Entrypoint for exec</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   type cds_exec_t;</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier New">   # domain type</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   #domain_type(cds_t)</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   # Mark cds_t as a domain and cds_exec_t as an entrypoint</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   init_daemon_domain(cds_t, cds_exec_t)</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   domain_entry_file(cds_t, cds_exec_t)</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   allow cds_t self:process execmem;</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   ...</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">My .fc file contains:</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   /usr/bin/CDSserver --   gen_context(system_u:object_r:cds_exec_t,s0)</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Courier New">My .if file contains:</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">   interface(`cds_domtrans',`</FONT>

<BR><FONT SIZE=2 FACE="Courier New">        gen_require(`</FONT>

<BR><FONT SIZE=2 FACE="Courier New">                type cds_t, cds_exec_t;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">        ')</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">        domain_auto_trans($1,cds_exec_t,cds_t)</FONT>

<BR><FONT SIZE=2 FACE="Courier New"> </FONT>

<BR><FONT SIZE=2 FACE="Courier New">        allow $1 cds_t:fd use;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">        allow cds_t $1:fd use;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">        allow cds_t $1:fifo_file rw_file_perms;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">        allow cds_t $1:process sigchld;</FONT>

<BR><FONT SIZE=2 FACE="Courier New">   ')</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">I've also tried putting init_t as $1 in the domain_auto_trans()</FONT>
</P>

<P><FONT SIZE=2 FACE="Courier New">Why isn't the process transitioning to cds_t? I've looked at a lot of sites and examples and can't seem to figure out my problem. The policy is the targeted FC8 policy. Module compiles and loads (semodule) fine.</FONT></P>

<P><FONT SIZE=2 FACE="Courier New"># sestatus</FONT>

<BR><FONT SIZE=2 FACE="Courier New">SELinux status:                 enabled</FONT>

<BR><FONT SIZE=2 FACE="Courier New">SELinuxfs mount:                /selinux</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Current mode:                   permissive</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Mode from config file:          permissive</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Policy version:                 21</FONT>

<BR><FONT SIZE=2 FACE="Courier New">Policy from config file:        targeted</FONT>

<BR><FONT SIZE=2 FACE="Courier New">  </FONT>

<BR><FONT SIZE=2 FACE="Courier New">Any ideas?</FONT>
</P>
<BR>

<P><I><FONT SIZE=2 FACE="Arial Black">Dario Sciola</FONT></I>
</P>

</BODY>
</HTML>