|
1 --- src/configure.in Tue Jan 10 16:13:35 2012 |
|
2 +++ src/configure.in Fri Jan 13 14:10:21 2012 |
|
3 @@ -3106,6 +3106,7 @@ |
|
4 |
|
5 dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI |
|
6 dnl when -lacl works, also try to use -lattr (required for Debian). |
|
7 +dnl On Solaris, use the acl_get/set functions in libsec, if present. |
|
8 AC_MSG_CHECKING(--disable-acl argument) |
|
9 AC_ARG_ENABLE(acl, |
|
10 [ --disable-acl Don't check for ACL support.], |
|
11 @@ -3128,7 +3129,8 @@ |
|
12 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_POSIX_ACL), |
|
13 AC_MSG_RESULT(no)) |
|
14 |
|
15 -AC_MSG_CHECKING(for Solaris ACL support) |
|
16 +AC_CHECK_LIB(sec, acl_get, [LIBS="$LIBS -lsec"; AC_DEFINE(HAVE_SOLARIS_ZFS_ACL)], |
|
17 +AC_MSG_CHECKING(for Solaris ACL support) |
|
18 AC_TRY_LINK([ |
|
19 #ifdef HAVE_SYS_ACL_H |
|
20 # include <sys/acl.h> |
|
21 @@ -3135,7 +3137,7 @@ |
|
22 #endif], [acl("foo", GETACLCNT, 0, NULL); |
|
23 ], |
|
24 AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SOLARIS_ACL), |
|
25 - AC_MSG_RESULT(no)) |
|
26 + AC_MSG_RESULT(no))) |
|
27 |
|
28 AC_MSG_CHECKING(for AIX ACL support) |
|
29 AC_TRY_LINK([ |
|
30 --- src/config.h.in Fri Jan 13 13:29:05 2012 |
|
31 +++ src/config.h.in Fri Jan 13 13:29:13 2012 |
|
32 @@ -363,6 +363,7 @@ |
|
33 |
|
34 /* Define if you want to add support for ACL */ |
|
35 #undef HAVE_POSIX_ACL |
|
36 +#undef HAVE_SOLARIS_ZFS_ACL |
|
37 #undef HAVE_SOLARIS_ACL |
|
38 #undef HAVE_AIX_ACL |
|
39 |
|
40 --- src/os_unix.c Tue Jan 10 16:13:35 2012 |
|
41 +++ src/os_unix.c Fri Jan 13 15:57:08 2012 |
|
42 @@ -2746,6 +2746,13 @@ |
|
43 #ifdef HAVE_POSIX_ACL |
|
44 ret = (vim_acl_T)acl_get_file((char *)fname, ACL_TYPE_ACCESS); |
|
45 #else |
|
46 +#ifdef HAVE_SOLARIS_ZFS_ACL |
|
47 + acl_t *aclent; |
|
48 + |
|
49 + if (acl_get((char *)fname, 0, &aclent) < 0) |
|
50 + return NULL; |
|
51 + ret = (vim_acl_T)aclent; |
|
52 +#else |
|
53 #ifdef HAVE_SOLARIS_ACL |
|
54 vim_acl_solaris_T *aclent; |
|
55 |
|
56 @@ -2791,6 +2798,7 @@ |
|
57 ret = (vim_acl_T)aclent; |
|
58 #endif /* HAVE_AIX_ACL */ |
|
59 #endif /* HAVE_SOLARIS_ACL */ |
|
60 +#endif /* HAVE_SOLARIS_ZFS_ACL */ |
|
61 #endif /* HAVE_POSIX_ACL */ |
|
62 return ret; |
|
63 } |
|
64 @@ -2808,6 +2816,9 @@ |
|
65 #ifdef HAVE_POSIX_ACL |
|
66 acl_set_file((char *)fname, ACL_TYPE_ACCESS, (acl_t)aclent); |
|
67 #else |
|
68 +#ifdef HAVE_SOLARIS_ZFS_ACL |
|
69 + acl_set((char *)fname, (acl_t *)aclent); |
|
70 +#else |
|
71 #ifdef HAVE_SOLARIS_ACL |
|
72 acl((char *)fname, SETACL, ((vim_acl_solaris_T *)aclent)->acl_cnt, |
|
73 ((vim_acl_solaris_T *)aclent)->acl_entry); |
|
74 @@ -2816,6 +2827,7 @@ |
|
75 chacl((char *)fname, aclent, ((struct acl *)aclent)->acl_len); |
|
76 #endif /* HAVE_AIX_ACL */ |
|
77 #endif /* HAVE_SOLARIS_ACL */ |
|
78 +#endif /* HAVE_SOLARIS_ZFS_ACL */ |
|
79 #endif /* HAVE_POSIX_ACL */ |
|
80 } |
|
81 |
|
82 @@ -2828,6 +2840,9 @@ |
|
83 #ifdef HAVE_POSIX_ACL |
|
84 acl_free((acl_t)aclent); |
|
85 #else |
|
86 +#ifdef HAVE_SOLARIS_ZFS_ACL |
|
87 + acl_free((acl_t *)aclent); |
|
88 +#else |
|
89 #ifdef HAVE_SOLARIS_ACL |
|
90 free(((vim_acl_solaris_T *)aclent)->acl_entry); |
|
91 free(aclent); |
|
92 @@ -2836,6 +2851,7 @@ |
|
93 free(aclent); |
|
94 #endif /* HAVE_AIX_ACL */ |
|
95 #endif /* HAVE_SOLARIS_ACL */ |
|
96 +#endif /* HAVE_SOLARIS_ZFS_ACL */ |
|
97 #endif /* HAVE_POSIX_ACL */ |
|
98 } |
|
99 #endif |