guix/nix/libstore
Rutherther 2a0ac4cba5
daemon: Ensure store is writable even as non-root.
If the store is read only, return an error early.
This is bit of a compromise. Not all operations of the daemon need the store
as writable. For example, if hello package is built already `guix build hello`
could previously succeed even if store is RO.

* nix/libstore/local-store.cc
(makeStoreWritable): Rename to ensureStoreWritable.
(ensureStoreWritable): As non-root, check that the store is writable and if
not, throw an error.
(LocalStore::LocalStore): Use it.

* nix/libstore/local-store.hh: Rename makeStoreWritable to ensureStoreWritable.

Change-Id: I94783ba7e32d57bfa77e37e84b6ac316f95e31e2
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
2025-12-22 11:00:17 +01:00
..
.gitignore
build.cc daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
builtins.cc daemon: Use starts_with() and ends_with() instead of string() or hasSuffix() 2025-11-03 17:18:37 +01:00
builtins.hh daemon: Use starts_with() and ends_with() instead of string() or hasSuffix() 2025-11-03 17:18:37 +01:00
derivations.cc daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
derivations.hh daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
gc.cc daemon: Use starts_with() and ends_with() instead of string() or hasSuffix() 2025-11-03 17:18:37 +01:00
globals.cc daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
globals.hh daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
local-store.cc daemon: Ensure store is writable even as non-root. 2025-12-22 11:00:17 +01:00
local-store.hh daemon: Ensure store is writable even as non-root. 2025-12-22 11:00:17 +01:00
misc.cc daemon: Use starts_with() and ends_with() instead of string() or hasSuffix() 2025-11-03 17:18:37 +01:00
misc.hh guix gc: Adjust size suffix based on the amount of data. 2025-07-28 13:57:53 +03:00
optimise-store.cc daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
pathlocks.cc daemon: Bump to C++20 and use ‘std::format’ instead of ‘boost::format’. 2025-10-19 21:29:39 +02:00
pathlocks.hh
references.cc daemon: Bump to C++20 and use ‘std::format’ instead of ‘boost::format’. 2025-10-19 21:29:39 +02:00
references.hh
sqlite.cc daemon: Bump to C++20 and use ‘std::format’ instead of ‘boost::format’. 2025-10-19 21:29:39 +02:00
sqlite.hh daemon: Bump to C++20 and use ‘std::format’ instead of ‘boost::format’. 2025-10-19 21:29:39 +02:00
store-api.cc daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
store-api.hh daemon: Use inline functions and variables instead of extern 2025-11-12 18:34:06 +01:00
worker-protocol.hh