1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
11 Problem: ACLs are not supported for ZFS or NFSv4 on Solaris.
12 Solution: Add configure check and code. (Danek Duvall)
13 Files: src/configure.in, src/auto/configure, src/config.h.in,
17 *** ../vim-7.3.431/src/configure.in 2011-12-14 20:51:19.000000000 +0100
18 --- src/configure.in 2012-02-05 22:40:22.000000000 +0100
23 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
24 dnl when -lacl works, also try to use -lattr (required for Debian).
25 + dnl On Solaris, use the acl_get/set functions in libsec, if present.
26 AC_MSG_CHECKING(--disable-acl argument)
28 [ --disable-acl Don't check for ACL support.],
32 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL),
35 + AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)],
36 AC_MSG_CHECKING(for Solaris ACL support)
41 #endif], [acl("foo", GETACLCNT, 0, NULL);
43 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
46 AC_MSG_CHECKING(for AIX ACL support)
49 #endif], [acl("foo", GETACLCNT, 0, NULL);
51 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL),
54 AC_MSG_CHECKING(for AIX ACL support)
56 *** ../vim-7.3.431/src/auto/configure 2011-12-14 20:51:19.000000000 +0100
57 --- src/auto/configure 2012-02-05 22:41:01.000000000 +0100
60 rm -f core conftest.err conftest.$ac_objext \
61 conftest$ac_exeext conftest.$ac_ext
63 ! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
64 $as_echo_n "checking for Solaris ACL support... " >&6; }
65 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
68 rm -f core conftest.err conftest.$ac_objext \
69 conftest$ac_exeext conftest.$ac_ext
71 ! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get in -lsec" >&5
72 ! $as_echo_n "checking for acl_get in -lsec... " >&6; }
73 ! if test "${ac_cv_lib_sec_acl_get+set}" = set; then :
74 ! $as_echo_n "(cached) " >&6
76 ! ac_check_lib_save_LIBS=$LIBS
78 ! cat confdefs.h - <<_ACEOF >conftest.$ac_ext
79 ! /* end confdefs.h. */
81 ! /* Override any GCC internal prototype to avoid an error.
82 ! Use char because int might match the return type of a GCC
83 ! builtin and then its argument prototype would still apply. */
96 ! if ac_fn_c_try_link "$LINENO"; then :
97 ! ac_cv_lib_sec_acl_get=yes
99 ! ac_cv_lib_sec_acl_get=no
101 ! rm -f core conftest.err conftest.$ac_objext \
102 ! conftest$ac_exeext conftest.$ac_ext
103 ! LIBS=$ac_check_lib_save_LIBS
105 ! { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5
106 ! $as_echo "$ac_cv_lib_sec_acl_get" >&6; }
107 ! if test "x$ac_cv_lib_sec_acl_get" = x""yes; then :
108 ! LIBS="$LIBS -lsec"; $as_echo "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h
111 ! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5
112 $as_echo_n "checking for Solaris ACL support... " >&6; }
113 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
114 /* end confdefs.h. */
119 rm -f core conftest.err conftest.$ac_objext \
120 conftest$ac_exeext conftest.$ac_ext
124 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AIX ACL support" >&5
125 $as_echo_n "checking for AIX ACL support... " >&6; }
126 *** ../vim-7.3.431/src/config.h.in 2011-09-02 12:27:20.000000000 +0200
127 --- src/config.h.in 2012-02-05 22:40:22.000000000 +0100
132 /* Define if you want to add support for ACL */
133 #undef HAVE_POSIX_ACL
134 + #undef HAVE_SOLARIS_ZFS_ACL
135 #undef HAVE_SOLARIS_ACL
138 *** ../vim-7.3.431/src/os_unix.c 2012-01-10 22:26:12.000000000 +0100
139 --- src/os_unix.c 2012-02-05 22:40:22.000000000 +0100
143 #ifdef HAVE_POSIX_ACL
144 ret = (vim_acl_T)acl_get_file((char *)fname, ACL_TYPE_ACCESS);
146 + #ifdef HAVE_SOLARIS_ZFS_ACL
149 + if (acl_get((char *)fname, 0, &aclent) < 0)
151 + ret = (vim_acl_T)aclent;
153 #ifdef HAVE_SOLARIS_ACL
154 vim_acl_solaris_T *aclent;
159 ret = (vim_acl_T)aclent;
160 #endif /* HAVE_AIX_ACL */
161 #endif /* HAVE_SOLARIS_ACL */
162 + #endif /* HAVE_SOLARIS_ZFS_ACL */
163 #endif /* HAVE_POSIX_ACL */
169 #ifdef HAVE_POSIX_ACL
170 acl_set_file((char *)fname, ACL_TYPE_ACCESS, (acl_t)aclent);
172 + #ifdef HAVE_SOLARIS_ZFS_ACL
173 + acl_set((char *)fname, (acl_t *)aclent);
175 #ifdef HAVE_SOLARIS_ACL
176 acl((char *)fname, SETACL, ((vim_acl_solaris_T *)aclent)->acl_cnt,
177 ((vim_acl_solaris_T *)aclent)->acl_entry);
181 chacl((char *)fname, aclent, ((struct acl *)aclent)->acl_len);
182 #endif /* HAVE_AIX_ACL */
183 #endif /* HAVE_SOLARIS_ACL */
184 + #endif /* HAVE_SOLARIS_ZFS_ACL */
185 #endif /* HAVE_POSIX_ACL */
191 #ifdef HAVE_POSIX_ACL
192 acl_free((acl_t)aclent);
194 + #ifdef HAVE_SOLARIS_ZFS_ACL
195 + acl_free((acl_t *)aclent);
197 #ifdef HAVE_SOLARIS_ACL
198 free(((vim_acl_solaris_T *)aclent)->acl_entry);
204 #endif /* HAVE_AIX_ACL */
205 #endif /* HAVE_SOLARIS_ACL */
206 + #endif /* HAVE_SOLARIS_ZFS_ACL */
207 #endif /* HAVE_POSIX_ACL */
210 *** ../vim-7.3.431/src/version.c 2012-02-05 22:05:44.000000000 +0100
211 --- src/version.c 2012-02-05 22:44:10.000000000 +0100
215 { /* Add new patch number below this line */
221 If you put 7 of the most talented OSS developers in a room for a week
222 and asked them to fix a bug in a spreadsheet program, in 1 week
223 you'd have 2 new mail readers and a text-based web browser.
225 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
226 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
227 \\\ an exciting new programming language -- http://www.Zimbu.org ///
228 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///