]> git.sur5r.net Git - bacula/bacula/commit
Update ACL/XATTR code and define new ACL/XATTR API for Plugins.
authorRadosław Korzeniewski <radekk@inteos.pl>
Thu, 9 Nov 2017 11:26:11 +0000 (12:26 +0100)
committerKern Sibbald <kern@sibbald.com>
Sat, 11 Nov 2017 13:02:12 +0000 (14:02 +0100)
commitb4671fd4b19e517bad9180fc43a098c706cad216
treeb03a0ea3b2b96aea747618c713c8478534579703
parentf5c2e027eb8bed9baf04ee5c46573d87462974a7
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.
45 files changed:
bacula/src/filed/Makefile.in
bacula/src/filed/backup.c
bacula/src/filed/bacl.c [new file with mode: 0644]
bacula/src/filed/bacl.h [new file with mode: 0644]
bacula/src/filed/bacl_freebsd.c [new file with mode: 0644]
bacula/src/filed/bacl_freebsd.h [new file with mode: 0644]
bacula/src/filed/bacl_linux.c [new file with mode: 0644]
bacula/src/filed/bacl_linux.h [new file with mode: 0644]
bacula/src/filed/bacl_osx.c [new file with mode: 0644]
bacula/src/filed/bacl_osx.h [new file with mode: 0644]
bacula/src/filed/bacl_solaris.c [new file with mode: 0644]
bacula/src/filed/bacl_solaris.h [new file with mode: 0644]
bacula/src/filed/bxattr.c [new file with mode: 0644]
bacula/src/filed/bxattr.h [new file with mode: 0644]
bacula/src/filed/bxattr_freebsd.c [new file with mode: 0644]
bacula/src/filed/bxattr_freebsd.h [new file with mode: 0644]
bacula/src/filed/bxattr_linux.c [new file with mode: 0644]
bacula/src/filed/bxattr_linux.h [new file with mode: 0644]
bacula/src/filed/bxattr_osx.c [new file with mode: 0644]
bacula/src/filed/bxattr_osx.h [new file with mode: 0644]
bacula/src/filed/bxattr_solaris.c [new file with mode: 0644]
bacula/src/filed/bxattr_solaris.h [new file with mode: 0644]
bacula/src/filed/fd_plugins.c
bacula/src/filed/fd_plugins.h
bacula/src/filed/filed.h
bacula/src/filed/restore.c
bacula/src/filed/xacl.c [deleted file]
bacula/src/filed/xacl.h [deleted file]
bacula/src/filed/xacl_freebsd.c [deleted file]
bacula/src/filed/xacl_freebsd.h [deleted file]
bacula/src/filed/xacl_linux.c [deleted file]
bacula/src/filed/xacl_linux.h [deleted file]
bacula/src/filed/xacl_osx.c [deleted file]
bacula/src/filed/xacl_osx.h [deleted file]
bacula/src/filed/xacl_solaris.c [deleted file]
bacula/src/filed/xacl_solaris.h [deleted file]
bacula/src/filed/xattr.h [deleted file]
bacula/src/jcr.h
bacula/src/lib/plugins.c
bacula/src/plugins/fd/bpipe-fd.c
bacula/src/plugins/fd/example-plugin-fd.c
bacula/src/plugins/fd/test-deltaseq-fd.c
bacula/src/plugins/fd/test-plugin-fd.c
bacula/src/qt-console/bat.pro.mingw64
bacula/src/streams.h