Project

General

Profile

Bug #12802

When /usr/bin/find should report errors when actl_get fails.

Added by Sanjay Nadkarni about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Due to #9952 (openzfs #8668) files or directories with corrupted ACLs can exist. When /usr/bin/find comes across it, does not report.
Here's a patch to fix it.

From c0c8be838cfe7f10641edf585d44b88af4497aa3 Mon Sep 17 00:00:00 2001
From: Gordon Ross <>
Date: Tue, 19 May 2020 10:25:00 -0400
Subject: [PATCH] Report errors when acl_get fails.

---
usr/src/cmd/find/find.c | 6 +++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/usr/src/cmd/find/find.c b/usr/src/cmd/find/find.c
index 8860e9b711..717a38470c 100644
--- a/usr/src/cmd/find/find.c
++ b/usr/src/cmd/find/find.c
@ -1098,8 +1098,12 @ execute(const char *name, const struct stat *statb, int type, struct FTW *state)
filename = (walkflags & FTW_CHDIR) ?
gettail(name) : name;
val = 0;
- if (acl_get(filename, 0, &acl) != 0)
if (acl_get(filename, 0, &acl) != 0) {
+ (void) fprintf(stderr,
+ gettext("%s: acl_get failed %s\n"),
+ filename, strerror(errno));
break;
+ }
for (i = 0, acl_entry = acl->acl_aclp;
i != acl->acl_cnt; i++) {
if (acl->acl_type == ACLENT_T) {
--
2.23.0

Also available in: Atom PDF