Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
user-lock.hh
Go to the documentation of this file.
1#pragma once
3
4#include <filesystem>
5#include <memory>
6#include <vector>
7#include <sys/types.h>
8
9namespace nix {
10
11struct LocalSettings;
12
14{
15 virtual ~UserLock();
16
20 std::pair<uid_t, uid_t> getUIDRange()
21 {
22 auto first = getUID();
23 return {first, first + getUIDCount() - 1};
24 }
25
29 virtual uid_t getUID() = 0;
30
31 virtual uid_t getUIDCount() = 0;
32
33 virtual gid_t getGID() = 0;
34
35 virtual std::vector<gid_t> getSupplementaryGIDs() = 0;
36};
37
42std::unique_ptr<UserLock> acquireUserLock(
43 const std::filesystem::path & stateDir, const LocalSettings & localSettings, uid_t nrIds, bool useUserNamespace);
44
45bool useBuildUsers(const LocalSettings &);
46
47} // namespace nix
Definition local-settings.hh:179
Definition user-lock.hh:14
std::pair< uid_t, uid_t > getUIDRange()
Definition user-lock.hh:20
virtual uid_t getUID()=0
std::unique_ptr< UserLock > acquireUserLock(const std::filesystem::path &stateDir, const LocalSettings &localSettings, uid_t nrIds, bool useUserNamespace)
Definition user-lock.cc:227