1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

fix: ignore symlinks in fsync-store-paths

Fixes: https://github.com/NixOS/nix/issues/12099
This commit is contained in:
Yaroslav Bolyukin 2024-12-25 02:41:20 +01:00
parent f72752c0dc
commit 4a91e627a7
No known key found for this signature in database
GPG key ID: 1379319040F2773D

View file

@ -331,7 +331,7 @@ void syncParent(const Path & path)
void recursiveSync(const Path & path)
{
/* If it's a file, just fsync and return. */
/* If it's a file or symlink, just fsync and return. */
auto st = lstat(path);
if (S_ISREG(st.st_mode)) {
AutoCloseFD fd = toDescriptor(open(path.c_str(), O_RDONLY, 0));
@ -339,7 +339,8 @@ void recursiveSync(const Path & path)
throw SysError("opening file '%1%'", path);
fd.fsync();
return;
}
} else if (S_ISLNK(st.st_mode))
return;
/* Otherwise, perform a depth-first traversal of the directory and
fsync all the files. */