]> git.ipfire.org Git - thirdparty/util-linux.git/commit
write: tell when effective gid and tty path group mismatch
authorSami Kerola <kerolasa@iki.fi>
Sat, 7 May 2016 22:44:17 +0000 (23:44 +0100)
committerSami Kerola <kerolasa@iki.fi>
Sun, 3 Jul 2016 22:35:09 +0000 (23:35 +0100)
commit50e417c8ad08e6a5d3c15adc39c16b6085b3cab6
treef2630eeb3b1c64b80faf70fa799a393c23645204
parent5592bf0d9aa71d617ae540071ef7d6a8b611449f
write: tell when effective gid and tty path group mismatch

Most commonly this error happens when write(1) executable does not have
correct group ownership and setgid bit.  The earlier message was unclear
what exactly was wrong.

$ mesg
is y
$ write testuser
write: you have write permission turned off

Alternatively the 'getegid() == s.st_gid' could be considered unnecessary.
Afterall if to write to destination tty is denied that does not go unnoticed
at thet time when tty is opened.

Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/write.c