summaryrefslogtreecommitdiffhomepage
path: root/runsc/boot/loader.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-12 02:34:02 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-12 02:34:02 +0000
commitcfb23030268694af0182e6ca125c28497faf5957 (patch)
tree8a2293e7efa610394d7a60848fe90d2e6b528844 /runsc/boot/loader.go
parent8764f07263a10122b4100f0895d0259708a7967f (diff)
parent8ea99d58ffd708aa7a26be58d89cb817d8eceec6 (diff)
Merge release-20200522.0-147-g8ea99d58f (automated)
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r--runsc/boot/loader.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go
index 002479612..b05a8bd45 100644
--- a/runsc/boot/loader.go
+++ b/runsc/boot/loader.go
@@ -754,6 +754,21 @@ func (l *Loader) startContainer(spec *specs.Spec, conf *Config, cid string, file
return err
}
+ // Add the HOME enviroment variable if it is not already set.
+ var envv []string
+ if kernel.VFS2Enabled {
+ envv, err = user.MaybeAddExecUserHomeVFS2(ctx, procArgs.MountNamespaceVFS2,
+ procArgs.Credentials.RealKUID, procArgs.Envv)
+
+ } else {
+ envv, err = user.MaybeAddExecUserHome(ctx, procArgs.MountNamespace,
+ procArgs.Credentials.RealKUID, procArgs.Envv)
+ }
+ if err != nil {
+ return err
+ }
+ procArgs.Envv = envv
+
// Create and start the new process.
tg, _, err := l.k.CreateProcess(procArgs)
if err != nil {