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)};