summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/db
diff options
context:
space:
mode:
authorderaadt <>2021-10-24 21:24:20 +0000
committerderaadt <>2021-10-24 21:24:20 +0000
commitcc848da117f06eb2ae32eaca4e146eb981a14d83 (patch)
treeff84c733b0f95e616f61320c664f8d9ca970aa16 /src/regress/lib/libc/db
parent86484520bb9fdf67e7e47b29f0fed6ff22b63378 (diff)
downloadopenbsd-cc848da117f06eb2ae32eaca4e146eb981a14d83.tar.gz
openbsd-cc848da117f06eb2ae32eaca4e146eb981a14d83.tar.bz2
openbsd-cc848da117f06eb2ae32eaca4e146eb981a14d83.zip
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 'src/regress/lib/libc/db')
-rw-r--r--src/regress/lib/libc/db/dbtest.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/regress/lib/libc/db/dbtest.c b/src/regress/lib/libc/db/dbtest.c
index 57bb900f7a..b520d8db72 100644
--- a/src/regress/lib/libc/db/dbtest.c
+++ b/src/regress/lib/libc/db/dbtest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dbtest.c,v 1.17 2020/02/14 19:17:33 schwarze Exp $ */ 1/* $OpenBSD: dbtest.c,v 1.18 2021/10/24 21:24:20 deraadt Exp $ */
2/* $NetBSD: dbtest.c,v 1.8 1996/05/03 21:57:48 cgd Exp $ */ 2/* $NetBSD: dbtest.c,v 1.8 1996/05/03 21:57:48 cgd Exp $ */
3 3
4/*- 4/*-
@@ -680,7 +680,7 @@ rfile(name, lenp)
680 for (; isspace((unsigned char)*name); ++name); 680 for (; isspace((unsigned char)*name); ++name);
681 if ((np = strchr(name, '\n')) != NULL) 681 if ((np = strchr(name, '\n')) != NULL)
682 *np = '\0'; 682 *np = '\0';
683 if ((fd = open(name, O_RDONLY, 0)) < 0 || 683 if ((fd = open(name, O_RDONLY)) < 0 ||
684 fstat(fd, &sb)) 684 fstat(fd, &sb))
685 dberr("%s: %s\n", name, strerror(errno)); 685 dberr("%s: %s\n", name, strerror(errno));
686 if (sb.st_size > (off_t)INT_MAX) 686 if (sb.st_size > (off_t)INT_MAX)