From: Kern Sibbald Date: Fri, 17 Oct 2008 18:34:50 +0000 (+0000) Subject: Apply Bastian Friedrich's ACL patch to eliminate ACL X-Git-Tag: Release-7.0.0~3916 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f61d5dc6e3d84445a274c4296e35f633ec99a5b5;p=bacula%2Fbacula Apply Bastian Friedrich's ACL patch to eliminate ACL errors during restore. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7834 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 2fcf113baf..be581c448c 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -346,6 +346,8 @@ void do_restore(JCR *jcr) switch (stat) { case CF_ERROR: case CF_SKIP: + pm_strcpy(jcr->last_fname, attr->ofname); + jcr->last_type = attr->type; break; case CF_EXTRACT: /* File created and we expect file data */ rctx.extract = true; @@ -571,6 +573,15 @@ void do_restore(JCR *jcr) break; case STREAM_UNIX_ACCESS_ACL: + /* + * Do not restore ACLs when + * a) The current file is not extracted + * b) and it is not a directory (they are never "extracted") + * c) or the file name is empty + */ + if ((!extract && jcr->last_type != FT_DIREND) || (*jcr->last_fname == 0)) { + break; + } if (have_acl) { pm_strcpy(jcr->acl_text, sd->msg); Dmsg2(400, "Restoring ACL type 0x%2x <%s>\n", BACL_TYPE_ACCESS, jcr->acl_text); @@ -583,6 +594,9 @@ void do_restore(JCR *jcr) break; case STREAM_UNIX_DEFAULT_ACL: + if ((!extract && jcr->last_type != FT_DIREND) || (*jcr->last_fname == 0)) { + break; + } if (have_acl) { pm_strcpy(jcr->acl_text, sd->msg); Dmsg2(400, "Restoring ACL type 0x%2x <%s>\n", BACL_TYPE_DEFAULT, jcr->acl_text); diff --git a/bacula/technotes-2.5 b/bacula/technotes-2.5 index 491fb63274..de80e0abbf 100644 --- a/bacula/technotes-2.5 +++ b/bacula/technotes-2.5 @@ -21,6 +21,8 @@ remove reader/writer in FOPTS???? General: 17Oct08 +kes Apply Bastian Friedrich's ACL patch to eliminate ACL + errors during restore. kes Minor cleanup of create_restore_volume_list() code. kes Fix typo in console Makefile.in 16Oct08