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