From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6362 invoked from network); 5 Nov 2021 17:04:43 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 5 Nov 2021 17:04:43 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id f5487667 for ; Fri, 5 Nov 2021 12:04:40 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 20889795 for ; Fri, 5 Nov 2021 12:04:40 -0500 (EST) Date: Fri, 5 Nov 2021 12:04:40 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: Commit and commit message by deraadt@: For open/openat, if the X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: Log Message: ----------- 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 Modified Files: -------------- mandoc: cgi.c mandocdb.c Revision Data ------------- Index: mandocdb.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/mandocdb.c,v retrieving revision 1.269 retrieving revision 1.270 diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.269 -r1.270 --- mandocdb.c +++ mandocdb.c @@ -532,6 +532,9 @@ out: mpages_free(); ohash_delete(&mpages); ohash_delete(&mlinks); +#if DEBUG_MEMORY + mandoc_d_finish(); +#endif return exitcode; usage: progname = getprogname(); @@ -2251,11 +2254,11 @@ dbwrite(struct dba *dba) say(tfn, "&dba_write"); goto err; } - if ((fd1 = open(MANDOC_DB, O_RDONLY, 0)) == -1) { + if ((fd1 = open(MANDOC_DB, O_RDONLY)) == -1) { say(MANDOC_DB, "&open"); goto err; } - if ((fd2 = open(tfn, O_RDONLY, 0)) == -1) { + if ((fd2 = open(tfn, O_RDONLY)) == -1) { say(tfn, "&open"); goto err; } Index: cgi.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/cgi.c,v retrieving revision 1.175 retrieving revision 1.176 diff -Lcgi.c -Lcgi.c -u -p -r1.175 -r1.176 --- cgi.c +++ cgi.c @@ -879,7 +879,7 @@ resp_format(const struct req *req, const int fd; int usepath; - if (-1 == (fd = open(file, O_RDONLY, 0))) { + if (-1 == (fd = open(file, O_RDONLY))) { puts("

You specified an invalid manual file.

"); return; } -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv