diff options
author | Michael Pratt <mpratt@google.com> | 2018-12-17 17:34:09 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-12-17 17:35:06 -0800 |
commit | b62591e6a813ec19a1fd74943584c4fead81f670 (patch) | |
tree | 33401c563bd3a8539b919b2d5fac3d5224d934e1 /runsc/boot/config.go | |
parent | e9c4f69f36308b370579c954badc7ad90146d6e7 (diff) |
Expose internal testing flag
Never to used outside of runsc tests!
PiperOrigin-RevId: 225919013
Change-Id: Ib3b14aa2a2564b5246fb3f8933d95e01027ed186
Diffstat (limited to 'runsc/boot/config.go')
-rw-r--r-- | runsc/boot/config.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/runsc/boot/config.go b/runsc/boot/config.go index b98e38ae9..e00d44df9 100644 --- a/runsc/boot/config.go +++ b/runsc/boot/config.go @@ -218,7 +218,7 @@ type Config struct { // ToFlags returns a slice of flags that correspond to the given Config. func (c *Config) ToFlags() []string { - return []string{ + f := []string{ "--root=" + c.RootDir, "--debug=" + strconv.FormatBool(c.Debug), "--log=" + c.LogFilename, @@ -237,4 +237,9 @@ func (c *Config) ToFlags() []string { "--panic-signal=" + strconv.Itoa(c.PanicSignal), "--trace-signal=" + strconv.Itoa(c.TraceSignal), } + if c.TestOnlyAllowRunAsCurrentUserWithoutChroot { + // Only include if set since it is never to be used by users. + f = append(f, "-TESTONLY-unsafe-nonroot=true") + } + return f } |