2 Unix SMB/CIFS implementation.
3 Access Control List handling
4 Copyright (C) Andrew Bartlett 2012.
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/>.
21 #include "../librpc/gen_ndr/ndr_xattr.h"
22 #include "modules/non_posix_acls.h"
24 int non_posix_sys_acl_blob_get_fd_helper(vfs_handle_struct
*handle
,
26 DATA_BLOB acl_as_blob
,
32 struct xattr_sys_acl_hash_wrapper acl_wrapper
;
35 frame
= talloc_stackframe();
37 acl_wrapper
.acl_as_blob
= acl_as_blob
;
39 if (!VALID_STAT(fsp
->fsp_name
->st
)) {
40 ret
= smb_vfs_call_fstat(handle
, fsp
, &sbuf
);
46 sbuf
= fsp
->fsp_name
->st
;
49 acl_wrapper
.owner
= sbuf
.st_ex_uid
;
50 acl_wrapper
.group
= sbuf
.st_ex_gid
;
51 acl_wrapper
.mode
= sbuf
.st_ex_mode
;
53 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_push_struct_blob(blob
, mem_ctx
,
55 (ndr_push_flags_fn_t
)ndr_push_xattr_sys_acl_hash_wrapper
))) {