From 8b9626e525dd5ccb8a6820339ee84864a704d49b Mon Sep 17 00:00:00 2001 From: claudio Date: Thu, 3 Jun 2021 15:10:05 +0000 Subject: [PATCH] Use O_DIRECTORY when opening directories. This makes some errors a bit clearer when using -d. OK deraadt@ --- usr.sbin/rpki-client/main.c | 6 +++--- 1 file 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 * @@ -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) -- 2.20.1