<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>> Date: Wed, 25 Mar 2015 09:32:32 +0100<br>
> From: <a class="moz-txt-link-abbreviated" href="mailto:mgrepl@redhat.com">mgrepl@redhat.com</a><br>
> 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>
> Subject: Re: How do I create a directory in C that will
follow selinux file context rules?<br>
> <br>
> On 03/24/2015 10:45 PM, Jayson Hurst wrote:<br>
> > I need to create a directory in a C binary.<br>
> > <br>
> > I am currently doing something similar to this:<br>
> > <br>
> > <br>
> > <br>
> > status = mkdir("/home/cnd/mod1", S_IRWXU | S_IRWXG |
S_IROTH | S_IXOTH);<br>
> > <br>
> > <br>
> > <br>
> > But when the directory is created it ends up with
the wrong SELinux context. It inherits it's parent's context
and <br>
> > <br>
> > not the one defined in file context.<br>
> <br>
> What is your OS?<br>
> <br>
> > <br>
> > <br>
> > <br>
> > Is there a C call that can be used that understands
how to correctly create and label SElinux directories?<br>
> > <br>
> > <br>
> > <br>
> > --<br>
> > selinux mailing list<br>
> > <a class="moz-txt-link-abbreviated" href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a><br>
> >
<a class="moz-txt-link-freetext" href="https://admin.fedoraproject.org/mailman/listinfo/selinux">https://admin.fedoraproject.org/mailman/listinfo/selinux</a><br>
> > <br>
> <br>
> <br>
> -- <br>
> Miroslav Grepl<br>
> Software Engineering, SELinux Solutions<br>
> 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>