File: fakeroot.go

package info (click to toggle)
apptainer 1.4.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,780 kB
  • sloc: sh: 3,329; ansic: 1,706; awk: 414; python: 103; makefile: 54
file content (26 lines) | stat: -rw-r--r-- 1,285 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
23
24
25
26
// Copyright (c) Contributors to the Apptainer project, established as
//   Apptainer a Series of LF Projects LLC.
//   For website terms of use, trademark policy, privacy policy and other
//   project policies see https://lfprojects.org/policies
// 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/apptainer/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)