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

lib/copydir:copy_entry(): use temporary stat buffer #974

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/copydir.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ static int copy_entry (const struct path_info *src, const struct path_info *dst,
{
int err = 0;
struct stat sb;
struct stat tmp_sb;
alejandro-colomar marked this conversation as resolved.
Show resolved Hide resolved
struct link_name *lp;
struct timespec mt[2];

Expand All @@ -423,7 +424,7 @@ static int copy_entry (const struct path_info *src, const struct path_info *dst,
* If the destination already exists do nothing.
* This is after the copy_dir above to still iterate into subdirectories.
*/
if (fstatat(dst->dirfd, dst->name, &sb, AT_SYMLINK_NOFOLLOW) != -1) {
if (fstatat(dst->dirfd, dst->name, &tmp_sb, AT_SYMLINK_NOFOLLOW) != -1) {
return err;
}

Expand Down
Loading