From: Kern Sibbald Date: Wed, 17 Jun 2009 18:41:32 +0000 (+0000) Subject: Fix bug #1305 make errors obtaining acl during backup non-fatal X-Git-Tag: Release-3.0.2~159 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2a14d1ee2db4a063dff8bd4b743b4abfbe042b16;p=bacula%2Fbacula Fix bug #1305 make errors obtaining acl during backup non-fatal git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8907 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/patches/3.0.1-acl-error.patch b/bacula/patches/3.0.1-acl-error.patch new file mode 100644 index 0000000000..8e6a245d30 --- /dev/null +++ b/bacula/patches/3.0.1-acl-error.patch @@ -0,0 +1,72 @@ + + 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 + patch -p0 <3.0.1-acl-error.patch + ./configure + 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; + } + + /* diff --git a/bacula/src/filed/acl.c b/bacula/src/filed/acl.c index 8155bb7f39..1e43df13e7 100644 --- a/bacula/src/filed/acl.c +++ b/bacula/src/filed/acl.c @@ -406,31 +406,35 @@ static int generic_get_acl_from_os(JCR *jcr, bacl_type acltype) 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; } /* diff --git a/bacula/src/version.h b/bacula/src/version.h index 66973bbabb..ed36f1abaa 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "3.0.2" -#define BDATE "08 June 2009" -#define LSMDATE "08Jun09" +#define BDATE "17 June 2009" +#define LSMDATE "17Jun09" #define PROG_COPYRIGHT "Copyright (C) %d-2009 Free Software Foundation Europe e.V.\n" #define BYEAR "2009" /* year for copyright messages in progs */ diff --git a/bacula/technotes b/bacula/technotes index e608b0c660..34dc8632f8 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -3,6 +3,7 @@ General: 17Jun09 +kes Fix bug #1305 make errors obtaining acl during backup non-fatal kes Fix bug #1309 inappropriate error message during btape fill command kes Fix bug #1307 AllowHigherDuplicates=no prevents automatic job escalation 12Jun09