]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/bacl_solaris.h
Update ACL/XATTR code and define new ACL/XATTR API for Plugins.
[bacula/bacula] / bacula / src / filed / bacl_solaris.h
1 /*
2    Bacula(R) - The Network Backup Solution
3
4    Copyright (C) 2000-2016 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_Solaris_H_
29 #define __BACL_Solaris_H_
30
31 #if defined(HAVE_SUN_OS)
32
33 /* check if ACL support is enabled */
34 #if defined(HAVE_ACL)
35
36 #ifdef HAVE_SYS_ACL_H
37 #include <sys/acl.h>
38 #else
39 #error "configure failed to detect availability of sys/acl.h"
40 #endif
41
42 /*
43  *
44  */
45 #if defined(HAVE_EXTENDED_ACL)
46 #if !defined(_SYS_ACL_IMPL_H)
47 typedef enum acl_type {
48    ACLENT_T = 0,
49    ACE_T = 1
50 } acl_type_t;
51 #endif
52
53 /*
54  *
55  */
56 extern "C" {
57 int acl_type(acl_t *);
58 char *acl_strerror(int);
59 };
60 #endif
61
62 /*
63  *
64  *
65  */
66 class BACL_Solaris : public BACL {
67 private:
68    alist * cache;
69    bRC_BACL os_backup_acl (JCR *jcr, FF_PKT *ff_pkt);
70    bRC_BACL os_restore_acl (JCR *jcr, int stream, char *content, uint32_t length);
71    bRC_BACL os_get_acl(JCR *jcr, int *stream);
72    bRC_BACL os_set_acl(JCR *jcr, int stream, char *content, uint32_t length);
73    /* requires acl.h available */
74    bRC_BACL check_bacltype (JCR *jcr, int name);
75 public:
76    BACL_Solaris ();
77    ~BACL_Solaris ();
78 };
79
80 #endif /* HAVE_ACL */
81
82 #endif /* HAVE_SUN_OS */
83
84 #endif /* __BACL_Solaris_H_ */