2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2016 Kern Sibbald
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.
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.
14 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
20 * Major refactoring of ACL and XATTR code written by:
22 * Radosław Korzeniewski, MMXVI
23 * radoslaw@korzeniewski.net, radekk@inteos.pl
24 * Inteos Sp. z o.o. http://www.inteos.pl/
28 #ifndef __XACL_FreeBSD_H_
29 #define __XACL_FreeBSD_H_
31 #if defined(HAVE_FREEBSD_OS)
32 #include <sys/types.h>
37 #error "configure failed to detect availability of sys/acl.h"
40 #if (!defined(HAVE_EXTATTR_GET_LINK) && !defined(HAVE_EXTATTR_GET_FILE)) || \
41 (!defined(HAVE_EXTATTR_SET_LINK) && !defined(HAVE_EXTATTR_SET_FILE)) || \
42 (!defined(HAVE_EXTATTR_LIST_LINK) && !defined(HAVE_EXTATTR_LIST_FILE)) || \
43 !defined(HAVE_EXTATTR_NAMESPACE_TO_STRING) || \
44 !defined(HAVE_EXTATTR_STRING_TO_NAMESPACE)
45 #error "Missing full support for the extattr functions."
48 #ifdef HAVE_SYS_EXTATTR_H
49 #include <sys/types.h>
50 #include <sys/extattr.h>
52 #error "Missing sys/extattr.h header file"
59 #if !defined(HAVE_EXTATTR_GET_LINK) && defined(HAVE_EXTATTR_GET_FILE)
60 #define extattr_get_link extattr_get_file
62 #if !defined(HAVE_EXTATTR_SET_LINK) && defined(HAVE_EXTATTR_SET_FILE)
63 #define extattr_set_link extattr_set_file
65 #if !defined(HAVE_EXTATTR_LIST_LINK) && defined(HAVE_EXTATTR_LIST_FILE)
66 #define extattr_list_link extattr_list_file
73 class XACL_FreeBSD : public XACL {
75 bRC_XACL os_backup_acl (JCR *jcr, FF_PKT *ff_pkt);
76 bRC_XACL os_restore_acl (JCR *jcr, int stream, char *content, uint32_t length);
77 bRC_XACL os_backup_xattr (JCR *jcr, FF_PKT *ff_pkt);
78 bRC_XACL os_restore_xattr (JCR *jcr, int stream, char *content, uint32_t length);
79 bRC_XACL os_get_acl(JCR *jcr, XACL_type xacltype);
80 bRC_XACL os_set_acl(JCR *jcr, XACL_type xacltype, char *content, uint32_t length);
81 bRC_XACL os_get_xattr_names (JCR *jcr, const int ns, POOLMEM **list, uint32_t *length);
82 bRC_XACL os_get_xattr_value (JCR *jcr, const int ns, char * name, char ** pvalue, uint32_t * plen);
83 bRC_XACL os_set_xattr (JCR *jcr, XACL_xattr *xattr);
84 /* requires acl.h available */
85 bool acl_issimple(acl_t acl);
86 acl_type_t get_acltype(XACL_type xacltype);
87 int acl_nrentries(acl_t acl);
88 bRC_XACL check_xacltype (JCR *jcr, int name);
93 #endif /* HAVE_FREEBSD_OS */
95 #endif /* __XACL_FreeBSD_H_ */