From 2012f8697caabceb3e45260367fe3524dba7015f Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 28 Aug 2015 14:09:30 +0200 Subject: nq: open dirfd with O_DIRECTORY to fail early --- nq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nq.c b/nq.c index a324bd3..04223bd 100644 --- a/nq.c +++ b/nq.c @@ -121,7 +121,7 @@ usage: } } - dirfd = open(path, O_RDONLY); + dirfd = open(path, O_RDONLY | O_DIRECTORY); if (dirfd < 0) { perror("dir open"); exit(111); -- cgit 1.4.1