source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: Commit and commit message by deraadt@:  For open/openat, if the
@ 2021-11-05 17:04 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2021-11-05 17:04 UTC (permalink / raw)
  To: source

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("<p>You specified an invalid manual file.</p>");
 		return;
 	}
--
 To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-05 17:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 17:04 mandoc: Commit and commit message by deraadt@: For open/openat, if the schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).