summaryrefslogtreecommitdiff
path: root/usr.sbin/rpki-client
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2021-06-03 15:10:06 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2021-06-03 15:10:06 +0000
commit32ce559d70818fde5df0f04bff70e1f414d8df1f (patch)
tree4f76a8167ff9388ef4b3c5565ba0bd7c8e550e62 /usr.sbin/rpki-client
parent06c144159174fa2c36b76bbac64ab9fc958509a9 (diff)
Use O_DIRECTORY when opening directories. This makes some errors a bit
clearer when using -d. OK deraadt@
Diffstat (limited to 'usr.sbin/rpki-client')
-rw-r--r--usr.sbin/rpki-client/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/rpki-client/main.c b/usr.sbin/rpki-client/main.c
index 40bb51d869c..41c04695a58 100644
--- a/usr.sbin/rpki-client/main.c
+++ b/usr.sbin/rpki-client/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.141 2021/05/11 11:48:02 claudio Exp $ */
+/* $OpenBSD: main.c,v 1.142 2021/06/03 15:10:05 claudio Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -701,9 +701,9 @@ main(int argc, char *argv[])
goto usage;
}
- if ((cachefd = open(cachedir, O_RDONLY, 0)) == -1)
+ if ((cachefd = open(cachedir, O_RDONLY | O_DIRECTORY, 0)) == -1)
err(1, "cache directory %s", cachedir);
- if ((outdirfd = open(outputdir, O_RDONLY, 0)) == -1)
+ if ((outdirfd = open(outputdir, O_RDONLY | O_DIRECTORY, 0)) == -1)
err(1, "output directory %s", outputdir);
if (outformats == 0)