2 Unix SMB/Netbios implementation.
3 VFS module to get and set Solaris ACLs
4 Copyright (C) Michael Adam 2006,2008
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "system/filesys.h"
23 #include "smbd/smbd.h"
24 #include "modules/vfs_solarisacl.h"
26 /* typedef struct acl SOLARIS_ACE_T; */
27 typedef aclent_t SOLARIS_ACE_T
;
28 typedef aclent_t
*SOLARIS_ACL_T
;
29 typedef int SOLARIS_ACL_TAG_T
; /* the type of an ACL entry */
30 typedef o_mode_t SOLARIS_PERM_T
;
32 /* for convenience: check if solaris acl entry is a default entry? */
33 #define _IS_DEFAULT(ace) ((ace).a_type & ACL_DEFAULT)
34 #define _IS_OF_TYPE(ace, type) ( \
35 (((type) == SMB_ACL_TYPE_ACCESS) && !_IS_DEFAULT(ace)) \
37 (((type) == SMB_ACL_TYPE_DEFAULT) && _IS_DEFAULT(ace)) \
41 /* prototypes for private functions */
43 static SOLARIS_ACL_T
solaris_acl_init(int count
);
44 static bool smb_acl_to_solaris_acl(SMB_ACL_T smb_acl
,
45 SOLARIS_ACL_T
*solariacl
, int *count
,
47 static SMB_ACL_T
solaris_acl_to_smb_acl(SOLARIS_ACL_T solarisacl
, int count
,
48 SMB_ACL_TYPE_T type
, TALLOC_CTX
*mem_ctx
);
49 static SOLARIS_ACL_TAG_T
smb_tag_to_solaris_tag(SMB_ACL_TAG_T smb_tag
);
50 static SMB_ACL_TAG_T
solaris_tag_to_smb_tag(SOLARIS_ACL_TAG_T solaris_tag
);
51 static bool solaris_add_to_acl(SOLARIS_ACL_T
*solaris_acl
, int *count
,
52 SOLARIS_ACL_T add_acl
, int add_count
, SMB_ACL_TYPE_T type
);
53 static bool solaris_acl_get_file(const char *name
, SOLARIS_ACL_T
*solarisacl
,
55 static bool solaris_acl_get_fd(int fd
, SOLARIS_ACL_T
*solarisacl
, int *count
);
56 static bool solaris_acl_sort(SOLARIS_ACL_T theacl
, int count
);
57 static SMB_ACL_PERM_T
solaris_perm_to_smb_perm(const SOLARIS_PERM_T perm
);
58 static SOLARIS_PERM_T
smb_perm_to_solaris_perm(const SMB_ACL_PERM_T perm
);
60 static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl
, int count
);
63 /* public functions - the api */
65 SMB_ACL_T
solarisacl_sys_acl_get_file(vfs_handle_struct
*handle
,
67 SMB_ACL_TYPE_T type
, TALLOC_CTX
*mem_ctx
)
69 SMB_ACL_T result
= NULL
;
71 SOLARIS_ACL_T solaris_acl
= NULL
;
73 DEBUG(10, ("solarisacl_sys_acl_get_file called for file '%s'.\n",
76 if (type
!= SMB_ACL_TYPE_ACCESS
&& type
!= SMB_ACL_TYPE_DEFAULT
) {
77 DEBUG(10, ("invalid SMB_ACL_TYPE given (%d)\n", type
));
82 DEBUGADD(10, ("getting %s acl\n",
83 ((type
== SMB_ACL_TYPE_ACCESS
) ? "access" : "default")));
85 if (!solaris_acl_get_file(path_p
, &solaris_acl
, &count
)) {
88 result
= solaris_acl_to_smb_acl(solaris_acl
, count
, type
, mem_ctx
);
90 DEBUG(10, ("conversion solaris_acl -> smb_acl failed (%s).\n",
95 DEBUG(10, ("solarisacl_sys_acl_get_file %s.\n",
96 ((result
== NULL
) ? "failed" : "succeeded" )));
97 SAFE_FREE(solaris_acl
);
103 * get the access ACL of a file referred to by a fd
105 SMB_ACL_T
solarisacl_sys_acl_get_fd(vfs_handle_struct
*handle
,
106 files_struct
*fsp
, TALLOC_CTX
*mem_ctx
)
108 SMB_ACL_T result
= NULL
;
110 SOLARIS_ACL_T solaris_acl
= NULL
;
112 DEBUG(10, ("entering solarisacl_sys_acl_get_fd.\n"));
114 if (!solaris_acl_get_fd(fsp
->fh
->fd
, &solaris_acl
, &count
)) {
118 * The facl call returns both ACCESS and DEFAULT acls (as present).
119 * The posix acl_get_fd function returns only the
120 * access acl. So we need to filter this out here.
122 result
= solaris_acl_to_smb_acl(solaris_acl
, count
,
123 SMB_ACL_TYPE_ACCESS
, mem_ctx
);
124 if (result
== NULL
) {
125 DEBUG(10, ("conversion solaris_acl -> smb_acl failed (%s).\n",
130 DEBUG(10, ("solarisacl_sys_acl_get_fd %s.\n",
131 ((result
== NULL
) ? "failed" : "succeeded")));
132 SAFE_FREE(solaris_acl
);
136 int solarisacl_sys_acl_set_file(vfs_handle_struct
*handle
,
142 SOLARIS_ACL_T solaris_acl
= NULL
;
144 struct smb_filename smb_fname
= {
145 .base_name
= discard_const_p(char, name
)
148 DEBUG(10, ("solarisacl_sys_acl_set_file called for file '%s'\n",
151 if ((type
!= SMB_ACL_TYPE_ACCESS
) && (type
!= SMB_ACL_TYPE_DEFAULT
)) {
153 DEBUG(10, ("invalid smb acl type given (%d).\n", type
));
156 DEBUGADD(10, ("setting %s acl\n",
157 ((type
== SMB_ACL_TYPE_ACCESS
) ? "access" : "default")));
159 if(!smb_acl_to_solaris_acl(theacl
, &solaris_acl
, &count
, type
)) {
160 DEBUG(10, ("conversion smb_acl -> solaris_acl failed (%s).\n",
166 * if the file is a directory, there is extra work to do:
167 * since the solaris acl call stores both the access acl and
168 * the default acl as provided, we have to get the acl part
169 * that has not been specified in "type" from the file first
170 * and concatenate it with the acl provided.
172 * We can directly use SMB_VFS_STAT here, as if this was a
173 * POSIX call on a symlink, we've already refused it.
174 * For a Windows acl mapped call on a symlink, we want to follow
177 ret
= SMB_VFS_STAT(handle
->conn
, &smb_fname
);
179 DEBUG(10, ("Error in stat call: %s\n", strerror(errno
)));
182 if (S_ISDIR(smb_fname
.st
.st_ex_mode
)) {
183 SOLARIS_ACL_T other_acl
= NULL
;
185 SMB_ACL_TYPE_T other_type
;
187 other_type
= (type
== SMB_ACL_TYPE_ACCESS
)
188 ? SMB_ACL_TYPE_DEFAULT
189 : SMB_ACL_TYPE_ACCESS
;
190 DEBUGADD(10, ("getting acl from filesystem\n"));
191 if (!solaris_acl_get_file(name
, &other_acl
, &other_count
)) {
192 DEBUG(10, ("error getting acl from directory\n"));
195 DEBUG(10, ("adding %s part of fs acl to given acl\n",
196 ((other_type
== SMB_ACL_TYPE_ACCESS
)
199 if (!solaris_add_to_acl(&solaris_acl
, &count
, other_acl
,
200 other_count
, other_type
))
202 DEBUG(10, ("error adding other acl.\n"));
203 SAFE_FREE(other_acl
);
206 SAFE_FREE(other_acl
);
208 else if (type
!= SMB_ACL_TYPE_ACCESS
) {
213 if (!solaris_acl_sort(solaris_acl
, count
)) {
214 DEBUG(10, ("resulting acl is not valid!\n"));
218 ret
= acl(name
, SETACL
, count
, solaris_acl
);
221 DEBUG(10, ("solarisacl_sys_acl_set_file %s.\n",
222 ((ret
!= 0) ? "failed" : "succeeded")));
223 SAFE_FREE(solaris_acl
);
228 * set the access ACL on the file referred to by a fd
230 int solarisacl_sys_acl_set_fd(vfs_handle_struct
*handle
,
234 SOLARIS_ACL_T solaris_acl
= NULL
;
235 SOLARIS_ACL_T default_acl
= NULL
;
236 int count
, default_count
;
239 DEBUG(10, ("entering solarisacl_sys_acl_set_fd\n"));
242 * the posix acl_set_fd call sets the access acl of the
243 * file referred to by fd. the solaris facl-SETACL call
244 * sets the access and default acl as provided, so we
245 * have to retrieve the default acl of the file and
246 * concatenate it with the access acl provided.
248 if (!smb_acl_to_solaris_acl(theacl
, &solaris_acl
, &count
,
249 SMB_ACL_TYPE_ACCESS
))
251 DEBUG(10, ("conversion smb_acl -> solaris_acl failed (%s).\n",
255 if (!solaris_acl_get_fd(fsp
->fh
->fd
, &default_acl
, &default_count
)) {
256 DEBUG(10, ("error getting (default) acl from fd\n"));
259 if (!solaris_add_to_acl(&solaris_acl
, &count
,
260 default_acl
, default_count
,
261 SMB_ACL_TYPE_DEFAULT
))
263 DEBUG(10, ("error adding default acl to solaris acl\n"));
266 if (!solaris_acl_sort(solaris_acl
, count
)) {
267 DEBUG(10, ("resulting acl is not valid!\n"));
271 ret
= facl(fsp
->fh
->fd
, SETACL
, count
, solaris_acl
);
273 DEBUG(10, ("call of facl failed (%s).\n", strerror(errno
)));
277 DEBUG(10, ("solarisacl_sys_acl_set_fd %s.\n",
278 ((ret
== 0) ? "succeeded" : "failed" )));
279 SAFE_FREE(solaris_acl
);
280 SAFE_FREE(default_acl
);
285 * delete the default ACL of a directory
287 * This is achieved by fetching the access ACL and rewriting it
288 * directly, via the solaris system call: the SETACL call on
289 * directories writes both the access and the default ACL as provided.
291 * XXX: posix acl_delete_def_file returns an error if
292 * the file referred to by path is not a directory.
293 * this function does not complain but the actions
294 * have no effect on a file other than a directory.
295 * But sys_acl_delete_default_file is only called in
296 * smbd/posixacls.c after having checked that the file
297 * is a directory, anyways. So implementing the extra
298 * check is considered unnecessary. --- Agreed? XXX
300 int solarisacl_sys_acl_delete_def_file(vfs_handle_struct
*handle
,
305 SOLARIS_ACL_T solaris_acl
= NULL
;
308 DEBUG(10, ("entering solarisacl_sys_acl_delete_def_file.\n"));
310 smb_acl
= solarisacl_sys_acl_get_file(handle
, path
,
311 SMB_ACL_TYPE_ACCESS
, talloc_tos());
312 if (smb_acl
== NULL
) {
313 DEBUG(10, ("getting file acl failed!\n"));
316 if (!smb_acl_to_solaris_acl(smb_acl
, &solaris_acl
, &count
,
317 SMB_ACL_TYPE_ACCESS
))
319 DEBUG(10, ("conversion smb_acl -> solaris_acl failed.\n"));
322 if (!solaris_acl_sort(solaris_acl
, count
)) {
323 DEBUG(10, ("resulting acl is not valid!\n"));
326 ret
= acl(path
, SETACL
, count
, solaris_acl
);
328 DEBUG(10, ("settinge file acl failed!\n"));
332 DEBUG(10, ("solarisacl_sys_acl_delete_def_file %s.\n",
333 ((ret
!= 0) ? "failed" : "succeeded" )));
334 TALLOC_FREE(smb_acl
);
339 /* private functions */
341 static SOLARIS_ACL_T
solaris_acl_init(int count
)
343 SOLARIS_ACL_T solaris_acl
=
344 (SOLARIS_ACL_T
)SMB_MALLOC(sizeof(aclent_t
) * count
);
345 if (solaris_acl
== NULL
) {
352 * Convert the SMB acl to the ACCESS or DEFAULT part of a
353 * solaris ACL, as desired.
355 static bool smb_acl_to_solaris_acl(SMB_ACL_T smb_acl
,
356 SOLARIS_ACL_T
*solaris_acl
, int *count
,
362 DEBUG(10, ("entering smb_acl_to_solaris_acl\n"));
367 for (i
= 0; i
< smb_acl
->count
; i
++) {
368 const struct smb_acl_entry
*smb_entry
= &(smb_acl
->acl
[i
]);
369 SOLARIS_ACE_T solaris_entry
;
371 ZERO_STRUCT(solaris_entry
);
373 solaris_entry
.a_type
= smb_tag_to_solaris_tag(smb_entry
->a_type
);
374 if (solaris_entry
.a_type
== 0) {
375 DEBUG(10, ("smb_tag to solaris_tag failed\n"));
378 switch(solaris_entry
.a_type
) {
380 DEBUG(10, ("got tag type USER with uid %u\n",
381 (unsigned int)smb_entry
->info
.user
.uid
));
382 solaris_entry
.a_id
= (uid_t
)smb_entry
->info
.user
.uid
;
385 DEBUG(10, ("got tag type GROUP with gid %u\n",
386 (unsigned int)smb_entry
->info
.group
.gid
));
387 solaris_entry
.a_id
= (uid_t
)smb_entry
->info
.group
.gid
;
392 if (type
== SMB_ACL_TYPE_DEFAULT
) {
393 DEBUG(10, ("adding default bit to solaris ace\n"));
394 solaris_entry
.a_type
|= ACL_DEFAULT
;
397 solaris_entry
.a_perm
=
398 smb_perm_to_solaris_perm(smb_entry
->a_perm
);
399 DEBUG(10, ("assembled the following solaris ace:\n"));
400 DEBUGADD(10, (" - type: 0x%04x\n", solaris_entry
.a_type
));
401 DEBUGADD(10, (" - id: %u\n", (unsigned int)solaris_entry
.a_id
));
402 DEBUGADD(10, (" - perm: o%o\n", solaris_entry
.a_perm
));
403 if (!solaris_add_to_acl(solaris_acl
, count
, &solaris_entry
,
406 DEBUG(10, ("error adding acl entry\n"));
409 DEBUG(10, ("count after adding: %d (i: %d)\n", *count
, i
));
410 DEBUG(10, ("test, if entry has been copied into acl:\n"));
411 DEBUGADD(10, (" - type: 0x%04x\n",
412 (*solaris_acl
)[(*count
)-1].a_type
));
413 DEBUGADD(10, (" - id: %u\n",
414 (unsigned int)(*solaris_acl
)[(*count
)-1].a_id
));
415 DEBUGADD(10, (" - perm: o%o\n",
416 (*solaris_acl
)[(*count
)-1].a_perm
));
423 SAFE_FREE(*solaris_acl
);
425 DEBUG(10, ("smb_acl_to_solaris_acl %s\n",
426 ((ret
== True
) ? "succeeded" : "failed")));
431 * convert either the access or the default part of a
432 * soaris acl to the SMB_ACL format.
434 static SMB_ACL_T
solaris_acl_to_smb_acl(SOLARIS_ACL_T solaris_acl
, int count
,
435 SMB_ACL_TYPE_T type
, TALLOC_CTX
*mem_ctx
)
440 if ((result
= sys_acl_init(mem_ctx
)) == NULL
) {
441 DEBUG(10, ("error allocating memory for SMB_ACL\n"));
444 for (i
= 0; i
< count
; i
++) {
445 SMB_ACL_ENTRY_T smb_entry
;
446 SMB_ACL_PERM_T smb_perm
;
448 if (!_IS_OF_TYPE(solaris_acl
[i
], type
)) {
451 result
->acl
= talloc_realloc(result
, result
->acl
, struct smb_acl_entry
, result
->count
+ 1);
452 if (result
->acl
== NULL
) {
453 DEBUG(10, ("error reallocating memory for SMB_ACL\n"));
456 smb_entry
= &result
->acl
[result
->count
];
457 if (sys_acl_set_tag_type(smb_entry
,
458 solaris_tag_to_smb_tag(solaris_acl
[i
].a_type
)) != 0)
460 DEBUG(10, ("invalid tag type given: 0x%04x\n",
461 solaris_acl
[i
].a_type
));
464 /* intentionally not checking return code here: */
465 sys_acl_set_qualifier(smb_entry
, (void *)&solaris_acl
[i
].a_id
);
466 smb_perm
= solaris_perm_to_smb_perm(solaris_acl
[i
].a_perm
);
467 if (sys_acl_set_permset(smb_entry
, &smb_perm
) != 0) {
468 DEBUG(10, ("invalid permset given: %d\n",
469 solaris_acl
[i
].a_perm
));
479 DEBUG(10, ("solaris_acl_to_smb_acl %s\n",
480 ((result
== NULL
) ? "failed" : "succeeded")));
486 static SOLARIS_ACL_TAG_T
smb_tag_to_solaris_tag(SMB_ACL_TAG_T smb_tag
)
488 SOLARIS_ACL_TAG_T solaris_tag
= 0;
490 DEBUG(10, ("smb_tag_to_solaris_tag\n"));
491 DEBUGADD(10, (" --> got smb tag 0x%04x\n", smb_tag
));
497 case SMB_ACL_USER_OBJ
:
498 solaris_tag
= USER_OBJ
;
503 case SMB_ACL_GROUP_OBJ
:
504 solaris_tag
= GROUP_OBJ
;
507 solaris_tag
= OTHER_OBJ
;
510 solaris_tag
= CLASS_OBJ
;
513 DEBUGADD(10, (" !!! unknown smb tag type 0x%04x\n", smb_tag
));
517 DEBUGADD(10, (" --> determined solaris tag 0x%04x\n", solaris_tag
));
522 static SMB_ACL_TAG_T
solaris_tag_to_smb_tag(SOLARIS_ACL_TAG_T solaris_tag
)
524 SMB_ACL_TAG_T smb_tag
= 0;
526 DEBUG(10, ("solaris_tag_to_smb_tag:\n"));
527 DEBUGADD(10, (" --> got solaris tag 0x%04x\n", solaris_tag
));
529 solaris_tag
&= ~ACL_DEFAULT
;
531 switch (solaris_tag
) {
533 smb_tag
= SMB_ACL_USER
;
536 smb_tag
= SMB_ACL_USER_OBJ
;
539 smb_tag
= SMB_ACL_GROUP
;
542 smb_tag
= SMB_ACL_GROUP_OBJ
;
545 smb_tag
= SMB_ACL_OTHER
;
548 smb_tag
= SMB_ACL_MASK
;
551 DEBUGADD(10, (" !!! unknown solaris tag type: 0x%04x\n",
556 DEBUGADD(10, (" --> determined smb tag 0x%04x\n", smb_tag
));
562 static SMB_ACL_PERM_T
solaris_perm_to_smb_perm(const SOLARIS_PERM_T perm
)
564 SMB_ACL_PERM_T smb_perm
= 0;
565 smb_perm
|= ((perm
& SMB_ACL_READ
) ? SMB_ACL_READ
: 0);
566 smb_perm
|= ((perm
& SMB_ACL_WRITE
) ? SMB_ACL_WRITE
: 0);
567 smb_perm
|= ((perm
& SMB_ACL_EXECUTE
) ? SMB_ACL_EXECUTE
: 0);
572 static SOLARIS_PERM_T
smb_perm_to_solaris_perm(const SMB_ACL_PERM_T perm
)
574 SOLARIS_PERM_T solaris_perm
= 0;
575 solaris_perm
|= ((perm
& SMB_ACL_READ
) ? SMB_ACL_READ
: 0);
576 solaris_perm
|= ((perm
& SMB_ACL_WRITE
) ? SMB_ACL_WRITE
: 0);
577 solaris_perm
|= ((perm
& SMB_ACL_EXECUTE
) ? SMB_ACL_EXECUTE
: 0);
582 static bool solaris_acl_get_file(const char *name
, SOLARIS_ACL_T
*solaris_acl
,
587 DEBUG(10, ("solaris_acl_get_file called for file '%s'\n", name
));
590 * The original code tries some INITIAL_ACL_SIZE
591 * and only did the GETACLCNT call upon failure
592 * (for performance reasons).
593 * For the sake of simplicity, I skip this for now.
595 *count
= acl(name
, GETACLCNT
, 0, NULL
);
597 DEBUG(10, ("acl GETACLCNT failed: %s\n", strerror(errno
)));
600 *solaris_acl
= solaris_acl_init(*count
);
601 if (*solaris_acl
== NULL
) {
602 DEBUG(10, ("error allocating memory for solaris acl...\n"));
605 *count
= acl(name
, GETACL
, *count
, *solaris_acl
);
607 DEBUG(10, ("acl GETACL failed: %s\n", strerror(errno
)));
613 DEBUG(10, ("solaris_acl_get_file %s.\n",
614 ((result
== True
) ? "succeeded" : "failed" )));
619 static bool solaris_acl_get_fd(int fd
, SOLARIS_ACL_T
*solaris_acl
, int *count
)
623 DEBUG(10, ("entering solaris_acl_get_fd\n"));
626 * see solaris_acl_get_file for comment about omission
627 * of INITIAL_ACL_SIZE...
629 *count
= facl(fd
, GETACLCNT
, 0, NULL
);
631 DEBUG(10, ("facl GETACLCNT failed: %s\n", strerror(errno
)));
634 *solaris_acl
= solaris_acl_init(*count
);
635 if (*solaris_acl
== NULL
) {
636 DEBUG(10, ("error allocating memory for solaris acl...\n"));
639 *count
= facl(fd
, GETACL
, *count
, *solaris_acl
);
641 DEBUG(10, ("facl GETACL failed: %s\n", strerror(errno
)));
647 DEBUG(10, ("solaris_acl_get_fd %s\n",
648 ((ret
== True
) ? "succeeded" : "failed")));
655 * Add entries to a solaris ACL.
657 * Entries are directly added to the solarisacl parameter.
658 * if memory allocation fails, this may result in solarisacl
659 * being NULL. if the resulting acl is to be checked and is
660 * not valid, it is kept in solarisacl but False is returned.
662 * The type of ACEs (access/default) to be added to the ACL can
663 * be selected via the type parameter.
664 * I use the SMB_ACL_TYPE_T type here. Since SMB_ACL_TYPE_ACCESS
665 * is defined as "0", this means that one can only add either
666 * access or default ACEs, not both at the same time. If it
667 * should become necessary to add all of an ACL, one would have
668 * to replace this parameter by another type.
670 static bool solaris_add_to_acl(SOLARIS_ACL_T
*solaris_acl
, int *count
,
671 SOLARIS_ACL_T add_acl
, int add_count
,
676 if ((type
!= SMB_ACL_TYPE_ACCESS
) && (type
!= SMB_ACL_TYPE_DEFAULT
))
678 DEBUG(10, ("invalid acl type given: %d\n", type
));
682 for (i
= 0; i
< add_count
; i
++) {
683 if (!_IS_OF_TYPE(add_acl
[i
], type
)) {
686 ADD_TO_ARRAY(NULL
, SOLARIS_ACE_T
, add_acl
[i
],
688 if (solaris_acl
== NULL
) {
689 DEBUG(10, ("error enlarging acl.\n"));
699 * sort the ACL and check it for validity
701 * [original comment from lib/sysacls.c:]
703 * if it's a minimal ACL with only 4 entries then we
704 * need to recalculate the mask permissions to make
705 * sure that they are the same as the GROUP_OBJ
706 * permissions as required by the UnixWare acl() system call.
708 * (note: since POSIX allows minimal ACLs which only contain
709 * 3 entries - ie there is no mask entry - we should, in theory,
710 * check for this and add a mask entry if necessary - however
711 * we "know" that the caller of this interface always specifies
712 * a mask, so in practice "this never happens" (tm) - if it *does*
713 * happen aclsort() will fail and return an error and someone will
716 static bool solaris_acl_sort(SOLARIS_ACL_T solaris_acl
, int count
)
718 int fixmask
= (count
<= 4);
720 if (aclsort(count
, fixmask
, solaris_acl
) != 0) {
729 * acl check function:
730 * unused at the moment but could be used to get more
731 * concrete error messages for debugging...
732 * (acl sort just says that the acl is invalid...)
734 static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl
, int count
)
739 check_rc
= aclcheck(solaris_acl
, count
, &check_which
);
741 DEBUG(10, ("acl is not valid:\n"));
742 DEBUGADD(10, (" - return code: %d\n", check_rc
));
743 DEBUGADD(10, (" - which: %d\n", check_which
));
744 if (check_which
!= -1) {
745 DEBUGADD(10, (" - invalid entry:\n"));
746 DEBUGADD(10, (" * type: %d:\n",
747 solaris_acl
[check_which
].a_type
));
748 DEBUGADD(10, (" * id: %d\n",
749 solaris_acl
[check_which
].a_id
));
750 DEBUGADD(10, (" * perm: 0o%o\n",
751 solaris_acl
[check_which
].a_perm
));
759 static struct vfs_fn_pointers solarisacl_fns
= {
760 .sys_acl_get_file_fn
= solarisacl_sys_acl_get_file
,
761 .sys_acl_get_fd_fn
= solarisacl_sys_acl_get_fd
,
762 .sys_acl_blob_get_file_fn
= posix_sys_acl_blob_get_file
,
763 .sys_acl_blob_get_fd_fn
= posix_sys_acl_blob_get_fd
,
764 .sys_acl_set_file_fn
= solarisacl_sys_acl_set_file
,
765 .sys_acl_set_fd_fn
= solarisacl_sys_acl_set_fd
,
766 .sys_acl_delete_def_file_fn
= solarisacl_sys_acl_delete_def_file
,
769 NTSTATUS
vfs_solarisacl_init(void);
770 NTSTATUS
vfs_solarisacl_init(void)
772 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION
, "solarisacl",