=== modified file 'dracut-module/password-agent.c' --- dracut-module/password-agent.c 2019-08-03 11:52:41 +0000 +++ dracut-module/password-agent.c 2019-08-03 12:27:14 +0000 @@ -83,7 +83,8 @@ #include /* munlock(), mlock() */ #include /* O_CLOEXEC, O_NONBLOCK, fcntl(), F_GETFD, F_GETFL, FD_CLOEXEC, - open(), O_WRONLY, O_RDONLY */ + open(), O_WRONLY, O_NOCTTY, + O_RDONLY */ #include /* waitpid(), WNOHANG, WIFEXITED(), WEXITSTATUS() */ #include /* PIPE_BUF, NAME_MAX, INT_MAX */ @@ -2224,7 +2225,8 @@ { __attribute__((cleanup(cleanup_close))) - const int devnull_fd = open("/dev/null", O_WRONLY | O_CLOEXEC); + const int devnull_fd = open("/dev/null", + O_WRONLY | O_CLOEXEC | O_NOCTTY); g_assert_cmpint(devnull_fd, >=, 0); __attribute__((cleanup(cleanup_close))) const int real_stderr_fd = dup(STDERR_FILENO); @@ -2254,7 +2256,7 @@ { __attribute__((cleanup(cleanup_close))) const int devnull_fd = open("/dev/null", - O_WRONLY | O_CLOEXEC); + O_WRONLY | O_CLOEXEC | O_NOCTTY); g_assert_cmpint(devnull_fd, >=, 0); __attribute__((cleanup(cleanup_close))) const int real_stderr_fd = dup(STDERR_FILENO); @@ -2905,7 +2907,7 @@ __attribute__((cleanup(cleanup_close))) const int devnull_fd = open("/dev/null", - O_WRONLY | O_CLOEXEC); + O_WRONLY | O_CLOEXEC | O_NOCTTY); g_assert_cmpint(devnull_fd, >=, 0); __attribute__((cleanup(cleanup_close))) const int real_stderr_fd = dup(STDERR_FILENO); @@ -2976,7 +2978,7 @@ __attribute__((cleanup(cleanup_close))) const int devnull_fd = open("/dev/null", - O_WRONLY | O_CLOEXEC); + O_WRONLY | O_CLOEXEC, O_NOCTTY); g_assert_cmpint(devnull_fd, >=, 0); __attribute__((cleanup(cleanup_close))) const int real_stderr_fd = dup(STDERR_FILENO); @@ -3020,7 +3022,8 @@ buffer password = {}; /* Reading /proc/self/mem from offset 0 will always give EIO */ - const int fd = open("/proc/self/mem", O_RDONLY | O_CLOEXEC); + const int fd = open("/proc/self/mem", + O_RDONLY | O_CLOEXEC | O_NOCTTY); bool password_is_read = false; bool quit_now = false; @@ -3934,7 +3937,8 @@ const mono_microsecs current_time = 0; /* Reading /proc/self/mem from offset 0 will always result in EIO */ - const int fd = open("/proc/self/mem", O_RDONLY | O_CLOEXEC); + const int fd = open("/proc/self/mem", + O_RDONLY | O_CLOEXEC | O_NOCTTY); bool quit_now = false; __attribute__((cleanup(cleanup_queue))) @@ -5625,7 +5629,8 @@ __attribute__((unused)) gconstpointer user_data){ __attribute__((cleanup(cleanup_close))) - const int epoll_fd = open("/dev/null", O_WRONLY | O_CLOEXEC); + const int epoll_fd = open("/dev/null", + O_WRONLY | O_CLOEXEC | O_NOCTTY); __attribute__((cleanup(cleanup_string))) char *const question_filename = strdup("/nonexistent/question"); g_assert_nonnull(question_filename); @@ -6035,7 +6040,8 @@ __attribute__((unused)) gconstpointer user_data){ __attribute__((cleanup(cleanup_close))) - const int epoll_fd = open("/dev/null", O_WRONLY | O_CLOEXEC); + const int epoll_fd = open("/dev/null", + O_WRONLY | O_CLOEXEC | O_NOCTTY); __attribute__((cleanup(cleanup_string))) char *const question_filename = strdup("/nonexistent/question"); g_assert_nonnull(question_filename); @@ -6304,7 +6310,8 @@ const char *const dirname){ __attribute__((cleanup(cleanup_close))) - const int devnull_fd = open("/dev/null", O_WRONLY | O_CLOEXEC); + const int devnull_fd = open("/dev/null", + O_WRONLY | O_CLOEXEC | O_NOCTTY); g_assert_cmpint(devnull_fd, >=, 0); __attribute__((cleanup(cleanup_close))) const int real_stderr_fd = dup(STDERR_FILENO);