libudev-selinux-private.c revision 6ada823a9a0979ea145fd70add1007c21caa45c0
/*
* libudev - interface to udev device information
*
* Copyright (C) 2008 Kay Sievers <kay.sievers@vrfy.org>
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
#include <unistd.h>
#include "libudev.h"
#include "libudev-private.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)
}
{
char filename[UTIL_PATH_SIZE];
if (!selinux_enabled)
return;
/* resolve relative filename */
if (file[0] != '/') {
char procfd[UTIL_PATH_SIZE];
char target[UTIL_PATH_SIZE];
return;
}
}