aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-07-27 07:21:47 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-27 13:07:19 +0000
commit02e7efc2b35da65cb4e27b0d58923d6c7b3a1c6c (patch)
treecbb0d236dc3fe4c83874389ec521b1424b571b24 /vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go
parent876a30590b93757ca16ee607dee4f4458983620c (diff)
downloadpodman-02e7efc2b35da65cb4e27b0d58923d6c7b3a1c6c.tar.gz
podman-02e7efc2b35da65cb4e27b0d58923d6c7b3a1c6c.tar.bz2
podman-02e7efc2b35da65cb4e27b0d58923d6c7b3a1c6c.zip
Update vendored version of runc,buildah,containers/image
There is a compiler warning that has been fixed in the upstream, so I figured we should update to fix. Also vendor in latest buildah to get better support for running builds in rootless mode. Vendor in latest containers/image to allow daemon support to be pluggable. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1169 Approved by: mheon
Diffstat (limited to 'vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go')
-rw-r--r--vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go b/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go
new file mode 100644
index 000000000..65cd40e92
--- /dev/null
+++ b/vendor/github.com/opencontainers/runc/libcontainer/user/lookup_windows.go
@@ -0,0 +1,40 @@
+// +build windows
+
+package user
+
+import (
+ "fmt"
+ "os/user"
+)
+
+func lookupUser(username string) (User, error) {
+ u, err := user.Lookup(username)
+ if err != nil {
+ return User{}, err
+ }
+ return userFromOS(u)
+}
+
+func lookupUid(uid int) (User, error) {
+ u, err := user.LookupId(fmt.Sprintf("%d", uid))
+ if err != nil {
+ return User{}, err
+ }
+ return userFromOS(u)
+}
+
+func lookupGroup(groupname string) (Group, error) {
+ g, err := user.LookupGroup(groupname)
+ if err != nil {
+ return Group{}, err
+ }
+ return groupFromOS(g)
+}
+
+func lookupGid(gid int) (Group, error) {
+ g, err := user.LookupGroupId(fmt.Sprintf("%d", gid))
+ if err != nil {
+ return Group{}, err
+ }
+ return groupFromOS(g)
+}