]> err.no Git - systemd/commitdiff
main: make sure we don't accidentally acquire a controlling terminal
authorLennart Poettering <lennart@poettering.net>
Fri, 14 May 2010 02:36:24 +0000 (04:36 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 14 May 2010 02:36:24 +0000 (04:36 +0200)
main.c
manager.c

diff --git a/main.c b/main.c
index 6c730eb435ba4e7a567466ac291d835b5a35d15c..1f407dce214977b81465db106ab188351341b1ea 100644 (file)
--- a/main.c
+++ b/main.c
@@ -191,7 +191,7 @@ static int console_setup(bool do_reset) {
 
         release_terminal();
 
-        if ((tty_fd = open_terminal("/dev/console", O_WRONLY)) < 0) {
+        if ((tty_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY)) < 0) {
                 log_error("Failed to open /dev/console: %s", strerror(-tty_fd));
                 r = -tty_fd;
                 goto finish;
index 88dc64bb655771d56055fa8bf50d29d59b046c15..4cc7d30e24ef5732df9ad60822e6c11f9869aacf 100644 (file)
--- a/manager.c
+++ b/manager.c
@@ -68,7 +68,7 @@ static int enable_special_signals(Manager *m) {
         if (reboot(RB_DISABLE_CAD) < 0)
                 log_warning("Failed to enable ctrl-alt-del handling: %m");
 
-        if ((fd = open_terminal("/dev/tty0", O_RDWR)) < 0)
+        if ((fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY)) < 0)
                 log_warning("Failed to open /dev/tty0: %m");
         else {
                 /* Enable that we get SIGWINCH on kbrequest */