code:
if z=`fsaclctl -p / 2>/dev/null`; then if grep -qs disabled <<< $z; \
then echo not enabled; else echo okay; fi; else echo not possible; fi
okay
It shouldn't happen, but sometimes ACLs get added where they don't belong: "
Visibility of files from other accounts".
By default (under 10.5.1 anyway), only(!) 38 folders have ACLs in any user's home hierarchy.
Of course, having
other ACLs on
other items isn't necessarily a bad thing... as long as
it's something either we -or some program we trust- did deliberately. The point here is:
while we can easily wipe out every last ACL in our home by running
chmod -R -N ~ ...
there is no easy way to *restore* the defaults, which should be there in the first place.
(Disk Utility's repair permissions won't do it). So, I've written and tested a script to help
in this regard...
code:
$ homeACLtool
Usage: /Users/halito/bin/homeACLtool -l | -c | -f | -R | -E | -D
-l list only those items in our home which come with ACLs by default.
-c check default items and list any whose ACL deviates from the norm.
-f find and list any *non*-default item with ACLs in our home folder.
-R find and Remove all ACLs in our home found on *non*-default items.
-E Erase **every** ACL entry within our entire home folder hierarchy.
-D set Default ACLs in our home on the Default items (ignore others).
N.B: This script manages ACLs only, not ownerships/permissions or flags.
For example,
homeACLtool -R will remove all ACLs in the home...
except the 38 that should
be there. If we want to see how many 'extra' ACLs are there (before removing them with -R),
we'd run
homeACLtool -f. Those two options (-f and -R) take care of (finding and removing) ACLs
on "
non-default" items.
As for the default ACL items, we can list them with
-l and check that they are all correct with
-c.
The
-D option will apply the default ACLs on the default items (while simultaneously ignoring all
other ACL items). Finally, the
-E option wipes out the whole kit-'n'-caboodle (a ls chmod -R -N).
If the reader is careful, the script could be customized. For example, adding a
~/Applications and/or a
~/bin directory to the "default" list. Or, possibly even extending the "
group:everyone
deny delete" default ACL. (The 'Drop Box' is in a class of its own, but also adjustable).
Disclaimer 1: if some program or person has added an 'inherited' entry further upstream (i.e. *above*
the user's home), its influence possibly won't be "corrected" by anything this script does. But that goes
beyond our scope here, which is simply to deal with restoring default settings *within* the user's home.
Disclaimer 2: though this script could be tweaked to play well with Tiger, I didn't put much effort toward
that end. Tiger lacks certain folders like ~/Downloads, as well as other default user ~/Library subfolders
(such as Compositions, Input Methods, etc). Thus, either those folders would need to be added on disk... or,
those items removed from this script (in $ACLfolders) to obviate error messages. Plus, the 'group:everyone'
part would need to be dealt with (one way or another), and on top of all that... ACLs are disabled by default
in Tiger (client). So this script is biased/optimized just as it should be (i.e., Leopard-only... unless edited).
Also note: as written, the script operates strictly upon the home (~) of the user logged into the shell.
Therefore, it might not be the most convenient tool for a lab manager who wants to set it loose on many
user accounts with one carriage return. Sorry... I think the script is long enough already, and I didn't
intended it for anything other than individual-user purposes. Feel free to hack my code here as you wish.
If it works out well, give me partial credit . . . if it doesn't, then I had nothing to do with it.

[Anyway,
special tools like that probably already exist, in server and/or workgroup manager.]
--
Basic shell-script rules apply here: make it executable with chmod a+x, and place it somewhere in your
$PATH (else, call the script by its full pathname... wherever that turns out to be). Give it any name you
like (as long as no name-collision results). We rarely have to type more than 2 or 3 chars anyway, since
tab-completion fills out the rest of the name. [i.e., just typing
ho<tab> should work for most users.]
Script appears in the next post...