summaryrefslogtreecommitdiff
path: root/udev_add.c
diff options
context:
space:
mode:
authorGreg KH <greg@press.(none)>2005-04-26 23:48:29 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 23:48:29 -0700
commit7eb92135c61af77fff62eec5f396b9633a54b245 (patch)
tree323b33417ced8d1215851282ba736a8489856cd2 /udev_add.c
parent237415b141ae2f3915160bc43ed76296588299f0 (diff)
more merge fixups, looks like i missed a selinux patch somewhere...
Diffstat (limited to 'udev_add.c')
-rw-r--r--udev_add.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/udev_add.c b/udev_add.c
index e5bd042a5c..eeab1ca174 100644
--- a/udev_add.c
+++ b/udev_add.c
@@ -83,7 +83,6 @@ create:
selinux_setfscreatecon(file, udev->kernel_name, mode);
retval = mknod(file, mode, devt);
- selinux_resetfscreatecon();
if (retval != 0) {
dbg("mknod(%s, %#o, %u, %u) failed with error '%s'",
file, mode, major(devt), minor(devt), strerror(errno));
@@ -197,7 +196,6 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de
/* create symlink(s) if requested */
foreach_strpart(udev->symlink, " ", pos, len) {
- int retval;
char linkname[NAME_SIZE];
char linktarget[NAME_SIZE];
@@ -229,11 +227,9 @@ static int create_node(struct udevice *udev, struct sysfs_class_device *class_de
dbg("symlink(%s, %s)", linktarget, filename);
if (!udev->test_run) {
- unlink(filename);
selinux_setfscreatecon(filename, udev->kernel_name, S_IFLNK);
- retval = symlink(linktarget, filename);
- selinux_resetfscreatecon();
- if (retval != 0)
+ unlink(filename);
+ if (symlink(linktarget, filename) != 0)
dbg("symlink(%s, %s) failed with error '%s'",
linktarget, filename, strerror(errno));
}
@@ -330,7 +326,7 @@ int udev_add_device(struct udevice *udev, struct sysfs_class_device *class_dev)
}
exit:
- selinux_exit();
+ selinux_restore();
return retval;
}