chiark / gitweb /
basic: fix touch() creating files with 07777 mode
authorMantas Mikulėnas <grawity@gmail.com>
Fri, 29 Jan 2016 21:36:08 +0000 (23:36 +0200)
committerSven Eden <yamakuzure@gmx.net>
Wed, 17 May 2017 13:22:15 +0000 (15:22 +0200)
commit66362c85779f341b661e45e90ea1ff26f04f1cf2
tree45b6d6f19c34cc09e5ca054335f069808a79d92b
parent9a690abcb2df47d950a321fb1b1de5d41ac797a9
basic: fix touch() creating files with 07777 mode

mode_t is unsigned, so MODE_INVALID < 0 can never be true.

This fixes a possible DoS where any user could fill /run by writing to
a world-writable /run/elogind/show-status.
src/basic/fs-util.c