/*
- * Copyright (C) 2004-2006 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2004-2008 Kay Sievers <kay.sievers@vrfy.org>
* Copyright (C) 2004 Chris Friesen <chris_friesen@sympatico.ca>
*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the License.
+ * This program is free software: you can redistribute it and/or modify
+ * 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, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * 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 "config.h"
#include "udev.h"
#include "udev_rules.h"
-#include "udev_selinux.h"
#define UDEVD_PRIORITY -4
#define UDEV_PRIORITY -2
strlcat(filename_failed, "/", sizeof(filename_failed));
start = strlcat(filename_failed, ".udev/failed/", sizeof(filename_failed));
strlcat(filename_failed, msg->devpath, sizeof(filename_failed));
- path_encode(&filename_failed[start], sizeof(filename_failed) - start);
+ util_path_encode(&filename_failed[start], sizeof(filename_failed) - start);
switch (state) {
case EVENT_QUEUED:
unlink(filename_failed);
delete_path(msg->udev, filename_failed);
create_path(msg->udev, filename);
- selinux_setfscreatecon(msg->udev, filename, NULL, S_IFLNK);
+ udev_selinux_setfscreatecon(msg->udev, filename, S_IFLNK);
symlink(msg->devpath, filename);
- selinux_resetfscreatecon(msg->udev);
+ udev_selinux_resetfscreatecon(msg->udev);
break;
case EVENT_FINISHED:
if (msg->devpath_old != NULL) {
strlcat(filename_failed_old, "/", sizeof(filename_failed_old));
start = strlcat(filename_failed_old, ".udev/failed/", sizeof(filename_failed_old));
strlcat(filename_failed_old, msg->devpath_old, sizeof(filename_failed_old));
- path_encode(&filename_failed_old[start], sizeof(filename) - start);
+ util_path_encode(&filename_failed_old[start], sizeof(filename) - start);
if (rename(filename_failed_old, filename_failed) == 0)
info(msg->udev, "renamed devpath, moved failed state of '%s' to %s'\n",
logging_init("udevd");
udev_set_log_fn(udev, log_fn);
-
- selinux_init(udev);
dbg(udev, "version %s\n", VERSION);
while (1) {
exit:
udev_rules_cleanup(&rules);
sysfs_cleanup();
- selinux_exit(udev);
if (signal_pipe[READ_END] >= 0)
close(signal_pipe[READ_END]);