Karsten Hopp 7520b4
To: vim_dev@googlegroups.com
Karsten Hopp 7520b4
Subject: Patch 7.3.432
Karsten Hopp 7520b4
Fcc: outbox
Karsten Hopp 7520b4
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 7520b4
Mime-Version: 1.0
Karsten Hopp 7520b4
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 7520b4
Content-Transfer-Encoding: 8bit
Karsten Hopp 7520b4
------------
Karsten Hopp 7520b4
Karsten Hopp 7520b4
Patch 7.3.432
Karsten Hopp 7520b4
Problem:    ACLs are not supported for ZFS or NFSv4 on Solaris.
Karsten Hopp 7520b4
Solution:   Add configure check and code. (Danek Duvall)
Karsten Hopp 7520b4
Files:      src/configure.in, src/auto/configure, src/config.h.in,
Karsten Hopp 7520b4
            src/os_unix.c
Karsten Hopp 7520b4
Karsten Hopp 7520b4
Karsten Hopp 7520b4
*** ../vim-7.3.431/src/configure.in	2011-12-14 20:51:19.000000000 +0100
Karsten Hopp 7520b4
--- src/configure.in	2012-02-05 22:40:22.000000000 +0100
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 3106,3111 ****
Karsten Hopp 7520b4
--- 3106,3112 ----
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
  dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
Karsten Hopp 7520b4
  dnl when -lacl works, also try to use -lattr (required for Debian).
Karsten Hopp 7520b4
+ dnl On Solaris, use the acl_get/set functions in libsec, if present.
Karsten Hopp 7520b4
  AC_MSG_CHECKING(--disable-acl argument)
Karsten Hopp 7520b4
  AC_ARG_ENABLE(acl,
Karsten Hopp 7520b4
  	[  --disable-acl           Don't check for ACL support.],
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 3128,3133 ****
Karsten Hopp 7520b4
--- 3129,3135 ----
Karsten Hopp 7520b4
  	AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
Karsten Hopp 7520b4
  	AC_MSG_RESULT(no))
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
+ AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)],
Karsten Hopp 7520b4
  AC_MSG_CHECKING(for Solaris ACL support)
Karsten Hopp 7520b4
  AC_TRY_LINK([
Karsten Hopp 7520b4
  #ifdef HAVE_SYS_ACL_H
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 3135,3141 ****
Karsten Hopp 7520b4
  #endif], [acl("foo", GETACLCNT, 0, NULL);
Karsten Hopp 7520b4
  	],
Karsten Hopp 7520b4
  	AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
Karsten Hopp 7520b4
! 	AC_MSG_RESULT(no))
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
  AC_MSG_CHECKING(for AIX ACL support)
Karsten Hopp 7520b4
  AC_TRY_LINK([
Karsten Hopp 7520b4
--- 3137,3143 ----
Karsten Hopp 7520b4
  #endif], [acl("foo", GETACLCNT, 0, NULL);
Karsten Hopp 7520b4
  	],
Karsten Hopp 7520b4
  	AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
Karsten Hopp 7520b4
! 	AC_MSG_RESULT(no)))
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
  AC_MSG_CHECKING(for AIX ACL support)
Karsten Hopp 7520b4
  AC_TRY_LINK([
Karsten Hopp 7520b4
*** ../vim-7.3.431/src/auto/configure	2011-12-14 20:51:19.000000000 +0100
Karsten Hopp 7520b4
--- src/auto/configure	2012-02-05 22:41:01.000000000 +0100
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 11328,11334 ****
Karsten Hopp 7520b4
  rm -f core conftest.err conftest.$ac_objext \
Karsten Hopp 7520b4
      conftest$ac_exeext conftest.$ac_ext
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
Karsten Hopp 7520b4
  $as_echo_n "checking for Solaris ACL support... " >&6; }
Karsten Hopp 7520b4
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Karsten Hopp 7520b4
  /* end confdefs.h.  */
Karsten Hopp 7520b4
--- 11328,11374 ----
Karsten Hopp 7520b4
  rm -f core conftest.err conftest.$ac_objext \
Karsten Hopp 7520b4
      conftest$ac_exeext conftest.$ac_ext
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get in -lsec" >&5
Karsten Hopp 7520b4
! $as_echo_n "checking for acl_get in -lsec... " >&6; }
Karsten Hopp 7520b4
! if test "${ac_cv_lib_sec_acl_get+set}" = set; then :
Karsten Hopp 7520b4
!   $as_echo_n "(cached) " >&6
Karsten Hopp 7520b4
! else
Karsten Hopp 7520b4
!   ac_check_lib_save_LIBS=$LIBS
Karsten Hopp 7520b4
! LIBS="-lsec  $LIBS"
Karsten Hopp 7520b4
! cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Karsten Hopp 7520b4
! /* end confdefs.h.  */
Karsten Hopp 7520b4
! 
Karsten Hopp 7520b4
! /* Override any GCC internal prototype to avoid an error.
Karsten Hopp 7520b4
!    Use char because int might match the return type of a GCC
Karsten Hopp 7520b4
!    builtin and then its argument prototype would still apply.  */
Karsten Hopp 7520b4
! #ifdef __cplusplus
Karsten Hopp 7520b4
! extern "C"
Karsten Hopp 7520b4
! #endif
Karsten Hopp 7520b4
! char acl_get ();
Karsten Hopp 7520b4
! int
Karsten Hopp 7520b4
! main ()
Karsten Hopp 7520b4
! {
Karsten Hopp 7520b4
! return acl_get ();
Karsten Hopp 7520b4
!   ;
Karsten Hopp 7520b4
!   return 0;
Karsten Hopp 7520b4
! }
Karsten Hopp 7520b4
! _ACEOF
Karsten Hopp 7520b4
! if ac_fn_c_try_link "$LINENO"; then :
Karsten Hopp 7520b4
!   ac_cv_lib_sec_acl_get=yes
Karsten Hopp 7520b4
! else
Karsten Hopp 7520b4
!   ac_cv_lib_sec_acl_get=no
Karsten Hopp 7520b4
! fi
Karsten Hopp 7520b4
! rm -f core conftest.err conftest.$ac_objext \
Karsten Hopp 7520b4
!     conftest$ac_exeext conftest.$ac_ext
Karsten Hopp 7520b4
! LIBS=$ac_check_lib_save_LIBS
Karsten Hopp 7520b4
! fi
Karsten Hopp 7520b4
! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5
Karsten Hopp 7520b4
! $as_echo "$ac_cv_lib_sec_acl_get" >&6; }
Karsten Hopp 7520b4
! if test "x$ac_cv_lib_sec_acl_get" = x""yes; then :
Karsten Hopp 7520b4
!   LIBS="$LIBS -lsec"; $as_echo "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h
Karsten Hopp 7520b4
! 
Karsten Hopp 7520b4
! else
Karsten Hopp 7520b4
!   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
Karsten Hopp 7520b4
  $as_echo_n "checking for Solaris ACL support... " >&6; }
Karsten Hopp 7520b4
  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Karsten Hopp 7520b4
  /* end confdefs.h.  */
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 11355,11360 ****
Karsten Hopp 7520b4
--- 11395,11402 ----
Karsten Hopp 7520b4
  fi
Karsten Hopp 7520b4
  rm -f core conftest.err conftest.$ac_objext \
Karsten Hopp 7520b4
      conftest$ac_exeext conftest.$ac_ext
Karsten Hopp 7520b4
+ fi
Karsten Hopp 7520b4
+ 
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AIX ACL support" >&5
Karsten Hopp 7520b4
  $as_echo_n "checking for AIX ACL support... " >&6; }
Karsten Hopp 7520b4
*** ../vim-7.3.431/src/config.h.in	2011-09-02 12:27:20.000000000 +0200
Karsten Hopp 7520b4
--- src/config.h.in	2012-02-05 22:40:22.000000000 +0100
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 363,368 ****
Karsten Hopp 7520b4
--- 363,369 ----
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
  /* Define if you want to add support for ACL */
Karsten Hopp 7520b4
  #undef HAVE_POSIX_ACL
Karsten Hopp 7520b4
+ #undef HAVE_SOLARIS_ZFS_ACL
Karsten Hopp 7520b4
  #undef HAVE_SOLARIS_ACL
Karsten Hopp 7520b4
  #undef HAVE_AIX_ACL
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
*** ../vim-7.3.431/src/os_unix.c	2012-01-10 22:26:12.000000000 +0100
Karsten Hopp 7520b4
--- src/os_unix.c	2012-02-05 22:40:22.000000000 +0100
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2746,2751 ****
Karsten Hopp 7520b4
--- 2746,2758 ----
Karsten Hopp 7520b4
  #ifdef HAVE_POSIX_ACL
Karsten Hopp 7520b4
      ret = (vim_acl_T)acl_get_file((char *)fname, ACL_TYPE_ACCESS);
Karsten Hopp 7520b4
  #else
Karsten Hopp 7520b4
+ #ifdef HAVE_SOLARIS_ZFS_ACL
Karsten Hopp 7520b4
+     acl_t *aclent;
Karsten Hopp 7520b4
+ 
Karsten Hopp 7520b4
+     if (acl_get((char *)fname, 0, &aclent) < 0)
Karsten Hopp 7520b4
+ 	return NULL;
Karsten Hopp 7520b4
+     ret = (vim_acl_T)aclent;
Karsten Hopp 7520b4
+ #else
Karsten Hopp 7520b4
  #ifdef HAVE_SOLARIS_ACL
Karsten Hopp 7520b4
      vim_acl_solaris_T   *aclent;
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2791,2796 ****
Karsten Hopp 7520b4
--- 2798,2804 ----
Karsten Hopp 7520b4
      ret = (vim_acl_T)aclent;
Karsten Hopp 7520b4
  #endif /* HAVE_AIX_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_SOLARIS_ACL */
Karsten Hopp 7520b4
+ #endif /* HAVE_SOLARIS_ZFS_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_POSIX_ACL */
Karsten Hopp 7520b4
      return ret;
Karsten Hopp 7520b4
  }
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2808,2813 ****
Karsten Hopp 7520b4
--- 2816,2824 ----
Karsten Hopp 7520b4
  #ifdef HAVE_POSIX_ACL
Karsten Hopp 7520b4
      acl_set_file((char *)fname, ACL_TYPE_ACCESS, (acl_t)aclent);
Karsten Hopp 7520b4
  #else
Karsten Hopp 7520b4
+ #ifdef HAVE_SOLARIS_ZFS_ACL
Karsten Hopp 7520b4
+     acl_set((char *)fname, (acl_t *)aclent);
Karsten Hopp 7520b4
+ #else
Karsten Hopp 7520b4
  #ifdef HAVE_SOLARIS_ACL
Karsten Hopp 7520b4
      acl((char *)fname, SETACL, ((vim_acl_solaris_T *)aclent)->acl_cnt,
Karsten Hopp 7520b4
  	    ((vim_acl_solaris_T *)aclent)->acl_entry);
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2816,2821 ****
Karsten Hopp 7520b4
--- 2827,2833 ----
Karsten Hopp 7520b4
      chacl((char *)fname, aclent, ((struct acl *)aclent)->acl_len);
Karsten Hopp 7520b4
  #endif /* HAVE_AIX_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_SOLARIS_ACL */
Karsten Hopp 7520b4
+ #endif /* HAVE_SOLARIS_ZFS_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_POSIX_ACL */
Karsten Hopp 7520b4
  }
Karsten Hopp 7520b4
  
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2828,2833 ****
Karsten Hopp 7520b4
--- 2840,2848 ----
Karsten Hopp 7520b4
  #ifdef HAVE_POSIX_ACL
Karsten Hopp 7520b4
      acl_free((acl_t)aclent);
Karsten Hopp 7520b4
  #else
Karsten Hopp 7520b4
+ #ifdef HAVE_SOLARIS_ZFS_ACL
Karsten Hopp 7520b4
+     acl_free((acl_t *)aclent);
Karsten Hopp 7520b4
+ #else
Karsten Hopp 7520b4
  #ifdef HAVE_SOLARIS_ACL
Karsten Hopp 7520b4
      free(((vim_acl_solaris_T *)aclent)->acl_entry);
Karsten Hopp 7520b4
      free(aclent);
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 2836,2841 ****
Karsten Hopp 7520b4
--- 2851,2857 ----
Karsten Hopp 7520b4
      free(aclent);
Karsten Hopp 7520b4
  #endif /* HAVE_AIX_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_SOLARIS_ACL */
Karsten Hopp 7520b4
+ #endif /* HAVE_SOLARIS_ZFS_ACL */
Karsten Hopp 7520b4
  #endif /* HAVE_POSIX_ACL */
Karsten Hopp 7520b4
  }
Karsten Hopp 7520b4
  #endif
Karsten Hopp 7520b4
*** ../vim-7.3.431/src/version.c	2012-02-05 22:05:44.000000000 +0100
Karsten Hopp 7520b4
--- src/version.c	2012-02-05 22:44:10.000000000 +0100
Karsten Hopp 7520b4
***************
Karsten Hopp 7520b4
*** 716,717 ****
Karsten Hopp 7520b4
--- 716,719 ----
Karsten Hopp 7520b4
  {   /* Add new patch number below this line */
Karsten Hopp 7520b4
+ /**/
Karsten Hopp 7520b4
+     432,
Karsten Hopp 7520b4
  /**/
Karsten Hopp 7520b4
Karsten Hopp 7520b4
-- 
Karsten Hopp 7520b4
If you put 7 of the most talented OSS developers in a room for a week
Karsten Hopp 7520b4
and asked them to fix a bug in a spreadsheet program, in 1 week
Karsten Hopp 7520b4
you'd have 2 new mail readers and a text-based web browser.
Karsten Hopp 7520b4
Karsten Hopp 7520b4
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 7520b4
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 7520b4
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 7520b4
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///