Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #9043: Malformed patch in 7060 #1067

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ diff -rNu cfengine-source/libutils/file_lib.c cfengine-source-new/libutils/file_
while (next_component)
{
char *component = next_component;
@@ -514,7 +518,9 @@
@@ -514,7 +521,13 @@
close(currentfd);
return -1;
}
- if (stat_before.st_uid != stat_after.st_uid || stat_before.st_gid != stat_after.st_gid)
+ # The probable logic behind the user matching test is that some attacks use symlink creation to exploit a race condition
+ # This attack is not useful if the symlink has been created by root
+ # This attack is not useful if the process's user is the owner of the symlink
+ # As everyone use symlink for server administration, we reenable those cases.
+ // The probable logic behind the user matching test is that some attacks use symlink creation to exploit a race condition
+ // This attack is not useful if the symlink has been created by root
+ // This attack is not useful if the process's user is the owner of the symlink
+ // As everyone use symlink for server administration, we reenable those cases.
+ if ( stat_before.st_uid != 0 &&
+ stat_before.st_uid != p_uid &&
+ (stat_before.st_uid != stat_after.st_uid || stat_before.st_gid != stat_after.st_gid) )
Expand Down