From: Arvin Schnell Date: Tue, 11 Feb 2014 13:27:48 +0000 (+0100) Subject: - sync ACL at startup (bnc#863073) X-Git-Tag: v0.2.2~23^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a34801796657d949a617c8db737217332e590db5;p=thirdparty%2Fsnapper.git - sync ACL at startup (bnc#863073) --- diff --git a/package/snapper.changes b/package/snapper.changes index 615b8257..0bb76174 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Feb 11 14:08:06 CET 2014 - aschnell@suse.de + +- sync ACL at startup (bnc#863073) + ------------------------------------------------------------------- Wed Feb 05 10:50:25 CET 2014 - aschnell@suse.de diff --git a/snapper/Snapper.cc b/snapper/Snapper.cc index 090f2001..a603b2d4 100644 --- a/snapper/Snapper.cc +++ b/snapper/Snapper.cc @@ -95,6 +95,10 @@ namespace snapper config_info->getValue(KEY_FSTYPE, fstype); filesystem = Filesystem::create(fstype, config_info->getSubvolume()); + bool sync_acl; + if (config_info->getValue(KEY_SYNC_ACL, sync_acl) && sync_acl == true) + syncAcl(); + y2mil("subvolume:" << config_info->getSubvolume() << " filesystem:" << filesystem->fstype()); @@ -533,7 +537,11 @@ namespace snapper { SDir infos_dir = openInfosDir(); - acl_t acl = acl_get_fd(infos_dir.fd()); + acl_t orig_acl = acl_get_fd(infos_dir.fd()); + if (!orig_acl) + throw AclException(); + + acl_t acl = acl_dup(orig_acl); if (!acl) throw AclException(); @@ -609,8 +617,9 @@ namespace snapper if (acl_calc_mask(&acl) != 0) throw AclException(); - if (acl_set_fd(infos_dir.fd(), acl) != 0) - throw AclException(); + if (acl_cmp(orig_acl, acl) == 1) + if (acl_set_fd(infos_dir.fd(), acl) != 0) + throw AclException(); if (acl_free(acl) != 0) throw AclException();