Jan 4 2010

Finding Files with Applied ACL — RHEL 5

Following a discussion on Freenode’s #fedora, I set out to find a quick and easy way to find all files (or directories) that have a non-default ACL applied.

Fortunately, pylibacl exists!

Assuming you’ve installed pylibacl, you can now run a simple find command to locate your files:

# the new line is important, and so is the space before the print statement.
# it should work if pasted.
find . -type f -exec /usr/bin/python -c "import posix1e;
if posix1e.has_extended('{}'):
 print '{}'
" \;
# the new line is important, and so is the space before the print statement.
# it should work if pasted.
find . -type f -exec /usr/bin/python -tt -c “import posix1e;
if posix1e.has_extended(‘{}’):
print ‘{}’
” \;# the new line is important, and so is the space before the print statement.# it should work if pasted.