]> git.ipfire.org Git - thirdparty/util-linux.git/commit
wall: do not use a temporary file.
authorKarel Zak <kzak@redhat.com>
Fri, 3 Apr 2015 09:44:24 +0000 (11:44 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 3 Apr 2015 09:44:24 +0000 (11:44 +0200)
commit890e103559ac89b7a0d7a7a71f198e138650ece1
tree1f1685530241a9d33aa023d260f7cac1e6778d81
parent398f7f9d99648d9c0fbc901f921d05aba9301a9a
wall: do not use a temporary file.

The issue with using a temporary file in wall is that wall runs as setgid.
This means that an unprivileged user who runs wall can modify wall's
temporary files, even if those are mode 0600, so the unprivileged user can
edit and effectively suppress the banner. The fix is to simply not use
temporary files.

[kzak@redhat.com: - rewrite growing string functions
                  - use struct buffer
                  - add buf_print() function]

Signed-off-by: Karel Zak <kzak@redhat.com>
Co-Author: Jann Horn <jann@thejh.net>
term-utils/wall.c