From 86257934b1ac9a26a9582544801528bc4b50fcb3 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 26 Feb 2018 07:50:18 -0500 Subject: [PATCH] Don't output anything in safe_open_ex when we ignore a symlink. --- src/apply-default-acl.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/apply-default-acl.c b/src/apply-default-acl.c index 8979d1c..45dfa56 100644 --- a/src/apply-default-acl.c +++ b/src/apply-default-acl.c @@ -51,6 +51,13 @@ int safe_open_ex(int at_fd, char* pathname, int flags) { openat() opens only the next directory (and doesn't recurse). */ *firstslash = '\0'; int fd = safe_open_ex(at_fd, pathname, flags); + if (fd == -1) { + if (errno != ELOOP) { + /* Don't output anything if we ignore a symlink */ + perror("safe_open_ex (safe_open_ex)"); + } + return -1; + } /* The ++ is safe because there needs to be at least a null byte after the first slash, even if it's the last real character in -- 2.44.2