*
* Written by Marco van Wieringen, November MMVIII
*
- * Version $Id: xattr.c 7879 2008-10-23 10:12:36Z kerns $
+ * Version $Id$
*/
#include "bacula.h"
return true;
#endif
+ /*
+ * Sanity check
+ */
+ if (jcr->xattr_data_len <= 0)
+ return true;
+
/*
* Send header
*/
jcr->last_fname, be.bstrerror());
Dmsg2(100, "llistxattr error file=%s ERR=%s\n",
jcr->last_fname, be.bstrerror());
+
return false;
} else if (xattr_list_len == 0) {
return true;
jcr->last_fname, be.bstrerror());
free(xattr_list);
+
return false;
}
xattr_list[xattr_list_len] = '\0';
*/
bp = xattr_list;
while ((bp - xattr_list) + 1 < xattr_list_len) {
+#if defined(HAVE_LINUX_OS)
+ /*
+ * On Linux you also get the acls in the extented attribute list.
+ * So we check if we are already backing up acls and if we do we
+ * don't store the extended attribute with the same info.
+ */
+ if ((ff_pkt->flags & FO_ACL) == 0 || strcmp(bp, "system.posix_acl_access"))
+ count++;
+#else
count++;
+#endif
bp = strchr(bp, '\0') + 1;
}
+ if (count == 0)
+ return true;
+
/*
* Allocate enough room to hold all extended attributes.
* After allocating the storage make sure its empty by zeroing it.
bp = xattr_list;
while ((bp - xattr_list) + 1 < xattr_list_len) {
#if defined(HAVE_LINUX_OS)
- /*
- * On Linux you also get the acls in the extented attribute list.
- * So we check if we are already backing up acls and if we do we
- * don't store the extended attribute with the same info.
- */
if (ff_pkt->flags & FO_ACL && !strcmp(bp, "system.posix_acl_access")) {
bp = strchr(bp, '\0') + 1;