Nix
2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Toggle main menu visibility
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
9
namespace
nix {
10
11
struct
LocalSettings
;
12
13
struct
UserLock
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
42
std::unique_ptr<UserLock>
acquireUserLock
(
43
const
std::filesystem::path & stateDir,
const
LocalSettings
& localSettings, uid_t nrIds,
bool
useUserNamespace);
44
45
bool
useBuildUsers(
const
LocalSettings
&);
46
47
}
// namespace nix
nix::LocalSettings
Definition
local-settings.hh:179
nix::UserLock
Definition
user-lock.hh:14
nix::UserLock::getUIDRange
std::pair< uid_t, uid_t > getUIDRange()
Definition
user-lock.hh:20
nix::UserLock::getUID
virtual uid_t getUID()=0
nix::acquireUserLock
std::unique_ptr< UserLock > acquireUserLock(const std::filesystem::path &stateDir, const LocalSettings &localSettings, uid_t nrIds, bool useUserNamespace)
Definition
user-lock.cc:227
libstore
unix
include
nix
store
user-lock.hh
Generated by
1.18.0