From: Michael Orlitzky Date: Mon, 26 Feb 2018 12:50:18 +0000 (-0500) Subject: Don't output anything in safe_open_ex when we ignore a symlink. X-Git-Tag: v0.1.0~15 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=86257934b1ac9a26a9582544801528bc4b50fcb3;p=apply-default-acl.git Don't output anything in safe_open_ex when we ignore a symlink. --- 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