<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>RHEL 6.5<BR> <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: mgrepl@redhat.com<br>> To: swazup@hotmail.com; selinux@lists.fedoraproject.org<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>> > selinux@lists.fedoraproject.org<br>> > https://admin.fedoraproject.org/mailman/listinfo/selinux<br>> > <br>> <br>> <br>> -- <br>> Miroslav Grepl<br>> Software Engineering, SELinux Solutions<br>> Red Hat, Inc.<br></div>                                            </div></body>
</html>