rootlesscontainers

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

README

pkg/rootless-protobuf

The protobuf for this package comes from the rootlesscontaine.rs project, which has all of the relevant information for what this protobuf blob means. Effectively this is used in rootless mode for the purposes of emulating chown(2) within a rootless container (using something like remainroot or PRoot).

The protobuf itself comes from the website, and this package's sources can be regenerated using go generate (assuming you have protoc set up).

Documentation

Overview

Package rootlesscontainers is a generated protocol buffer package.

The rootlesscontainers package is maintained at https://rootlesscontaine.rs/ . If you want to extend the resource definition, please open a PR.

It is generated from these files:

rootlesscontainers.proto

It has these top-level messages:

Resource

Index

Constants

View Source
const Keyname = "user.rootlesscontainers"

Keyname is the official xattr key used to store rootlesscontainers.proto blobs, and is the only key we will treat in this special way.

Variables

View Source
var NoopID uint32 = 0xFFFFFFFF

NoopID is the uint32 that represents the "noop" id for uid/gid values. It is equal to uint32(-1) but since we cannot write that in Go we have to explicitly write the wrapped value.

Functions

func IsDefault

func IsDefault(r Resource) bool

IsDefault returns whether the given Resource is the default. If a Resource is equal to the default Resource then it is not necesary to include it on the filesystem.

Types

type Resource

type Resource struct {
	// Zero-value MUST be parsed as a literally zero-value, not "unset".
	// To keep both uid and gid unchaged, the entire xattr value SHOULD be removed.
	// To keep either one of uid or gid unchaged, -1 value SHOULD be set.
	// (Because some protobuf bindings cannot distinguish "unset" from zero-value.)
	Uid uint32 `protobuf:"varint,1,opt,name=uid" json:"uid,omitempty"`
	Gid uint32 `protobuf:"varint,2,opt,name=gid" json:"gid,omitempty"`
}

Resource defines the schema for "user.rootlesscontainers" xattr values. The resource can be used as a persistent storage for emulated `chown(2)` syscall. Syscall emulators SHOULD try to hide this xattr from the emulated environment.

func (*Resource) Descriptor

func (*Resource) Descriptor() ([]byte, []int)

func (*Resource) GetGid

func (m *Resource) GetGid() uint32

func (*Resource) GetUid

func (m *Resource) GetUid() uint32

func (*Resource) ProtoMessage

func (*Resource) ProtoMessage()

func (*Resource) Reset

func (m *Resource) Reset()

func (*Resource) String

func (m *Resource) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL