chiark / gitweb /
libudev: get rid of udev_sysfs.c
[elogind.git] / udev / udevd.c
index a24ca925172518efb9c61e4fff06300026317981..e88b11daa079a5ebe8a62591911810e2c6dd2582 100644 (file)
@@ -1,20 +1,19 @@
 /*
- * 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"
@@ -47,7 +46,6 @@
 
 #include "udev.h"
 #include "udev_rules.h"
-#include "udev_selinux.h"
 
 #define UDEVD_PRIORITY                 -4
 #define UDEV_PRIORITY                  -2
@@ -189,9 +187,9 @@ static void export_event_state(struct udevd_uevent_msg *msg, enum event_state st
                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) {
@@ -804,8 +802,6 @@ int main(int argc, char *argv[])
 
        logging_init("udevd");
        udev_set_log_fn(udev, log_fn);
-
-       selinux_init(udev);
        dbg(udev, "version %s\n", VERSION);
 
        while (1) {
@@ -1107,7 +1103,6 @@ int main(int argc, char *argv[])
 exit:
        udev_rules_cleanup(&rules);
        sysfs_cleanup();
-       selinux_exit(udev);
 
        if (signal_pipe[READ_END] >= 0)
                close(signal_pipe[READ_END]);