mirror of
https://github.com/NixOS/nix
synced 2025-07-04 15:31:47 +02:00
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.
This commit is contained in:
parent
573e385a68
commit
de639ceafe
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue