From de639ceafe75ae25293f49f170ccad0c3e4a133f Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Sat, 15 Jun 2024 09:06:35 +0000 Subject: [PATCH] Don't chown when local-store is read-only If the local-store is using the read-only flag, the underlying filesystem might be read-only, thus an attempt to `chown` would always fail. --- src/libstore/local-store.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index b44879cc9..676a035fa 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -233,7 +233,7 @@ LocalStore::LocalStore(const Params & params) struct group * gr = getgrnam(settings.buildUsersGroup.get().c_str()); if (!gr) printError("warning: the group '%1%' specified in 'build-users-group' does not exist", settings.buildUsersGroup); - else { + else if (!readOnly) { struct stat st; if (stat(realStoreDir.get().c_str(), &st)) throw SysError("getting attributes of path '%1%'", realStoreDir);