chiark / gitweb /
mkdir: append _label to all mkdir() calls that explicitly set the selinux context
[elogind.git] / src / tty-ask-password-agent / tty-ask-password-agent.c
index 9fbd7f5fb2eda43c3ead712e2ea0bd8ad2ec45f2..7f537c27408a5692573a756c0a6e24c850859be6 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "util.h"
 #include "mkdir.h"
+#include "path-util.h"
 #include "conf-parser.h"
 #include "utmp-wtmp.h"
 #include "socket-util.h"
@@ -445,7 +446,7 @@ static int wall_tty_block(void) {
         if (asprintf(&p, "/run/systemd/ask-password-block/%u:%u", major(devnr), minor(devnr)) < 0)
                 return -ENOMEM;
 
-        mkdir_parents(p, 0700);
+        mkdir_parents_label(p, 0700);
         mkfifo(p, 0600);
 
         fd = open(p, O_RDONLY|O_CLOEXEC|O_NONBLOCK|O_NOCTTY);
@@ -569,7 +570,7 @@ static int watch_passwords(void) {
 
         tty_block_fd = wall_tty_block();
 
-        mkdir_p("/run/systemd/ask-password", 0755);
+        mkdir_p_label("/run/systemd/ask-password", 0755);
 
         if ((notify = inotify_init1(IN_CLOEXEC)) < 0) {
                 r = -errno;