diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2021-11-05 17:04:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2021-11-05 17:04:10 +0000 |
commit | e04f502e6defd082a614c3caa038371f9e89720b (patch) | |
tree | 96580244e9ec32049d90bca666b66d638a69f4f5 /cgi.c | |
parent | bbb7c808baace31e8d9c9d3d9358470f23a6c851 (diff) | |
download | mandoc-e04f502e6defd082a614c3caa038371f9e89720b.tar.gz |
Commit and commit message by deraadt@:
For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant. Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk. They could all be 0xdeafbeef.
ok millert
Diffstat (limited to 'cgi.c')
-rw-r--r-- | cgi.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -879,7 +879,7 @@ resp_format(const struct req *req, const char *file) int fd; int usepath; - if (-1 == (fd = open(file, O_RDONLY, 0))) { + if (-1 == (fd = open(file, O_RDONLY))) { puts("<p>You specified an invalid manual file.</p>"); return; } |