]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/acl.h
Backport from BEE
[bacula/bacula] / bacula / src / filed / acl.h
1 /*
2    Bacula® - The Network Backup Solution
3
4    Copyright (C) 2004-2014 Free Software Foundation Europe e.V.
5
6    The main author of Bacula is Kern Sibbald, with contributions from many
7    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    Bacula® is a registered trademark of Kern Sibbald.
15 */
16 /*
17  * Properties we use for getting and setting ACLs.
18  */
19
20 #ifndef __ACL_H
21 #define __ACL_H
22
23 /* For shorter ACL strings when possible, define BACL_WANT_SHORT_ACLS */
24 /* #define BACL_WANT_SHORT_ACLS */
25
26 /* For numeric user/group ids when possible, define BACL_WANT_NUMERIC_IDS */
27 /* #define BACL_WANT_NUMERIC_IDS */
28
29 /*
30  * We support the following types of ACLs
31  */
32 typedef enum {
33    BACL_TYPE_NONE = 0,
34    BACL_TYPE_ACCESS = 1,
35    BACL_TYPE_DEFAULT = 2,
36    BACL_TYPE_DEFAULT_DIR = 3,
37    BACL_TYPE_EXTENDED = 4,
38    BACL_TYPE_NFS4 = 5
39 } bacl_type;
40
41 /*
42  * This value is used as ostype when we encounter an invalid acl type.
43  * The way the code is build this should never happen.
44  */
45 #if !defined(ACL_TYPE_NONE)
46 #define ACL_TYPE_NONE 0x0
47 #endif
48
49 #if defined(HAVE_FREEBSD_OS) || \
50     defined(HAVE_DARWIN_OS) || \
51     defined(HAVE_HPUX_OS) || \
52     defined(HAVE_LINUX_OS)
53 #define BACL_ENOTSUP EOPNOTSUPP
54 #elif defined(HAVE_IRIX_OS)
55 #define BACL_ENOTSUP ENOSYS
56 #endif
57
58 #define BACL_FLAG_SAVE_NATIVE    0x01
59 #define BACL_FLAG_SAVE_AFS       0x02
60 #define BACL_FLAG_RESTORE_NATIVE 0x04
61 #define BACL_FLAG_RESTORE_AFS    0x08
62
63 struct acl_build_data_t {
64    uint32_t nr_errors;
65    uint32_t content_length;
66    POOLMEM *content;
67 };
68
69 struct acl_parse_data_t {
70    uint32_t nr_errors;
71 };
72
73 /*
74  * Internal tracking data.
75  */
76 struct acl_data_t {
77    uint32_t flags;              /* See BACL_FLAG_* */
78    uint32_t current_dev;
79    union {
80       struct acl_build_data_t *build;
81       struct acl_parse_data_t *parse;
82    } u;
83 };
84
85 #endif