summaryrefslogtreecommitdiff
path: root/man/man8/lbexec.8
blob: 85a56b01792425e354b1e252fcd0cdb8c9a681fc (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
.Dd September 27, 2026
.Dt LBEXEC 8
.Os
.Sh NAME
.Nm lbexec
.Nd run one build command in a lockbox
.Sh SYNOPSIS
.Nm
.Op Fl p Cm standard | cargo
.Ar command
.Op Ar argument ...
.Sh DESCRIPTION
.Nm
restricts itself with the Linux Landlock security module and then
executes
.Ar command .
It is the per-command form of the lockbox described in
.Xr lockbox 7 :
.Xr mkpkg 8
puts it in front of the lines of
.Fn build
named in a recipe's
.Va lockbox
array.
It is not usually run by hand.
.Pp
Which files may be read is taken from the package database, as for the
full lockbox.
The declared dependencies come from the environment that
.Xr mkpkg 8
sets up; a declared one that is not installed is an error.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl p Cm standard
The default.
Read access to the base packages and the declared dependencies.
Read and write access to
.Ev MKPKG_WORK_DIR ,
.Ev SRC ,
.Ev PKG ,
.Ev PKGMK_SOURCE_DIR ,
.Pa /tmp
and
.Pa /dev ;
read access to
.Pa /proc
and
.Pa /etc .
.It Fl p Cm cargo
For cargo.
The same packages and build directories as
.Cm standard ,
but of
.Pa /etc
only
.Pa /etc/ssl ,
and of
.Ev CARGO_HOME
only
.Pa bin ,
.Pa env ,
.Pa .package-cache
and
.Pa toolchains ,
so the downloaded registry and git checkouts are not readable and
vendored sources must be used.
The command also runs in a new network namespace with only the loopback
interface, if the kernel and privileges allow it; otherwise it runs
with the network.
.Xr mkpkg 8
sets
.Ev TMPDIR
to
.Pa $SRC/tmp
for this profile, because cargo renames files from
.Ev TMPDIR
into its target directory.
.El
.Sh ENVIRONMENT
.Bl -tag -width MKPKG_MAKEDEPENDS
.It Ev MKPKG_DEPENDS , MKPKG_MAKEDEPENDS
Space-separated package names from the recipe's
.Va depends
and
.Va makedeps .
.It Ev MKPKG_WORK_DIR , SRC , PKG , PKGMK_SOURCE_DIR
Build directories that stay writable.
.It Ev CARGO_HOME
Cargo's home directory, for the cargo profile.
.It Ev PKG_DBDIR
Package database directory, instead of
.Pa /var/lib/pkg .
.El
.Sh EXIT STATUS
On success
.Nm
does not return: its exit status is that of
.Ar command .
It exits 1 if the lockbox cannot be set up or
.Ar command
cannot be run.
.Sh SEE ALSO
.Xr MAKEPKG 5 ,
.Xr lockbox 7 ,
.Xr mkpkg 8