]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/filed/bxattr_osx.h
Update ACL/XATTR code and define new ACL/XATTR API for Plugins.
[bacula/bacula] / bacula / src / filed / bxattr_osx.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 XATTR 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 __BXATTR_OSX_H_
29 #define __BXATTR_OSX_H_
30
31 #if defined(HAVE_DARWIN_OS)
32 #include <sys/types.h>
33
34 /* check if XATTR support is enabled */
35 #if defined(HAVE_XATTR)
36
37 #if !defined(HAVE_LISTXATTR) || !defined(HAVE_GETXATTR) || !defined(HAVE_SETXATTR)
38 #error "Missing full support for the XATTR functions."
39 #endif
40
41 #ifdef HAVE_SYS_XATTR_H
42 #include <sys/xattr.h>
43 #else
44 #error "Missing sys/xattr.h header file"
45 #endif
46
47 /*
48  *
49  *
50  */
51 class BXATTR_OSX : public BXATTR {
52 private:
53    bRC_BXATTR os_backup_xattr (JCR *jcr, FF_PKT *ff_pkt);
54    bRC_BXATTR os_restore_xattr (JCR *jcr, int stream, char *content, uint32_t length);
55    bRC_BXATTR os_get_xattr_names (JCR *jcr, POOLMEM **list, uint32_t *length);
56    bRC_BXATTR os_get_xattr_value (JCR *jcr, char * name, char ** pvalue, uint32_t * plen);
57    bRC_BXATTR os_set_xattr (JCR *jcr, BXATTR_xattr *xattr);
58 public:
59    BXATTR_OSX ();
60 };
61
62 #endif /* HAVE_XATTR */
63
64 #endif /* HAVE_DARWIN_OS */
65
66 #endif /* __BXATTR_OSX_H_ */