<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    I'm afraid my solution will not work with RHEL 6.5. <br>
    We must come with some other solution. <br>
    <blockquote cite="mid:BLU181-W76A83F1A5F98D1F9FABADFD5080@phx.gbl"
      type="cite">
      <div dir="ltr"> <br>
        I have tried this using a filestran pattern but it doesn't seem
        to work.<br>
         <br>
        <div>&gt; Date: Wed, 25 Mar 2015 09:32:32 +0100<br>
          &gt; From: <a class="moz-txt-link-abbreviated" href="mailto:mgrepl@redhat.com">mgrepl@redhat.com</a><br>
          &gt; To: <a class="moz-txt-link-abbreviated" href="mailto:swazup@hotmail.com">swazup@hotmail.com</a>; <a class="moz-txt-link-abbreviated" href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a><br>
          &gt; Subject: Re: How do I create a directory in C that will
          follow selinux file context rules?<br>
          &gt; <br>
          &gt; On 03/24/2015 10:45 PM, Jayson Hurst wrote:<br>
          &gt; &gt; I need to create a directory in a C binary.<br>
          &gt; &gt; <br>
          &gt; &gt; I am currently doing something similar to this:<br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; status = mkdir("/home/cnd/mod1", S_IRWXU | S_IRWXG |
          S_IROTH | S_IXOTH);<br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; But when the directory is created it ends up with
          the wrong SELinux context. It inherits it's parent's context
          and <br>
          &gt; &gt; <br>
          &gt; &gt; not the one defined in file context.<br>
          &gt; <br>
          &gt; What is your OS?<br>
          &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; Is there a C call that can be used that understands
          how to correctly create and label SElinux directories?<br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; <br>
          &gt; &gt; --<br>
          &gt; &gt; selinux mailing list<br>
          &gt; &gt; <a class="moz-txt-link-abbreviated" href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a><br>
          &gt; &gt;
          <a class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/selinux">https://admin.fedoraproject.org/mailman/listinfo/selinux</a><br>
          &gt; &gt; <br>
          &gt; <br>
          &gt; <br>
          &gt; -- <br>
          &gt; Miroslav Grepl<br>
          &gt; Software Engineering, SELinux Solutions<br>
          &gt; Red Hat, Inc.<br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">--
selinux mailing list
<a class="moz-txt-link-abbreviated" href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a>
<a class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/selinux">https://admin.fedoraproject.org/mailman/listinfo/selinux</a></pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 

Thank you.

--
Lukas Vrabec
SELinux Solutions
Red Hat, Inc.</pre>
  </body>
</html>