This is actually the code responsible:

@@ -686,12 +770,16 @@ static void open_tty(char *tty, struct termios *tp, 
struct options *op)
                log_err("%s: tcgetattr: %m", tty);
 
        /*
-        * Linux login(1) will change tty permissions. Use root owner and group
-        * with permission -rw------- for the period between getty and login.
+        * Detect if this is a virtual console or serial/modem line.
+        * In case of a virtual console the ioctl TIOCMGET fails and
+        * the error number will be set to EINVAL.
         */
-       ignore_result(chown(tty, 0, 0));
-       ignore_result(chmod(tty, 0600));
-       errno = 0;
+       if (ioctl(STDIN_FILENO, TIOCMGET, &serial) < 0 && (errno = EINVAL)) {
+               op->flags |= F_VCONSOLE;
+               if (!op->term)
+                       op->term = DEFAULT_VCTERM;
+       } else if (!op->term)
+               op->term = DEFAULT_STERM;
 
        setenv("TERM", op->term, 1);
 }

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/980835

Title:
  tty[1-6] is now root:tty 0660 instead of root:root 0600

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/980835/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to