Merge pull request #10916 from jmbaur/read-only-no-chown

Don't chown when local-store is read-only
This commit is contained in:
Robert Hensing 2024-06-17 13:49:19 +02:00 committed by GitHub
commit e48abec567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -233,7 +233,7 @@ LocalStore::LocalStore(const Params & params)
struct group * gr = getgrnam(settings.buildUsersGroup.get().c_str()); struct group * gr = getgrnam(settings.buildUsersGroup.get().c_str());
if (!gr) if (!gr)
printError("warning: the group '%1%' specified in 'build-users-group' does not exist", settings.buildUsersGroup); printError("warning: the group '%1%' specified in 'build-users-group' does not exist", settings.buildUsersGroup);
else { else if (!readOnly) {
struct stat st; struct stat st;
if (stat(realStoreDir.get().c_str(), &st)) if (stat(realStoreDir.get().c_str(), &st))
throw SysError("getting attributes of path '%1%'", realStoreDir); throw SysError("getting attributes of path '%1%'", realStoreDir);