github.com/damirazo/docker@v1.9.0/pkg/idtools/usergroupadd_unsupported.go (about) 1 // +build !linux 2 3 package idtools 4 5 import ( 6 "fmt" 7 "os" 8 9 "github.com/docker/docker/pkg/system" 10 ) 11 12 // AddNamespaceRangesUser takes a name and finds an unused uid, gid pair 13 // and calls the appropriate helper function to add the group and then 14 // the user to the group in /etc/group and /etc/passwd respectively. 15 func AddNamespaceRangesUser(name string) (int, int, error) { 16 return -1, -1, fmt.Errorf("No support for adding users or groups on this OS") 17 } 18 19 // Platforms such as Windows do not support the UID/GID concept. So make this 20 // just a wrapper around system.MkdirAll. 21 func mkdirAs(path string, mode os.FileMode, ownerUID, ownerGID int, mkAll bool) error { 22 if err := system.MkdirAll(path, mode); err != nil && !os.IsExist(err) { 23 return err 24 } 25 return nil 26 }