1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-10-18 00:16:11 -04:00

path fetcher: Allow the lastModified attribute to be overriden again

Fixes #11660.
This commit is contained in:
Eelco Dolstra 2024-10-14 16:17:18 +02:00
parent d5c45952ac
commit 5d35424445

View file

@ -157,6 +157,10 @@ struct PathInputScheme : InputScheme
}); });
storePath = store->addToStoreFromDump(*src, "source"); storePath = store->addToStoreFromDump(*src, "source");
} }
/* Trust the lastModified value supplied by the user, if
any. It's not a "secure" attribute so we don't care. */
if (!input.getLastModified())
input.attrs.insert_or_assign("lastModified", uint64_t(mtime)); input.attrs.insert_or_assign("lastModified", uint64_t(mtime));
return {makeStorePathAccessor(store, *storePath), std::move(input)}; return {makeStorePathAccessor(store, *storePath), std::move(input)};