[OpenAFS] access control lists

Jeffrey Hutzelman jhutz@cmu.edu
Tue, 22 Aug 2006 15:37:21 -0400

On Monday, August 21, 2006 03:45:23 PM -0400 "Todd M. Lewis" 
<utoddl@email.unc.edu> wrote:

> Daniel Miller wrote:
>> Is there a way to do fs setacl recursively?
>> -Daniel
> Here's a recursive "fs sa" for afs using xargs:
>    find . -noleaf -type d -print0 | xargs -0 -n 2 fs sa -acl XX YY -dir
> A few things to notice:
> * -noleaf in AFS makes find do the Right Thing at the root of volumes.

This is specific to GNU find.  Other versions of find may or may not have 
this option, and may or may not include the optimization it disables. 
Recent versions of GNU find supposedly automatically discover when the 
optimization doesn't work, which would make the option obsolete.  However, 
I've still seen cases where it decides to use the optimization when it 

> * -print0 instead of -print makes find do the Right Thing wrt names with
> spaces and other weird characters that we normally eschew.
> * The "-0" makes xargs do the Right Thing wrt find's "-print0". (They
> were literally made for each other.)

These options are specific to the GNU versions of find and xargs, 
respectively.  What they do is make find separate filenames it outputs with 
NUL's rather than newlines, and make xargs expect that behavior.  If you 
don't have GNU find and xargs, you'll have to either hope that you don't 
have any filenames containing whitespace, or use one of the other tools 

> * The "2" after "-n" could be 20 or 50 or whatever. I made it small just
> to make sure it was doing the Right Thing in limiting the number of
> parameters it tried to do on each command.

Actually, you should be able to punt this entirely.  Without this switch, 
xargs will use as many parameters as it can fit, given the system's limits 
on the number of arguments and their total size.

-- Jeff