summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-10-23 19:41:27 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-10-25 18:53:50 -0400
commita7a23d465df41d67197752675f53c4b59b660813 (patch)
treee0ccfac89f99b4d84740e44fb25e92f7f3e6267d /src/udev
parent9efbf32a55d250eb414289f40ea471e1473ddb16 (diff)
selinux: clean up selinux label function naming
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udev-node.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 8d5bada5a4..4ac6f71490 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -88,11 +88,11 @@ static int node_symlink(struct udev_device *dev, const char *node, const char *s
err = mkdir_parents_label(slink, 0755);
if (err != 0 && err != -ENOENT)
break;
- mac_selinux_context_set(slink, S_IFLNK);
+ mac_selinux_create_file_prepare(slink, S_IFLNK);
err = symlink(target, slink);
if (err != 0)
err = -errno;
- mac_selinux_context_clear();
+ mac_selinux_create_file_clear();
} while (err == -ENOENT);
if (err == 0)
goto exit;
@@ -105,11 +105,11 @@ static int node_symlink(struct udev_device *dev, const char *node, const char *s
err = mkdir_parents_label(slink_tmp, 0755);
if (err != 0 && err != -ENOENT)
break;
- mac_selinux_context_set(slink_tmp, S_IFLNK);
+ mac_selinux_create_file_prepare(slink_tmp, S_IFLNK);
err = symlink(target, slink_tmp);
if (err != 0)
err = -errno;
- mac_selinux_context_clear();
+ mac_selinux_create_file_clear();
} while (err == -ENOENT);
if (err != 0) {
log_error("symlink '%s' '%s' failed: %m", target, slink_tmp);
@@ -302,7 +302,8 @@ static int node_permissions_apply(struct udev_device *dev, bool apply,
if (streq(name, "selinux")) {
selinux = true;
- if (mac_selinux_apply(devnode, label) < 0)
+ r = mac_selinux_apply(devnode, label);
+ if (r < 0)
log_error("SECLABEL: failed to set SELinux label '%s': %s", label, strerror(-r));
else
log_debug("SECLABEL: set SELinux label '%s'", label);