2015-11-01 18:53:15 +03:00
|
|
|
// +build linux freebsd
|
|
|
|
|
|
|
|
package daemon
|
|
|
|
|
|
|
|
import (
|
2015-11-12 22:55:17 +03:00
|
|
|
"github.com/docker/docker/container"
|
2015-11-01 18:53:15 +03:00
|
|
|
"github.com/docker/docker/daemon/execdriver"
|
2016-01-05 03:05:26 +03:00
|
|
|
"github.com/docker/engine-api/types"
|
2015-11-01 18:53:15 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
// setPlatformSpecificExecProcessConfig sets platform-specific fields in the
|
|
|
|
// ProcessConfig structure.
|
2015-12-18 21:17:54 +03:00
|
|
|
func setPlatformSpecificExecProcessConfig(config *types.ExecConfig, container *container.Container, pc *execdriver.ProcessConfig) {
|
2015-11-01 18:53:15 +03:00
|
|
|
user := config.User
|
|
|
|
if len(user) == 0 {
|
|
|
|
user = container.Config.User
|
|
|
|
}
|
|
|
|
|
|
|
|
pc.User = user
|
|
|
|
pc.Privileged = config.Privileged
|
|
|
|
}
|