GNOME Bugzilla – Bug 511195
POSIX ACL detection broken
Last modified: 2018-08-17 13:52:26 UTC
On OS X 10.4, a platform that does have ACL support, configure reports: checking for acl_get_file in -lacl... no checking for acl in -lsec... no checking for Solaris ACL... no checking for POSIX ACL... no and config.log is: configure:37252: checking for POSIX ACL configure:37282: gcc -std=gnu99 -o conftest -Os -fno-common -I/sw/include -no-cpp-precomp -lresolv -L/sw/lib -flat_namespace conftest.c -lacl >&5 /usr/libexec/gcc/powerpc-apple-darwin8/4.0.1/ld: can't locate file for: -lacl collect2: ld returned 1 exit status configure:37288: $? = 1 So the test is failing for a reason unrelated to the feature it's supposed to be testing. I indeed do not have libacl, but instead have ACL implemented in the sytem library itself, and I think it's POSIX-compliant. So the -lacl test is failing correctly, but the POSIX ACL test should succeed. The bug is in configure.in: AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"]) # [skip a few lines] AC_CACHE_CHECK([for POSIX ACL], gvfs_cv_HAVE_POSIX_ACLS,[ acl_LIBS=$LIBS LIBS="$LIBS -lacl" AC_TRY_LINK([#include <sys/types.h> #include <sys/acl.h>], [ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry (acl, entry_id, entry_p);], gvfs_cv_HAVE_POSIX_ACLS=yes, gvfs_cv_HAVE_POSIX_ACLS=no) LIBS=$acl_LIBS]) configure has already determined whether -lacl is appropriate or not, so the POSIX ACL test should respect that determination instea of blindly passing that flag.
Created attachment 103405 [details] [review] Pass "whatever acl lib flags are appropriate" With this patch, I get: checking for acl_get_file in -lacl... no checking for acl in -lsec... no checking for Solaris ACL... no checking for POSIX ACL... yes
...however then compiling fails: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I.. -I../imported/neon -DORBIT2=1 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/orbit-2.0 -I/sw/include/gconf/2 -I/sw/include/libxml2 -I/sw/include -DORBIT2=1 -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/sw/include/orbit-2.0 -I/sw/include/gconf/2 -D_REENTRANT -I/sw/include -I/sw/include/glib-2.0 -I/sw/lib/glib-2.0/include -I/usr/include -D_FILE_OFFSET_BITS=64 -D_BSD_SOURCE -D_LARGEFILE64_SOURCE -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -DSSH_PROGRAM=\"/usr/bin/ssh\" -DG_DISABLE_DEPRECATED -DGNOME_VFS_PREFIX=\"/sw\" -DGNOME_VFS_DATADIR=\"/sw/share\" -DGNOME_VFS_LIBDIR=\"/sw/lib/gnome-vfs2.16\" -DGNOME_VFS_SYSCONFDIR=\"/sw/etc\" -DG_LOG_DOMAIN=\"gnome-vfs-modules\" -fno-common -I/sw/include -no-cpp-precomp -Os -c file-method-acl.c -fno-common -DPIC -o .libs/file-method-acl.o file-method-acl.c:50:25: error: acl/libacl.h: No such file or directory The POSIX ACL check used sys/acl.h, so should that (not acl/libacl.h) be #included in file-method-acl.c? Or is acl/libacl.h part of the POSIX ACL standard, and should thus be part of that configure test (or at least have some AC_CHECK_HEADER tests to figure out which to use)? If I adjust the .c to use sys/acl.h (which I do have), I still get a mile of errors, beginning with: file-method-acl.c: In function 'permset_to_perms': file-method-acl.c:234: warning: implicit declaration of function 'acl_get_perm' file-method-acl.c:234: error: 'ACL_READ' undeclared (first use in this function) file-method-acl.c:234: error: (Each undeclared identifier is reported only once file-method-acl.c:234: error: for each function it appears in.) file-method-acl.c:239: error: 'ACL_WRITE' undeclared (first use in this function) so maybe my ACL isn't POSIX-compliant after all, and my initial incorrect failure of that test was a blessing in disguise. Guess that POSIX ACL test needs more work to test the actual POSIXness of it, or else file-method-acl.c needs some portability/compatibility enhancements.
Confirmed that OS X ACLs are not full POSIX. I have acl_get_permset and acl_get_perm_np, but not acl_get_perm. That might be a good AC_CHECK_FUNC or better AC_CHECK_LIB for bsdish ACLs.
gnome-vfs got deprecated in 2008. gnome-vfs is not under active development anymore and had its last code changes in 2011. Its codebase has been archived: https://gitlab.gnome.org/Archive/gnome-vfs/commits/master gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!