[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 79d28b8 2/3: Create /dev/tty because 'rinse'
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 79d28b8 2/3: Create /dev/tty because 'rinse' doesn't |
Date: |
Tue, 2 Jun 2020 17:13:11 -0400 (EDT) |
branch: master
commit 79d28b8e5305e6bbfd1a30328a929434b199d207
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Create /dev/tty because 'rinse' doesn't
Test case:
echo Hello >/dev/tty
Expected:
ls -l /dev/tty
crw-rw-rw- 1 root tty 5, 0 Jun 2 13:32 /dev/tty
Observed:
-rw-rw-r-- 1 root root 6 Jun 2 13:55 /dev/tty
because "Hello\n" contains six characters. Side effect: after root has
written to /dev/tty , normal users cannot. This goofy workaround:
echo Hello | sudo tee /dev/tty
yielded a return code of zero, so it "succeeded" in that sense, but it
didn't write anything to the TTY. Diagnosis: the special device didn't
exist, so writing to /dev/tty was like writing to /dev/xyzzy .
---
lmi_setup_05c.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lmi_setup_05c.sh b/lmi_setup_05c.sh
index 8a94bdc..e295548 100755
--- a/lmi_setup_05c.sh
+++ b/lmi_setup_05c.sh
@@ -35,6 +35,13 @@ assert_not_chrooted
[ -c /dev/null ] || ( rm /dev/null; mknod /dev/null c 1 3)
chmod 666 /dev/null
+
+# /dev/tty likewise:
+
+[ -c /dev/tty ] || ( rm /dev/tty ; mknod /dev/tty c 5 0)
+chmod 666 /dev/tty
+chown root:tty /dev/tty
+
[ -c /dev/ptmx ] || mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
[ -d /dev/pts ] || mkdir /dev/pts