Para permissões tradicionais do Unix, há namei
:
$ namei -l ~/bin/git-resurrect
f: /home/grawity/bin/git-resurrect
drwxr-xr-x root root /
drwxr-xr-x root root home
drwxr-xr-x grawity grawity grawity
drwxr-xr-x grawity grawity bin
lrwxrwxrwx grawity grawity git-resurrect -> ../src/git/contrib/git-resurrect.sh
drwxr-xr-x grawity grawity ..
drwxrwxr-x grawity grawity src
drwxr-xr-x grawity grawity git
drwxr-xr-x grawity grawity contrib
-rwxr-xr-x grawity grawity git-resurrect.sh
Um programa semelhante para exibir também ACLs POSIX:
#!/usr/bin/env perl
sub follow {
my @items = split(m|/+|, shift);
my @paths = ();
my $path = "/";
while (defined(my $item = shift @items)) {
my $file = $path . ($path eq "/" ? "" : "/") . $item;
if (-l $file) {
my $target = readlink($file)
// die "Could not read link: $!\n";
unshift @items, split(m|/+|, $target);
push @paths, $file;
} else {
push @paths, $path = $file;
}
}
return @paths;
}
for my $file (@ARGV) {
system("getfacl", "-aPpt", $_) for follow($file);
}