udev_selinux.c revision 7744e869ecbfd2a508dbba46acfc2133a2f8f840
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <unistd.h>
#include "udev.h"
static int selinux_enabled;
{
/* record the present security context */
selinux_enabled = (is_selinux_enabled() > 0);
if (!selinux_enabled)
return;
if (getfscreatecon(&selinux_prev_scontext) < 0) {
}
}
{
if (!selinux_enabled)
return;
}
{
if (!selinux_enabled)
return;
return;
}
}
{
if (!selinux_enabled)
return;
return;
}
if (setfscreatecon(scontext) < 0)
}
{
if (!selinux_enabled)
return;
if (setfscreatecon(selinux_prev_scontext) < 0)
}