chiark / gitweb /
core: make systemd.confirm_spawn=1 actually work
[elogind.git] / src / tty-ask-password-agent / tty-ask-password-agent.c
index 9fbd7f5fb2eda43c3ead712e2ea0bd8ad2ec45f2..0dec0629c0012daa327549ad4b7192bfc707b9bd 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"
@@ -367,7 +368,7 @@ static int parse_password(const char *filename, char **wall) {
                         char *password;
 
                         if (arg_console)
-                                if ((tty_fd = acquire_terminal("/dev/console", false, false, false)) < 0) {
+                                if ((tty_fd = acquire_terminal("/dev/console", false, false, false, (usec_t) -1)) < 0) {
                                         r = tty_fd;
                                         goto finish;
                                 }
@@ -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;