From aaf323d45b5c2043acd64b7e6b8b1fea1664dd0b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 26 Feb 2018 17:36:24 -0500 Subject: [PATCH] libadacl: add error checking when we open() the filesystem root. --- src/libadacl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libadacl.c b/src/libadacl.c index d4e99aa..21b8141 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -160,6 +160,11 @@ int safe_open(const char* pathname, int flags) { } int fd = open("/", flags); + if (fd == OPEN_ERROR) { + perror("safe_open (open)"); + return OPEN_ERROR; + } + if (strcmp(abspath, "/") == 0) { return fd; } -- 2.44.2