--- /dev/null
+
+ This patch can be applied to version 3.0.1 and makes
+ error conditions obtaining acls during backup non-fatal.
+ This should fix bug #1305.
+
+ Apply it to version 3.0.1 with:
+
+ cd <bacula-source>
+ patch -p0 <3.0.1-acl-error.patch
+ ./configure <your-options>
+ make
+ ...
+ make install
+
+
+
+Index: src/filed/acl.c
+===================================================================
+--- src/filed/acl.c (revision 8902)
++++ src/filed/acl.c (working copy)
+@@ -406,31 +406,35 @@
+ pm_strcpy(jcr->acl_data, "");
+ acl_free(acl);
+
+- return -1;
++ return 0; /* non-fatal error */
+ }
+
+ /*
+ * Handle errors gracefully.
+ */
+- switch (errno) {
++ if (acl == (acl_t)NULL) {
++ switch (errno) {
+ #if defined(BACL_ENOTSUP)
+- case BACL_ENOTSUP:
+- /*
+- * Not supported, just pretend there is nothing to see
+- */
+- pm_strcpy(jcr->acl_data, "");
+- return 0;
++ case BACL_ENOTSUP:
++ break; /* not supported */
+ #endif
+- default:
+- berrno be;
+- Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
+- jcr->last_fname, be.bstrerror());
+- Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",
+- jcr->last_fname, be.bstrerror());
++ default:
++ berrno be;
++ /* Some real error */
++ Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
++ jcr->last_fname, be.bstrerror());
++ Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",
++ jcr->last_fname, be.bstrerror());
+
+- pm_strcpy(jcr->acl_data, "");
+- return -1;
++ pm_strcpy(jcr->acl_data, "");
++ return 0; /* non-fatal error */
++ }
+ }
++ /*
++ * Not supported, just pretend there is nothing to see
++ */
++ pm_strcpy(jcr->acl_data, "");
++ return 0;
+ }
+
+ /*
pm_strcpy(jcr->acl_data, "");
acl_free(acl);
- return -1;
+ return 0; /* non-fatal error */
}
/*
* Handle errors gracefully.
*/
- switch (errno) {
+ if (acl == (acl_t)NULL) {
+ switch (errno) {
#if defined(BACL_ENOTSUP)
- case BACL_ENOTSUP:
- /*
- * Not supported, just pretend there is nothing to see
- */
- pm_strcpy(jcr->acl_data, "");
- return 0;
+ case BACL_ENOTSUP:
+ break; /* not supported */
#endif
- default:
- berrno be;
- Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
- jcr->last_fname, be.bstrerror());
- Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",
- jcr->last_fname, be.bstrerror());
+ default:
+ berrno be;
+ /* Some real error */
+ Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
+ jcr->last_fname, be.bstrerror());
+ Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",
+ jcr->last_fname, be.bstrerror());
- pm_strcpy(jcr->acl_data, "");
- return -1;
+ pm_strcpy(jcr->acl_data, "");
+ return 0; /* non-fatal error */
+ }
}
+ /*
+ * Not supported, just pretend there is nothing to see
+ */
+ pm_strcpy(jcr->acl_data, "");
+ return 0;
}
/*