From c31211167bc2b98f51f8f3cc70bb410250b427aa Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 7 Dec 2000 06:23:01 +0000 Subject: Added better configure test for POSIX ACLs. Fixed stupid typo in sysacls.c Jeremy. (This used to be commit da6ae57501e3cb971e82eac5bb05efcd9cf443ae) --- source3/configure | 88 ++++++++++++++++++++++++++++++++++++++++++--- source3/configure.in | 15 ++++++-- source3/include/config.h.in | 3 ++ source3/lib/sysacls.c | 2 +- 4 files changed, 99 insertions(+), 9 deletions(-) diff --git a/source3/configure b/source3/configure index 13bc020582..dd76db650f 100755 --- a/source3/configure +++ b/source3/configure @@ -11481,12 +11481,90 @@ if test "${with_posix_acls+set}" = set; then withval="$with_posix_acls" case "$withval" in yes) - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF + + echo $ac_n "checking for acl_get_file in -lacl""... $ac_c" 1>&6 +echo "configure:11487: checking for acl_get_file in -lacl" >&5 +ac_lib_var=`echo acl'_'acl_get_file | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lacl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo acl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + +echo $ac_n "checking for POSIX ACL support""... $ac_c" 1>&6 +echo "configure:11534: checking for POSIX ACL support" >&5 +if eval "test \"`echo '$''{'samba_cv_HAVE_POSIX_ACLS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +cat > conftest.$ac_ext < +#include +int main() { + acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p); +; return 0; } +EOF +if { (eval echo configure:11548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + samba_cv_HAVE_POSIX_ACLS=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + samba_cv_HAVE_POSIX_ACLS=no +fi +rm -f conftest* +fi + +echo "$ac_t""$samba_cv_HAVE_POSIX_ACLS" 1>&6 +if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF #define HAVE_POSIX_ACLS 1 EOF - ;; +fi + ;; *) echo "$ac_t""no" 1>&6 ;; @@ -11502,11 +11580,11 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:11588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "configure OK"; else diff --git a/source3/configure.in b/source3/configure.in index 252c6d7006..4b6119c9ef 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1934,9 +1934,18 @@ AC_ARG_WITH(posix-acls, --without-posix-acls Don't include POSIX ACL support (default)], [ case "$withval" in yes) - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_POSIX_ACLS) - ;; + + AC_CHECK_LIB(acl,acl_get_file) +AC_CACHE_CHECK([for POSIX ACL support],samba_cv_HAVE_POSIX_ACLS,[ +AC_TRY_COMPILE([#include +#include ], +[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);], +samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)]) +if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_ACLS) +fi + ;; *) AC_MSG_RESULT(no) ;; diff --git a/source3/include/config.h.in b/source3/include/config.h.in index a9bc166139..98b4ef8b2b 100644 --- a/source3/include/config.h.in +++ b/source3/include/config.h.in @@ -925,6 +925,9 @@ /* Define if you have the header file. */ #undef HAVE_UTMPX_H +/* Define if you have the acl library (-lacl). */ +#undef HAVE_LIBACL + /* Define if you have the cups library (-lcups). */ #undef HAVE_LIBCUPS diff --git a/source3/lib/sysacls.c b/source3/lib/sysacls.c index 22fbaee26f..2412fb7b0e 100644 --- a/source3/lib/sysacls.c +++ b/source3/lib/sysacls.c @@ -73,7 +73,7 @@ void *sys_acl_get_qualifier( SMB_ACL_ENTRY_T entry_d) SMB_ACL_T sys_acl_get_file( const char *path_p, SMB_ACL_TYPE_T type) { - return sys_acl_get_file( path_p, type); + return acl_get_file( path_p, type); } SMB_ACL_T sys_acl_get_fd(int fd) -- cgit