2 * Copyright (C) Ralph Boehme 2018
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 #include "smbd/proto.h"
21 #include "libcli/security/security_descriptor.h"
24 /* <rpc/xdr.h> uses TRUE and FALSE */
33 #include "nfs4_acls.h"
35 #include "nfs4acl_xattr_util.h"
38 #define DBGC_CLASS DBGC_VFS
40 unsigned smb4acl_to_nfs4acl_flags(uint16_t smb4acl_flags
)
42 unsigned nfs4acl_flags
= 0;
44 if (smb4acl_flags
& SEC_DESC_DACL_AUTO_INHERITED
) {
45 nfs4acl_flags
|= ACL4_AUTO_INHERIT
;
47 if (smb4acl_flags
& SEC_DESC_DACL_PROTECTED
) {
48 nfs4acl_flags
|= ACL4_PROTECTED
;
50 if (smb4acl_flags
& SEC_DESC_DACL_DEFAULTED
) {
51 nfs4acl_flags
|= ACL4_DEFAULTED
;
57 uint16_t nfs4acl_to_smb4acl_flags(unsigned nfsacl41_flags
)
59 uint16_t smb4acl_flags
= SEC_DESC_SELF_RELATIVE
;
61 if (nfsacl41_flags
& ACL4_AUTO_INHERIT
) {
62 smb4acl_flags
|= SEC_DESC_DACL_AUTO_INHERITED
;
64 if (nfsacl41_flags
& ACL4_PROTECTED
) {
65 smb4acl_flags
|= SEC_DESC_DACL_PROTECTED
;
67 if (nfsacl41_flags
& ACL4_DEFAULTED
) {
68 smb4acl_flags
|= SEC_DESC_DACL_DEFAULTED
;
73 #endif /* HAVE_RPC_XDR_H */