]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- sync ACL at startup (bnc#863073) 44/head
authorArvin Schnell <aschnell@suse.de>
Tue, 11 Feb 2014 13:27:48 +0000 (14:27 +0100)
committerArvin Schnell <aschnell@suse.de>
Tue, 11 Feb 2014 13:27:48 +0000 (14:27 +0100)
package/snapper.changes
snapper/Snapper.cc

index 615b8257ce5b38628bfea1d1fd789472ece6ce28..0bb76174354249c6e6c7a36d18417605a8c9e7cc 100644 (file)
@@ -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
 
index 090f2001370d28528eb7abd4148217128171f7bb..a603b2d4cbdb024483e323cce919378cbe34d18a 100644 (file)
@@ -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();