}
}
- 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;
+ }
}
}
}
{
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();