Update ACL/XATTR code and define new ACL/XATTR API for Plugins.
The patch redesign ACL/XATTR code separating acl functionality from xattr.
It allows for full conditional compilation on any supported OS. It closes issue: #2295.
The patch adds a new ACl/XATTR API for Plugins.
A new Plugin callback: bRC (*handleXACLdata)(bpContext *ctx, struct xacl_pkt *xacl);
and support data:
- BACL_BACKUP - Plugin ACL data backup,
- BACL_RESTORE - Plugin ACL data restore,
- BXATTR_BACKUP - Plugin XATTR data backup,
- BXATTR_RESTORE - Plugin XATTR data restore
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 will call handleXACLdata with xacl.func set to one of the defined enum's
and for backup requires xacl.count and xacl.content to be set by a plugin and
if xacl.content is allocated by plugin he is responsible for free and for restore
will setup xacl.count and xacl.content to the data restored.
The Bacula Plugin API will call handleXACLdata during backup with specific xacl.func
multiple times for every file, until a plugin return xacl.count == 0
(similar to pluginIO where no more data to backup is signalled by io->status = 0).
And as usual handleXACLdata has to return bRC_OK when operation was successful
(acl/xattr to backup/restore is a success) or other (bRC_Error) when operation was
unsuccessful. In this case no acl/xattr data will be saved.