OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-549-g20fcca2
Gerrit Code Review
gerrit@openafs.org
Tue, 4 Aug 2026 15:11:54 -0400
The following commit has been merged in the master branch:
commit 20fcca286c45d251bb6b830ebda4a8edcd37546e
Author: Marcio Barbosa <mbarbosa@sinenomine.net>
Date: Wed Jul 22 17:51:35 2026 +0000
fs: Preserve ACL modifiers across directories
The 'fs setacl' command accepts multiple directories via '-dir' and
applies the ACLs specified by '-acl' to each of them. However, since
support for relative ACL changes was added in commit 7d76a5b4f9e
(fs: add support for relative ACL changes), first included in OpenAFS
1.7.1, only the first directory is processed correctly when a relative
ACL modifier (+/-/=) is used.
The problem is that Convert() modifies the user-provided rights string
in place. After interpreting a relative modifier, it removes the
modifier character to simplify subsequent processing. Since the same
rights string is reused for each directory, the modifier is no longer
present when processing the remaining directories, causing the
operations to be treated as absolute ACL updates instead of relative
ones.
For example, the command:
$ fs setacl -dir dir1 dir2 dir3 -acl alice i+
correctly adds the 'i' right to the existing ACL on dir1, but replaces
alice's ACL with only 'i' on dir2 and dir3:
$ fs listacl ./dir1 ./dir2 ./dir3
Access list for ./dir1 is
Normal rights:
alice rl
Access list for ./dir2 is
Normal rights:
alice rl
Access list for ./dir3 is
Normal rights:
alice rl
$ fs setacl -dir ./dir1 ./dir2 ./dir3 -acl alice i+
$ fs listacl ./dir1 ./dir2 ./dir3
Access list for ./dir1 is
Normal rights:
alice rli
Access list for ./dir2 is
Normal rights:
alice i
Access list for ./dir3 is
Normal rights:
alice i
Fix this by making Convert() operate on a copy of the rights string
instead of modifying the caller's buffer. This preserves the original
user input so each directory is processed with the intended modifier.
As part of this, add 'goto success'-style cleanup to Convert().
Change-Id: Ie4e61c69774d7cdcff8dac7fa31d2905dd07d55d
Reviewed-on: https://gerrit.openafs.org/16899
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/venus/fs.c | 57 ++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 40 insertions(+), 17 deletions(-)
--
OpenAFS Master Repository