bf09b61a32
write(1) selects a wrong tty, because there is not a proper check of tty group ownership: $ write kzak write: kzak is logged in more than once; writing to tty7 write: /dev/tty7: Permission denied $ ls -la /dev/tty7 crw--w---- 1 root root 4, 7 2008-07-04 00:32 /dev/tty7 ^^^^ $ ls -la /usr/bin/write -rwxr-sr-x 1 root tty 11864 2008-04-02 16:24 /usr/bin/write ^ ^^^ We have to check for tty group owner, because we don't have permissions to write to arbitrary tty. Fixed version: $ write kzak write: kzak is logged in more than once; writing to pts/6 ^^^^ Message from test@nb on pts/7 at 15:22 ... ^C $ ls -la /dev/pts/6 crw--w---- 1 kzak tty 136, 6 2008-07-07 15:35 /dev/pts/6 ^^^ Addresses-Red-Hat-Bugzilla: #454252 Signed-off-by: Karel Zak <kzak@redhat.com> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile.am | ||
README.cal | ||
README.ddate | ||
README.flushb | ||
README.namei | ||
README.namei2 | ||
README.reset | ||
cal.1 | ||
cal.c | ||
chkdupexe.1 | ||
chkdupexe.pl | ||
ddate.1 | ||
ddate.c | ||
kill.1 | ||
kill.c | ||
kill.h | ||
logger.1 | ||
logger.c | ||
look.1 | ||
look.c | ||
mcookie.1 | ||
mcookie.c | ||
namei.1 | ||
namei.c | ||
procs.c | ||
rename.1 | ||
rename.c | ||
reset | ||
reset.1 | ||
reset.033c | ||
script.1 | ||
script.c | ||
scriptreplay.1 | ||
scriptreplay.c | ||
setterm.1 | ||
setterm.c | ||
whereis.1 | ||
whereis.c | ||
write.1 | ||
write.c |
README.reset
RedHat and SuSE take the program reset from ncurses, where reset is a name for the program tset. It is approximately equivalent to stty sane; tputs rs1; tputs rs2; tputs rf with `tputs rf' replaced by `tputs if' when there is an init_file but no reset_file. In the comments it wonders whether also sending rs3, rmacs, rmul, rmm might be a good idea. Slackware uses the small script given here. The part `echo -e \\033c' is the canonical reset of the kernel console status, and is equivalent to `tputs rs1' for a linux terminal. So, both versions are approximately the same. [A disadvantage of `echo -e \\033c' might be that it is potentially wrong on a non-vt100, non-xterm, non-linux terminal. An advantage is that there are terminfo entries for xterm around that only use rs1=^O as reset, and then \Ec is much better.]