chiark / gitweb /
util: always enforce O_NOCTTY and O_CLOEXEC in openpt_in_namespace()
[elogind.git] / src / basic / util.c
index 97a07b93c3139d4a2f88b1aa8baec75b376e0a9c..1b0f21604570421fc15e505262a41675cefdfb67 100644 (file)
@@ -6237,7 +6237,7 @@ int openpt_in_namespace(pid_t pid, int flags) {
                 if (r < 0)
                         _exit(EXIT_FAILURE);
 
-                master = posix_openpt(flags);
+                master = posix_openpt(flags|O_NOCTTY|O_CLOEXEC);
                 if (master < 0)
                         _exit(EXIT_FAILURE);