]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- extended last fix 56/head
authorArvin Schnell <aschnell@suse.de>
Fri, 28 Feb 2014 11:21:21 +0000 (12:21 +0100)
committerArvin Schnell <aschnell@suse.de>
Fri, 28 Feb 2014 11:21:21 +0000 (12:21 +0100)
snapper/File.cc
testsuite-real/permissions3.cc

index 1874752e543751940d52d2fcb920ddc62f55dc03..d62754ebcba9ab793b07c52bc71cd10be4e7c080 100644 (file)
@@ -514,13 +514,16 @@ namespace snapper
                }
            }
 
-           if (getPreToPostStatus() & PERMISSIONS)
+           if (getPreToPostStatus() & (OWNER | GROUP | PERMISSIONS))
            {
-               if (chmod(getAbsolutePath(LOC_SYSTEM).c_str(), fs.st_mode) != 0)
+               if (!S_ISLNK(fs.st_mode))
                {
-                   y2err("chmod failed path:" << getAbsolutePath(LOC_SYSTEM) << " errno:" <<
-                         errno << " (" << stringerror(errno) << ")");
-                   return false;
+                   if (chmod(getAbsolutePath(LOC_SYSTEM).c_str(), fs.st_mode) != 0)
+                   {
+                       y2err("chmod failed path:" << getAbsolutePath(LOC_SYSTEM) << " errno:" <<
+                             errno << " (" << stringerror(errno) << ")");
+                       return false;
+                   }
                }
            }
        }
index 3be99ea47dc35ba578d069b280716c849a550a37..52ced731d6113c3060534869f3ef118c5020ec39 100644 (file)
@@ -9,16 +9,22 @@ main()
 {
     setup();
 
-    run_command("echo hello > setuid");
-    run_command("chmod u+s setuid");
+    run_command("echo hello > setuid1");
+    run_command("chmod u+s,a+x setuid1");
+
+    run_command("touch setuid2");
+    run_command("chmod u+s,a+x setuid2");
 
     first_snapshot();
 
-    run_command("echo world >> setuid");
+    run_command("echo world >> setuid1");
+
+    run_command("chown :nobody setuid2");
+    run_command("chmod u+s setuid2");
 
     second_snapshot();
 
-    check_undo_statistics(0, 1, 0);
+    check_undo_statistics(0, 2, 0);
 
     undo();