/*
Bacula(R) - The Network Backup Solution
- Copyright (C) 2000-2015 Kern Sibbald
- Copyright (C) 2007-2014 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2017 Kern Sibbald
The original author of Bacula is Kern Sibbald, with contributions
from many others, a complete list can be found in the file AUTHORS.
Public License, v3.0 ("AGPLv3") and some additional permissions and
terms pursuant to its AGPLv3 Section 7.
- This notice must be preserved when any source code is
+ This notice must be preserved when any source code is
conveyed and/or propagated.
Bacula(R) is a registered trademark of Kern Sibbald.
* Application Programming Interface (API) definition for Bacula Plugins
*
* Kern Sibbald, October 2007
- *
*/
#ifndef __FD_PLUGINS_H
char *link; /* Link name if any */
struct stat statp; /* System stat() packet for file */
int32_t type; /* FT_xx for this file */
- uint32_t flags; /* Bacula internal flags */
+ uint64_t flags; /* Bacula internal flags */
bool no_read; /* During the save, the file should not be saved */
bool portable; /* set if data format is portable */
bool accurate_found; /* Found in accurate list (valid after check_changes()) */
int32_t io_errno; /* errno code */
int32_t lerror; /* Win32 error code */
int32_t whence; /* lseek argument */
- boffset_t offset; /* lseek argument */
+ boffset_t offset; /* lseek argument or in bread current offset*/
bool win32; /* Win32 GetLastError returned */
int32_t pkt_end; /* end packet sentinel */
};
+enum {
+ BACL_BACKUP = 1,
+ BACL_RESTORE = 2,
+ BXATTR_BACKUP = 3,
+ BXATTR_RESTORE = 4
+};
+
+struct xacl_pkt {
+ int32_t pkt_size; /* Size of this packet */
+ int32_t func; /* Function code */
+ int32_t count; /* read/write count */
+ char *content; /* read/write buffer */
+ int32_t pkt_end; /* end packet sentinel */
+};
+
/****************************************************************************
* *
* Bacula definitions *
/* Bacula Variable Ids */
typedef enum {
- bVarJobId = 1,
- bVarFDName = 2,
- bVarLevel = 3,
- bVarType = 4,
- bVarClient = 5,
- bVarJobName = 6,
- bVarJobStatus = 7,
- bVarSinceTime = 8,
- bVarAccurate = 9,
- bVarFileSeen = 10,
- bVarVssObject = 11,
- bVarVssDllHandle = 12,
- bVarWorkingDir = 13,
- bVarWhere = 14,
- bVarRegexWhere = 15,
- bVarExePath = 16,
- bVarVersion = 17,
- bVarDistName = 18,
- bVarxxx = 19,
- bVarPrevJobName = 20,
- bVarPrefixLinks = 21,
- bVarInteractiveSession = 22
+ bVarJobId = 1,
+ bVarFDName = 2,
+ bVarLevel = 3,
+ bVarType = 4,
+ bVarClient = 5,
+ bVarJobName = 6,
+ bVarJobStatus = 7,
+ bVarSinceTime = 8,
+ bVarAccurate = 9,
+ bVarFileSeen = 10,
+ bVarVssObject = 11,
+ bVarVssDllHandle = 12,
+ bVarWorkingDir = 13,
+ bVarWhere = 14,
+ bVarRegexWhere = 15,
+ bVarExePath = 16,
+ bVarVersion = 17,
+ bVarDistName = 18,
+ bVarxxx = 19,
+ bVarPrevJobName = 20,
+ bVarPrefixLinks = 21,
+ bVarInteractiveSession = 22,
+ bVarFileIndex = 23,
+ bVarReplace = 24
} bVariable;
/* Events that are passed to plugin */
int plugin_estimate(JCR *jcr, FF_PKT *ff_pkt, bool top_level);
bool plugin_check_file(JCR *jcr, char *fname);
bRC plugin_option_handle_file(JCR *jcr, FF_PKT *ff_pkt, struct save_pkt *sp);
+int plugin_backup_acl(JCR *jcr, FF_PKT *ff_pkt, char **data);
+bool plugin_restore_acl(JCR *jcr, char *data, uint32_t length);
+int plugin_backup_xattr(JCR *jcr, FF_PKT *ff_pkt, char **data);
+bool plugin_restore_xattr(JCR *jcr, char *data, uint32_t length);
#endif
#ifdef __cplusplus
# define FD_PLUGIN_MAGIC "*FDPluginData*"
-#define FD_PLUGIN_INTERFACE_VERSION ( 13 )
+#define FD_PLUGIN_INTERFACE_VERSION ( 14 )
typedef struct s_pluginInfo {
uint32_t size;
bRC (*createFile)(bpContext *ctx, struct restore_pkt *rp);
bRC (*setFileAttributes)(bpContext *ctx, struct restore_pkt *rp);
bRC (*checkFile)(bpContext *ctx, char *fname);
+ bRC (*handleXACLdata)(bpContext *ctx, struct xacl_pkt *xacl);
} pFuncs;
#define plug_func(plugin) ((pFuncs *)(plugin->pfuncs))