I was attempting to compile patched fileutils 4.1.8 for acl
compatibility and finally got it working, except ls -l shows a + for
all files/dirs on acl capable filesystems.
afaict it uses the libacl function acl_extended_file() to check
whether a file/dir has an actual acl associated, it appears to use
this function correctly so i wrote a test program and found this
function appears to be lying:
eb@dogbert ~$ getfacl /etc/passwd
getfacl: Removing leading '/' from absolute path names
# file: etc/passwd
# owner: root
# group: root
user::rw-
group::r--
other::r--
eb@dogbert ~$ getfattr -m . /etc/passwd
eb@dogbert ~$ ./ckacl /etc/passwd
acl_extended_file returned 1
errno: Success
eb@dogbert ~$ src/fileutils/fileutils-4.1.8acl/src/ls -l /etc/passwd
-rw-r--r--+ 1 root root 1408 05-23 04:36 /etc/passwd
eb@dogbert ~$
am i missing something? the way i read the man page it should return 0:
The acl_extended_file() function returns 1 if the file or directory
referred to by the argument path_p is associated with an extended access
ACL, or if the directory referred to by path_p is associated with a
default ACL. The function returns 0 if the file has neither an extended
access ACL nor a default ACL.
eb@dogbert ~$ dpkg -s libattr1 | grep ^Ver
Version: 2.0.8-1
here is my simple test program:
#include <stdio.h>
#include <acl/libacl.h>
#include <errno.h>
int main(int argc, char **argv)
{
int ret;
errno = 0;
if (argc == 2) {
ret = acl_extended_file(argv[1]);
printf("acl_extended_file returned %d\n", ret);
perror("errno");
return ret;
}
else {
printf("usage: ckacl filename\n");
return 1;
}
}
--
Ethan Benson
http://www.alaska.net/~erbenson/
pgpGOlWiIZ2zm.pgp
Description: PGP signature
|