From c16be6ac92b86981e8e4bb6703e694b675a28b0d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 9 Sep 2004 21:19:20 +0000 Subject: [PATCH] * Remove write permission from store objects after they have been added to the store. Bug reported by Martin. --- src/libstore/store.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libstore/store.cc b/src/libstore/store.cc index 5b471a1d9..1f05b63a6 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -448,6 +448,8 @@ Path addToStore(const Path & _srcPath) copyPath(srcPath, dstPath); + makePathReadOnly(dstPath); + Transaction txn(nixDB); registerValidPath(txn, dstPath); txn.commit(); @@ -476,6 +478,8 @@ void addTextToStore(const Path & dstPath, const string & s) writeStringToFile(dstPath, s); + makePathReadOnly(dstPath); + Transaction txn(nixDB); registerValidPath(txn, dstPath); txn.commit();