1 /*
2    Bacula(R) - The Network Backup Solution
3 
4    Copyright (C) 2000-2020 Kern Sibbald
5 
6    The original author of Bacula is Kern Sibbald, with contributions
7    from many others, a complete list can be found in the file AUTHORS.
8 
9    You may use this file and others of this release according to the
10    license defined in the LICENSE file, which includes the Affero General
11    Public License, v3.0 ("AGPLv3") and some additional permissions and
12    terms pursuant to its AGPLv3 Section 7.
13 
14    This notice must be preserved when any source code is
15    conveyed and/or propagated.
16 
17    Bacula(R) is a registered trademark of Kern Sibbald.
18  */
19 /**
20  * Major refactoring of ACL code written by:
21  *
22  *  Radosław Korzeniewski, MMXVI
23  *  radoslaw@korzeniewski.net, radekk@inteos.pl
24  *  Inteos Sp. z o.o. http://www.inteos.pl/
25  *
26  */
27 
28 #ifndef __BACL_LINUX_H_
29 #define __BACL_LINUX_H_
30 
31 #if defined(HAVE_LINUX_OS)
32 #include <sys/types.h>
33 
34 /* check if ACL support is enabled */
35 #if defined(HAVE_ACL)
36 
37 #ifdef HAVE_SYS_ACL_H
38 #include <sys/acl.h>
39 #else
40 #error "configure failed to detect availability of sys/acl.h"
41 #endif
42 
43 /*
44  *
45  *
46  */
47 class BACL_Linux : public BACL {
48 private:
49    bRC_BACL os_backup_acl (JCR *jcr, FF_PKT *ff_pkt);
50    bRC_BACL os_restore_acl (JCR *jcr, int stream, char *content, uint32_t length);
51    bRC_BACL os_get_acl(JCR *jcr, BACL_type bacltype);
52    bRC_BACL os_set_acl(JCR *jcr, BACL_type bacltype, char *content, uint32_t length);
53    acl_type_t get_acltype(BACL_type bacltype);
54    int acl_nrentries(acl_t acl);
55    bool acl_issimple(acl_t acl);
56 public:
57    BACL_Linux ();
58 };
59 
60 #endif /* HAVE_ACL */
61 
62 #endif /* HAVE_LINUX_OS */
63 
64 #endif /* __BACL_LINUX_H_ */
65