| 1 | /*
|
|---|
| 2 | * Convert JFS2 NFS4/AIXC acls to NT acls and vice versa.
|
|---|
| 3 | *
|
|---|
| 4 | * Copyright (C) Volker Lendecke, 2006
|
|---|
| 5 | *
|
|---|
| 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.
|
|---|
| 10 | *
|
|---|
| 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.
|
|---|
| 15 | *
|
|---|
| 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/>.
|
|---|
| 18 | */
|
|---|
| 19 |
|
|---|
| 20 | #include "includes.h"
|
|---|
| 21 | #include "system/filesys.h"
|
|---|
| 22 | #include "smbd/smbd.h"
|
|---|
| 23 | #include "nfs4_acls.h"
|
|---|
| 24 |
|
|---|
| 25 | #undef DBGC_CLASS
|
|---|
| 26 | #define DBGC_CLASS DBGC_VFS
|
|---|
| 27 |
|
|---|
| 28 | #define AIXACL2_MODULE_NAME "aixacl2"
|
|---|
| 29 |
|
|---|
| 30 | extern SMB_ACL_T aixacl_to_smbacl( struct acl *file_acl);
|
|---|
| 31 | extern struct acl *aixacl_smb_to_aixacl(SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
|
|---|
| 32 |
|
|---|
| 33 | typedef union aixjfs2_acl_t {
|
|---|
| 34 | nfs4_acl_int_t jfs2_acl[1];
|
|---|
| 35 | aixc_acl_t aixc_acl[1];
|
|---|
| 36 | }AIXJFS2_ACL_T;
|
|---|
| 37 |
|
|---|
| 38 | static int32_t aixacl2_getlen(AIXJFS2_ACL_T *acl, acl_type_t *type)
|
|---|
| 39 | {
|
|---|
| 40 | int32_t len;
|
|---|
| 41 |
|
|---|
| 42 | if(type->u64 == ACL_NFS4) {
|
|---|
| 43 | len = acl->jfs2_acl[0].aclLength;
|
|---|
| 44 | }
|
|---|
| 45 | else {
|
|---|
| 46 | if(type->u64 == ACL_AIXC) {
|
|---|
| 47 | len = acl->aixc_acl[0].acl_len;
|
|---|
| 48 | } else {
|
|---|
| 49 | DEBUG(0,("aixacl2_getlen:unknown type:%d\n",type->u64));
|
|---|
| 50 | return False;
|
|---|
| 51 | }
|
|---|
| 52 | }
|
|---|
| 53 | DEBUG(10,("aixacl2_getlen:%d\n",len));
|
|---|
| 54 | return len;
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
| 57 | static AIXJFS2_ACL_T *aixjfs2_getacl_alloc(const char *fname, acl_type_t *type)
|
|---|
|
|---|