-
Bug
-
Resolution: Done-Errata
-
Normal
-
rhel-7.9, rhel-8.8.0, rhel-9.2.0
-
None
-
acl-2.2.53-3.el8
-
None
-
Low
-
sst_cs_plumbers
-
ssg_core_services
-
7
-
26
-
5
-
False
-
-
None
-
Red Hat Enterprise Linux
-
None
-
Approved Blocker
-
Pass
-
Automated
-
-
All
-
None
What were you trying to do that didn't work?
When setting an ACL for multiple files and some files do not exit, an error message shows up but rc code is still 0, which it should be 1.
This complicates automation and error handling.
Please provide the package NVR for which bug is seen:
All acl releases, including Upstream
How reproducible:
Always
Steps to reproduce
- Set an ACL on a file that doesn't exist and a file that does exist on some command
$ mkdir FOO $ setfacl -m d:g:rmetrich:rwX -m g:rmetrich:rwX ./FOO/bar ./FOO
Expected results
setfacl: ./FOO/bar: No such file or directory $ echo $? 1
Actual results
setfacl: ./FOO/bar: No such file or directory $ echo $? 0
The following patch fixes the issue:
diff -up acl-2.3.1/tools/setfacl.c.rhcase03610571 acl-2.3.1/tools/setfacl.c --- acl-2.3.1/tools/setfacl.c.rhcase03610571 2023-09-14 16:49:52.436561413 +0200 +++ acl-2.3.1/tools/setfacl.c 2023-09-14 17:08:07.448939043 +0200 @@ -555,7 +555,7 @@ int main(int argc, char *argv[]) goto synopsis; saw_files = 1; - status = next_file(optarg, seq); + status |= next_file(optarg, seq); break; case 'B': /* restore ACL backup */ @@ -642,7 +642,7 @@ int main(int argc, char *argv[]) goto synopsis; saw_files = 1; - status = next_file(argv[optind++], seq); + status |= next_file(argv[optind++], seq); } if (!saw_files) goto synopsis;
In a nutshell, the status of the previous files being processed has to be final status, not the status of the last file only.
- links to
-
RHBA-2023:122516 acl bug fix and enhancement update
- mentioned on