core: introduce PinnedResource
This introduces PinnedResources as a structure combining pinned references to a root directory, root image, or root mstack. This is not only easier to work with, but essential to make certain unpriv things work, as we need some mechanism to pin resources before we drop into a userns which might possibly not provide access anymore to those resources. Hence this does two things: introduce the new structure, and immediately hook it up so that we pin things properly before dropping into userns, and then makes use of this after dropping the right way, and enables unpriv userns operation. The concept is generic enough to eventually implement extension images + mount images with the same structure, but in order to keep the changes managable this is left for another time. (This also makes one further clean-up: client-side verity-reuse checks are moved server side if we are unpriv. Previously we'd do them client side, but they were doomed to fail because of lack of privs. Hence let's drop the client side if we are unpriv and purely do them server-side in that case.)
This commit is contained in:
@@ -74,6 +74,7 @@ typedef struct LoopDevice LoopDevice;
|
||||
typedef struct MachineBindUserContext MachineBindUserContext;
|
||||
typedef struct MachineCredentialContext MachineCredentialContext;
|
||||
typedef struct MountOptions MountOptions;
|
||||
typedef struct MStack MStack;
|
||||
typedef struct OpenFile OpenFile;
|
||||
typedef struct Pkcs11EncryptedKey Pkcs11EncryptedKey;
|
||||
typedef struct Table Table;
|
||||
|
||||
Reference in New Issue
Block a user