1 /*
2  * Copyright (C) 2021 Jakub Kruszona-Zawadzki, Core Technology Sp. z o.o.
3  *
4  * This file is part of MooseFS.
5  *
6  * MooseFS 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, version 2 (only).
9  *
10  * MooseFS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with MooseFS; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1301, USA
18  * or visit http://www.gnu.org/licenses/gpl-2.0.html
19  */
20 
21 #ifndef _POSIXACL_H_
22 #define _POSIXACL_H_
23 
24 #include <inttypes.h>
25 
26 #include "bio.h"
27 
28 uint16_t posix_acl_getmode(uint32_t inode);
29 void posix_acl_setmode(uint32_t inode,uint16_t mode);
30 uint8_t posix_acl_accmode(uint32_t inode,uint32_t auid,uint32_t agids,uint32_t *agid,uint32_t fuid,uint32_t fgid);
31 void posix_acl_remove(uint32_t inode,uint8_t acltype);
32 uint8_t posix_acl_copydefaults(uint32_t parent,uint32_t inode,uint8_t directory,uint16_t *mode);
33 int posix_acl_set(uint32_t inode,uint8_t acltype,uint16_t userperm,uint16_t groupperm,uint16_t otherperm,uint16_t mask,uint16_t namedusers,uint16_t namedgroups,const uint8_t *aclblob);
34 int32_t posix_acl_get_blobsize(uint32_t inode,uint8_t acltype,void **aclnode);
35 void posix_acl_get_data(void *aclnode,uint16_t *userperm,uint16_t *groupperm,uint16_t *otherperm,uint16_t *mask,uint16_t *namedusers,uint16_t *namedgroups,uint8_t *aclblob);
36 void posix_acl_cleanup(void);
37 uint8_t posix_acl_copy(uint32_t srcinode,uint32_t dstinode,uint8_t acltype);
38 uint8_t posix_acl_store(bio *fd);
39 int posix_acl_load(bio *fd,uint8_t mver,int ignoreflag);
40 int posix_acl_init(void);
41 
42 #endif
43