File: fakeroot.go

package info (click to toggle)
singularity-container 4.1.5%2Bds4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 43,876 kB
  • sloc: asm: 14,840; sh: 3,190; ansic: 1,751; awk: 414; makefile: 413; python: 99
file content (22 lines) | stat: -rw-r--r-- 1,040 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) 2020, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consult the
// LICENSE.md file distributed with the URIs of this project regarding your
// rights to use or distribute this software.

package fakeroot

import (
	"github.com/opencontainers/runtime-spec/specs-go"
)

// UserMapping callback returns fakeroot user mappings from plugin
// (eg: to get fakeroot mapping from an external database). If more
// than one plugin uses this callback the runtime aborts its execution.
// This callback is called in:
// - internal/pkg/runtime/engine/fakeroot/engine_linux.go (build command)
// - internal/pkg/runtime/engine/singularity/prepare_linux.go (actions commands)
// This function is usually called two times, a first time with path
// set to "/etc/subuid" and a second time with path set to "/etc/subgid"
// to get container UID and GID mappings for the user specified by the
// uid parameter.
type UserMapping func(path string, uid uint32) (*specs.LinuxIDMapping, error)