2 * Store Windows ACLs in a tdb.
4 * Copyright (C) Volker Lendecke, 2008
5 * Copyright (C) Jeremy Allison, 2008
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see <http://www.gnu.org/licenses/>.
21 /* NOTE: This is an experimental module, not yet finished. JRA. */
24 #include "librpc/gen_ndr/xattr.h"
25 #include "librpc/gen_ndr/ndr_xattr.h"
28 #define DBGC_CLASS DBGC_VFS
30 static unsigned int ref_count;
31 static struct db_context *acl_db;
33 /*******************************************************************
34 Open acl_db if not already open, increment ref count.
35 *******************************************************************/
37 static bool acl_tdb_init(struct db_context **pp_db)
47 dbname = state_path("file_ntacls.tdb");
55 *pp_db = db_open(NULL, dbname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600);
73 /*******************************************************************
74 Lower ref count and close acl_db if zero.
75 *******************************************************************/
77 static void free_acl_tdb_data(void **pptr)
79 struct db_context **pp_db = (struct db_context **)pptr;
88 /*******************************************************************
89 Fetch_lock the tdb acl record for a file
90 *******************************************************************/
92 static struct db_record *acl_tdb_lock(TALLOC_CTX *mem_ctx,
93 struct db_context *db,
94 const struct file_id *id)
97 push_file_id_16((char *)id_buf, id);
98 return db->fetch_locked(db,
100 make_tdb_data(id_buf,
104 /*******************************************************************
105 Delete the tdb acl record for a file
106 *******************************************************************/
108 static NTSTATUS acl_tdb_delete(vfs_handle_struct *handle,
109 struct db_context *db,
110 SMB_STRUCT_STAT *psbuf)
113 struct file_id id = vfs_file_id_from_sbuf(handle->conn, psbuf);
114 struct db_record *rec = acl_tdb_lock(talloc_tos(), db, &id);
117 * If rec == NULL there's not much we can do about it
121 DEBUG(10,("acl_tdb_delete: rec == NULL\n"));
126 status = rec->delete_rec(rec);
131 /*******************************************************************
132 Parse out a struct security_descriptor from a DATA_BLOB.
133 *******************************************************************/
135 static NTSTATUS parse_acl_blob(const DATA_BLOB *pblob,
136 uint32 security_info,
137 struct security_descriptor **ppdesc)
139 TALLOC_CTX *ctx = talloc_tos();
140 struct xattr_NTACL xacl;
141 enum ndr_err_code ndr_err;
144 ndr_err = ndr_pull_struct_blob(pblob, ctx, NULL, &xacl,
145 (ndr_pull_flags_fn_t)ndr_pull_xattr_NTACL);
147 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
148 DEBUG(5, ("parse_acl_blob: ndr_pull_xattr_NTACL failed: %s\n",
149 ndr_errstr(ndr_err)));
150 return ndr_map_error2ntstatus(ndr_err);;
153 if (xacl.version != 2) {
154 return NT_STATUS_REVISION_MISMATCH;
157 *ppdesc = make_sec_desc(ctx, SEC_DESC_REVISION, xacl.info.sd_hs->sd->type | SEC_DESC_SELF_RELATIVE,
158 (security_info & OWNER_SECURITY_INFORMATION)
159 ? xacl.info.sd_hs->sd->owner_sid : NULL,
160 (security_info & GROUP_SECURITY_INFORMATION)
161 ? xacl.info.sd_hs->sd->group_sid : NULL,
162 (security_info & SACL_SECURITY_INFORMATION)
163 ? xacl.info.sd_hs->sd->sacl : NULL,
164 (security_info & DACL_SECURITY_INFORMATION)
165 ? xacl.info.sd_hs->sd->dacl : NULL,
168 TALLOC_FREE(xacl.info.sd);
170 return (*ppdesc != NULL) ? NT_STATUS_OK : NT_STATUS_NO_MEMORY;
173 /*******************************************************************
174 Pull a security descriptor into a DATA_BLOB from a tdb store.
175 *******************************************************************/
177 static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
178 vfs_handle_struct *handle,
186 struct db_context *db;
187 SMB_STRUCT_STAT sbuf;
189 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
190 return NT_STATUS_INTERNAL_DB_CORRUPTION);
192 if (fsp && fsp->fh->fd != -1) {
193 if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
194 return map_nt_error_from_unix(errno);
197 if (SMB_VFS_STAT(handle->conn, name, &sbuf) == -1) {
198 return map_nt_error_from_unix(errno);
201 id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
203 push_file_id_16((char *)id_buf, &id);
207 make_tdb_data(id_buf, sizeof(id_buf)),
209 return NT_STATUS_INTERNAL_DB_CORRUPTION;
212 pblob->data = data.dptr;
213 pblob->length = data.dsize;
215 DEBUG(10,("get_acl_blob: returned %u bytes from file %s\n",
216 (unsigned int)data.dsize, name ));
218 if (pblob->length == 0 || pblob->data == NULL) {
219 return NT_STATUS_OBJECT_NAME_NOT_FOUND;
224 /*******************************************************************
225 Create a DATA_BLOB from a security descriptor.
226 *******************************************************************/
228 static NTSTATUS create_acl_blob(const struct security_descriptor *psd, DATA_BLOB *pblob)
230 struct xattr_NTACL xacl;
231 struct security_descriptor_hash sd_hs;
232 enum ndr_err_code ndr_err;
233 TALLOC_CTX *ctx = talloc_tos();
239 xacl.info.sd_hs = &sd_hs;
240 xacl.info.sd_hs->sd = CONST_DISCARD(struct security_descriptor *, psd);
241 memset(&xacl.info.sd_hs->hash[0], '\0', 16);
243 ndr_err = ndr_push_struct_blob(
244 pblob, ctx, NULL, &xacl,
245 (ndr_push_flags_fn_t)ndr_push_xattr_NTACL);
247 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
248 DEBUG(5, ("create_acl_blob: ndr_push_xattr_NTACL failed: %s\n",
249 ndr_errstr(ndr_err)));
250 return ndr_map_error2ntstatus(ndr_err);;
256 /*******************************************************************
257 Store a DATA_BLOB into a tdb record given an fsp pointer.
258 *******************************************************************/
260 static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
266 SMB_STRUCT_STAT sbuf;
268 struct db_context *db;
269 struct db_record *rec;
271 DEBUG(10,("store_acl_blob_fsp: storing blob length %u on file %s\n",
272 (unsigned int)pblob->length, fsp->fsp_name));
274 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
275 return NT_STATUS_INTERNAL_DB_CORRUPTION);
277 if (fsp->fh->fd != -1) {
278 if (SMB_VFS_FSTAT(fsp, &sbuf) == -1) {
279 return map_nt_error_from_unix(errno);
282 if (SMB_VFS_STAT(handle->conn, fsp->fsp_name, &sbuf) == -1) {
283 return map_nt_error_from_unix(errno);
286 id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
288 push_file_id_16((char *)id_buf, &id);
289 rec = db->fetch_locked(db, talloc_tos(),
290 make_tdb_data(id_buf,
293 DEBUG(0, ("store_acl_blob_fsp_tdb: fetch_lock failed\n"));
294 return NT_STATUS_INTERNAL_DB_CORRUPTION;
296 data.dptr = pblob->data;
297 data.dsize = pblob->length;
298 return rec->store(rec, data, 0);
301 /*******************************************************************
302 Store a DATA_BLOB into a tdb record given a pathname.
303 *******************************************************************/
305 static NTSTATUS store_acl_blob_pathname(vfs_handle_struct *handle,
312 SMB_STRUCT_STAT sbuf;
313 struct db_context *db;
314 struct db_record *rec;
316 DEBUG(10,("store_acl_blob_pathname: storing blob "
317 "length %u on file %s\n",
318 (unsigned int)pblob->length, fname));
320 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
321 return NT_STATUS_INTERNAL_DB_CORRUPTION);
323 if (SMB_VFS_STAT(handle->conn, fname, &sbuf) == -1) {
324 return map_nt_error_from_unix(errno);
327 id = vfs_file_id_from_sbuf(handle->conn, &sbuf);
328 push_file_id_16((char *)id_buf, &id);
330 rec = db->fetch_locked(db, talloc_tos(),
331 make_tdb_data(id_buf,
334 DEBUG(0, ("store_acl_blob_pathname_tdb: fetch_lock failed\n"));
335 return NT_STATUS_INTERNAL_DB_CORRUPTION;
337 data.dptr = pblob->data;
338 data.dsize = pblob->length;
339 return rec->store(rec, data, 0);
342 /*******************************************************************
343 Store a DATA_BLOB into an tdb given a pathname.
344 *******************************************************************/
346 static NTSTATUS get_nt_acl_tdb_internal(vfs_handle_struct *handle,
349 uint32 security_info,
350 struct security_descriptor **ppdesc)
352 TALLOC_CTX *ctx = talloc_tos();
356 if (fsp && name == NULL) {
357 name = fsp->fsp_name;
360 DEBUG(10, ("get_nt_acl_tdb_internal: name=%s\n", name));
362 status = get_acl_blob(ctx, handle, fsp, name, &blob);
363 if (!NT_STATUS_IS_OK(status)) {
364 DEBUG(10, ("get_acl_blob returned %s\n", nt_errstr(status)));
368 status = parse_acl_blob(&blob, security_info, ppdesc);
369 if (!NT_STATUS_IS_OK(status)) {
370 DEBUG(10, ("parse_acl_blob returned %s\n",
375 TALLOC_FREE(blob.data);
379 /*********************************************************************
380 Create a default security descriptor for a file in case no inheritance
381 exists. All permissions to the owner and SYSTEM.
382 *********************************************************************/
384 static struct security_descriptor *default_file_sd(TALLOC_CTX *mem_ctx,
385 SMB_STRUCT_STAT *psbuf)
387 struct dom_sid owner_sid, group_sid;
389 struct security_ace *pace = NULL;
390 struct security_acl *pacl = NULL;
392 uid_to_sid(&owner_sid, psbuf->st_uid);
393 gid_to_sid(&group_sid, psbuf->st_gid);
395 pace = TALLOC_ARRAY(mem_ctx, struct security_ace, 2);
400 init_sec_ace(&pace[0], &owner_sid, SEC_ACE_TYPE_ACCESS_ALLOWED,
401 SEC_RIGHTS_FILE_ALL, 0);
402 init_sec_ace(&pace[1], &global_sid_System, SEC_ACE_TYPE_ACCESS_ALLOWED,
403 SEC_RIGHTS_FILE_ALL, 0);
405 pacl = make_sec_acl(mem_ctx,
412 return make_sec_desc(mem_ctx,
413 SECURITY_DESCRIPTOR_REVISION_1,
414 SEC_DESC_SELF_RELATIVE|SEC_DESC_DACL_PRESENT,
422 /*********************************************************************
423 *********************************************************************/
425 static NTSTATUS inherit_new_acl(vfs_handle_struct *handle,
430 TALLOC_CTX *ctx = talloc_tos();
432 struct security_descriptor *parent_desc = NULL;
433 struct security_descriptor *psd = NULL;
438 if (!parent_dirname(ctx, fname, &parent_name, NULL)) {
439 return NT_STATUS_NO_MEMORY;
442 DEBUG(10,("inherit_new_acl: check directory %s\n",
445 status = get_nt_acl_tdb_internal(handle,
448 (OWNER_SECURITY_INFORMATION |
449 GROUP_SECURITY_INFORMATION |
450 DACL_SECURITY_INFORMATION),
452 if (NT_STATUS_IS_OK(status)) {
453 /* Create an inherited descriptor from the parent. */
455 if (DEBUGLEVEL >= 10) {
456 DEBUG(10,("inherit_new_acl: parent acl is:\n"));
457 NDR_PRINT_DEBUG(security_descriptor, parent_desc);
460 status = se_create_child_secdesc(ctx,
464 &handle->conn->server_info->ptok->user_sids[PRIMARY_USER_SID_INDEX],
465 &handle->conn->server_info->ptok->user_sids[PRIMARY_GROUP_SID_INDEX],
467 if (!NT_STATUS_IS_OK(status)) {
471 if (DEBUGLEVEL >= 10) {
472 DEBUG(10,("inherit_new_acl: child acl is:\n"));
473 NDR_PRINT_DEBUG(security_descriptor, psd);
477 DEBUG(10,("inherit_new_acl: directory %s failed "
480 nt_errstr(status) ));
483 if (!psd || psd->dacl == NULL) {
484 SMB_STRUCT_STAT sbuf;
488 if (fsp && !fsp->is_directory && fsp->fh->fd != -1) {
489 ret = SMB_VFS_FSTAT(fsp, &sbuf);
491 ret = SMB_VFS_STAT(handle->conn,fname, &sbuf);
494 return map_nt_error_from_unix(errno);
496 psd = default_file_sd(ctx, &sbuf);
498 return NT_STATUS_NO_MEMORY;
501 if (DEBUGLEVEL >= 10) {
502 DEBUG(10,("inherit_new_acl: default acl is:\n"));
503 NDR_PRINT_DEBUG(security_descriptor, psd);
507 status = create_acl_blob(psd, &blob);
508 if (!NT_STATUS_IS_OK(status)) {
512 return store_acl_blob_fsp(handle, fsp, &blob);
514 return store_acl_blob_pathname(handle, fname, &blob);
518 /*********************************************************************
519 Check ACL on open. For new files inherit from parent directory.
520 *********************************************************************/
522 static int open_acl_tdb(vfs_handle_struct *handle,
528 uint32_t access_granted = 0;
529 struct security_descriptor *pdesc = NULL;
530 bool file_existed = true;
531 NTSTATUS status = get_nt_acl_tdb_internal(handle,
534 (OWNER_SECURITY_INFORMATION |
535 GROUP_SECURITY_INFORMATION |
536 DACL_SECURITY_INFORMATION),
538 if (NT_STATUS_IS_OK(status)) {
539 /* See if we can access it. */
540 status = smb1_file_se_access_check(pdesc,
541 handle->conn->server_info->ptok,
544 if (!NT_STATUS_IS_OK(status)) {
545 DEBUG(10,("open_acl_tdb: file %s open "
546 "refused with error %s\n",
548 nt_errstr(status) ));
549 errno = map_errno_from_nt_status(status);
552 } else if (NT_STATUS_EQUAL(status,NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
553 file_existed = false;
556 DEBUG(10,("open_acl_tdb: get_nt_acl_attr_internal for "
557 "file %s returned %s\n",
559 nt_errstr(status) ));
561 fsp->fh->fd = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
563 if (!file_existed && fsp->fh->fd != -1) {
564 /* File was created. Inherit from parent directory. */
565 string_set(&fsp->fsp_name, fname);
566 inherit_new_acl(handle, fname, fsp, false);
572 /*********************************************************************
573 On unlink we need to delete the tdb record (if using tdb).
574 *********************************************************************/
576 static int unlink_acl_tdb(vfs_handle_struct *handle, const char *path)
578 SMB_STRUCT_STAT sbuf;
579 struct db_context *db;
582 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
584 if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
588 ret = SMB_VFS_NEXT_UNLINK(handle, path);
594 acl_tdb_delete(handle, db, &sbuf);
598 /*********************************************************************
599 Store an inherited SD on mkdir.
600 *********************************************************************/
602 static int mkdir_acl_tdb(vfs_handle_struct *handle, const char *path, mode_t mode)
604 int ret = SMB_VFS_NEXT_MKDIR(handle, path, mode);
609 /* New directory - inherit from parent. */
610 inherit_new_acl(handle, path, NULL, true);
614 /*********************************************************************
615 On rmdir we need to delete the tdb record (if using tdb).
616 *********************************************************************/
618 static int rmdir_acl_tdb(vfs_handle_struct *handle, const char *path)
621 SMB_STRUCT_STAT sbuf;
622 struct db_context *db;
625 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
627 if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
631 ret = SMB_VFS_NEXT_RMDIR(handle, path);
636 acl_tdb_delete(handle, db, &sbuf);
640 /*********************************************************************
641 Fetch a security descriptor given an fsp.
642 *********************************************************************/
644 static NTSTATUS fget_nt_acl_tdb(vfs_handle_struct *handle, files_struct *fsp,
645 uint32 security_info, struct security_descriptor **ppdesc)
647 NTSTATUS status = get_nt_acl_tdb_internal(handle, fsp,
648 NULL, security_info, ppdesc);
649 if (NT_STATUS_IS_OK(status)) {
650 if (DEBUGLEVEL >= 10) {
651 DEBUG(10,("fget_nt_acl_tdb: returning tdb sd for file %s\n",
653 NDR_PRINT_DEBUG(security_descriptor, *ppdesc);
658 DEBUG(10,("fget_nt_acl_tdb: failed to get tdb sd for file %s, Error %s\n",
660 nt_errstr(status) ));
662 return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp,
663 security_info, ppdesc);
666 /*********************************************************************
667 Fetch a security descriptor given a pathname.
668 *********************************************************************/
670 static NTSTATUS get_nt_acl_tdb(vfs_handle_struct *handle,
671 const char *name, uint32 security_info, struct security_descriptor **ppdesc)
673 NTSTATUS status = get_nt_acl_tdb_internal(handle, NULL,
674 name, security_info, ppdesc);
675 if (NT_STATUS_IS_OK(status)) {
676 if (DEBUGLEVEL >= 10) {
677 DEBUG(10,("get_nt_acl_tdb: returning tdb sd for file %s\n",
679 NDR_PRINT_DEBUG(security_descriptor, *ppdesc);
684 DEBUG(10,("get_nt_acl_tdb: failed to get tdb sd for file %s, Error %s\n",
686 nt_errstr(status) ));
688 return SMB_VFS_NEXT_GET_NT_ACL(handle, name,
689 security_info, ppdesc);
692 /*********************************************************************
693 Store a security descriptor given an fsp.
694 *********************************************************************/
696 static NTSTATUS fset_nt_acl_tdb(vfs_handle_struct *handle, files_struct *fsp,
697 uint32 security_info_sent, const struct security_descriptor *psd)
702 if (DEBUGLEVEL >= 10) {
703 DEBUG(10,("fset_nt_acl_tdb: incoming sd for file %s\n",
705 NDR_PRINT_DEBUG(security_descriptor,
706 CONST_DISCARD(struct security_descriptor *,psd));
709 status = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
710 if (!NT_STATUS_IS_OK(status)) {
714 /* Ensure owner and group are set. */
715 if (!psd->owner_sid || !psd->group_sid) {
717 SMB_STRUCT_STAT sbuf;
718 DOM_SID owner_sid, group_sid;
719 struct security_descriptor *nc_psd = dup_sec_desc(talloc_tos(), psd);
724 if (fsp->is_directory || fsp->fh->fd == -1) {
725 ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
727 ret = SMB_VFS_FSTAT(fsp, &sbuf);
730 /* Lower level acl set succeeded,
731 * so still return OK. */
734 create_file_sids(&sbuf, &owner_sid, &group_sid);
735 /* This is safe as nc_psd is discarded at fn exit. */
736 nc_psd->owner_sid = &owner_sid;
737 nc_psd->group_sid = &group_sid;
738 security_info_sent |= (OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION);
743 if ((security_info_sent & DACL_SECURITY_INFORMATION) &&
745 (psd->type & (SE_DESC_DACL_AUTO_INHERITED|
746 SE_DESC_DACL_AUTO_INHERIT_REQ))==
747 (SE_DESC_DACL_AUTO_INHERITED|
748 SE_DESC_DACL_AUTO_INHERIT_REQ) ) {
749 struct security_descriptor *new_psd = NULL;
750 status = append_parent_acl(fsp, psd, &new_psd);
751 if (!NT_STATUS_IS_OK(status)) {
752 /* Lower level acl set succeeded,
753 * so still return OK. */
760 if (DEBUGLEVEL >= 10) {
761 DEBUG(10,("fset_nt_acl_tdb: storing tdb sd for file %s\n",
763 NDR_PRINT_DEBUG(security_descriptor,
764 CONST_DISCARD(struct security_descriptor *,psd));
766 create_acl_blob(psd, &blob);
767 store_acl_blob_fsp(handle, fsp, &blob);
772 /*******************************************************************
773 Handle opening the storage tdb if so configured.
774 *******************************************************************/
776 static int connect_acl_tdb(struct vfs_handle_struct *handle,
780 struct db_context *db;
783 res = SMB_VFS_NEXT_CONNECT(handle, service, user);
788 if (!acl_tdb_init(&db)) {
789 SMB_VFS_NEXT_DISCONNECT(handle);
793 SMB_VFS_HANDLE_SET_DATA(handle, db, free_acl_tdb_data,
794 struct db_context, return -1);
799 /*********************************************************************
800 Remove a Windows ACL - we're setting the underlying POSIX ACL.
801 *********************************************************************/
803 static int sys_acl_set_file_tdb(vfs_handle_struct *handle,
808 SMB_STRUCT_STAT sbuf;
809 struct db_context *db;
812 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
814 if (SMB_VFS_STAT(handle->conn, path, &sbuf) == -1) {
818 ret = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle,
826 acl_tdb_delete(handle, db, &sbuf);
830 /*********************************************************************
831 Remove a Windows ACL - we're setting the underlying POSIX ACL.
832 *********************************************************************/
834 static int sys_acl_set_fd_tdb(vfs_handle_struct *handle,
838 SMB_STRUCT_STAT sbuf;
839 struct db_context *db;
842 SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context, return -1);
844 if (fsp->is_directory || fsp->fh->fd == -1) {
845 ret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf);
847 ret = SMB_VFS_FSTAT(fsp, &sbuf);
853 ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle,
860 acl_tdb_delete(handle, db, &sbuf);
864 /* VFS operations structure */
866 static vfs_op_tuple skel_op_tuples[] =
868 {SMB_VFS_OP(connect_acl_tdb), SMB_VFS_OP_CONNECT, SMB_VFS_LAYER_TRANSPARENT},
870 {SMB_VFS_OP(mkdir_acl_tdb), SMB_VFS_OP_MKDIR, SMB_VFS_LAYER_TRANSPARENT},
871 {SMB_VFS_OP(rmdir_acl_tdb), SMB_VFS_OP_RMDIR, SMB_VFS_LAYER_TRANSPARENT},
873 {SMB_VFS_OP(open_acl_tdb), SMB_VFS_OP_OPEN, SMB_VFS_LAYER_TRANSPARENT},
874 {SMB_VFS_OP(unlink_acl_tdb), SMB_VFS_OP_UNLINK, SMB_VFS_LAYER_TRANSPARENT},
876 /* NT File ACL operations */
878 {SMB_VFS_OP(fget_nt_acl_tdb),SMB_VFS_OP_FGET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT},
879 {SMB_VFS_OP(get_nt_acl_tdb), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT},
880 {SMB_VFS_OP(fset_nt_acl_tdb),SMB_VFS_OP_FSET_NT_ACL,SMB_VFS_LAYER_TRANSPARENT},
882 /* POSIX ACL operations. */
883 {SMB_VFS_OP(sys_acl_set_file_tdb), SMB_VFS_OP_SYS_ACL_SET_FILE, SMB_VFS_LAYER_TRANSPARENT},
884 {SMB_VFS_OP(sys_acl_set_fd_tdb), SMB_VFS_OP_SYS_ACL_SET_FD, SMB_VFS_LAYER_TRANSPARENT},
886 {SMB_VFS_OP(NULL), SMB_VFS_OP_NOOP, SMB_VFS_LAYER_NOOP}
889 NTSTATUS vfs_acl_tdb_init(void)
891 return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "acl_tdb", skel_op_tuples);