github.com/walkingsparrow/docker@v1.4.2-0.20151218153551-b708a2249bfa/daemon/exec_unix.go (about)

     1  // +build linux freebsd
     2  
     3  package daemon
     4  
     5  import (
     6  	"github.com/docker/docker/container"
     7  	"github.com/docker/docker/daemon/execdriver"
     8  	"github.com/docker/docker/runconfig"
     9  )
    10  
    11  // setPlatformSpecificExecProcessConfig sets platform-specific fields in the
    12  // ProcessConfig structure.
    13  func setPlatformSpecificExecProcessConfig(config *runconfig.ExecConfig, container *container.Container, pc *execdriver.ProcessConfig) {
    14  	user := config.User
    15  	if len(user) == 0 {
    16  		user = container.Config.User
    17  	}
    18  
    19  	pc.User = user
    20  	pc.Privileged = config.Privileged
    21  }