util-linux/misc-utils
Karel Zak bf09b61a32 write: doesn't check for tty group
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>
2008-07-07 22:20:44 +02:00
..
.gitignore build-sys: update .gitignore files 2008-04-14 14:24:03 +02:00
Makefile.am scriptreplay: rewrite in C 2008-04-14 10:50:18 +02:00
README.cal Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00
README.ddate build-sys: fix README filenames and add missing files to EXTRA_DISTs 2007-02-08 12:38:25 +01:00
README.flushb build-sys: fix README filenames and add missing files to EXTRA_DISTs 2007-02-08 12:38:25 +01:00
README.namei Imported from util-linux-2.2 tarball. 2006-12-07 00:25:32 +01:00
README.namei2 build-sys: fix README filenames and add missing files to EXTRA_DISTs 2007-02-08 12:38:25 +01:00
README.reset build-sys: fix README filenames and add missing files to EXTRA_DISTs 2007-02-08 12:38:25 +01:00
cal.1 cal: add support for highlighting an arbitrary date 2007-10-11 14:19:39 +02:00
cal.c cal: use HAVE_LIB{NCURSES,NCURSESW} instead HAVE_NCURSES 2008-04-16 23:12:40 +02:00
chkdupexe.1 Imported from util-linux-2.5 tarball. 2006-12-07 00:25:33 +01:00
chkdupexe.pl Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
ddate.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
ddate.c ddate: 11th, 12th and 13th of month 2008-06-09 12:49:40 +02:00
kill.1 kill: man page is missing a description of "kill -0" 2008-01-28 15:17:45 +01:00
kill.c remove hardcoded package name from some utils 2007-07-27 12:12:00 +02:00
kill.h Imported from util-linux-2.10m tarball. 2006-12-07 00:25:43 +01:00
logger.1 manpage typos 2007-07-24 13:51:06 +02:00
logger.c logger: use snprintf instead of sprintf in logger.c 2007-07-24 00:22:20 +02:00
look.1 look: man page clarification 2007-07-25 18:03:52 +02:00
look.c build-sys: nls/locale handling in util-linux-ng general 2007-09-19 23:15:21 +02:00
mcookie.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
mcookie.c mcookie: remove non-linux code 2007-06-14 14:43:41 +02:00
namei.1 namei: add to identify FIFO (named pipe) and update manpage 2007-09-19 23:14:04 +02:00
namei.c namei: non-linux support (get_current_dir_name() and PATH_MAX) 2007-11-26 15:00:16 +01:00
procs.c Imported from util-linux-2.10s tarball. 2006-12-07 00:25:44 +01:00
rename.1 rename: add description about option -V to manpage 2007-09-05 11:51:35 +02:00
rename.c rename: remove useless variable 2007-09-05 11:51:11 +02:00
reset Imported from util-linux-2.13-pre1 tarball. 2006-12-07 00:26:54 +01:00
reset.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
reset.033c build-sys: fix README filenames and add missing files to EXTRA_DISTs 2007-02-08 12:38:25 +01:00
script.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
script.c script: read returns a size_t 2008-04-08 01:44:51 +02:00
scriptreplay.1 scriptreplay: rewrite in C 2008-04-14 10:50:18 +02:00
scriptreplay.c scriptreplay: gettextize a forgotten messages 2008-04-28 13:58:24 +02:00
setterm.1 setterm: add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN 2008-02-08 02:01:27 +01:00
setterm.c setterm: add -blan [force|poke] options for TIOCL_{BLANKED,BLANK}SCREEN 2008-02-08 02:01:27 +01:00
whereis.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
whereis.c whereis: add lib64 paths 2007-07-11 11:15:45 +02:00
write.1 man pages: add "AVAILABILITY" section 2007-07-03 01:17:04 +02:00
write.c write: doesn't check for tty group 2008-07-07 22:20:44 +02:00

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.]