diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-23 17:04:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-23 17:04:40 +0100 |
commit | 8544bb57fe5e9222509827a7f5aa648516b9cd98 (patch) | |
tree | 2dcda2b058ca07b180ea1f017933c57dca033af8 /vendor/golang.org/x/sys/windows/security_windows.go | |
parent | 0778c114d3001bdd4f40fe46283457481d983b64 (diff) | |
parent | 057faea5c185d24cda40d310b0a80763ee46f4cc (diff) | |
download | podman-8544bb57fe5e9222509827a7f5aa648516b9cd98.tar.gz podman-8544bb57fe5e9222509827a7f5aa648516b9cd98.tar.bz2 podman-8544bb57fe5e9222509827a7f5aa648516b9cd98.zip |
Merge pull request #8813 from containers/dependabot/go_modules/github.com/containers/storage-1.24.4
Bump github.com/containers/storage from 1.24.3 to 1.24.4
Diffstat (limited to 'vendor/golang.org/x/sys/windows/security_windows.go')
-rw-r--r-- | vendor/golang.org/x/sys/windows/security_windows.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 14906485f..69eb462c5 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -624,6 +624,7 @@ func (tml *Tokenmandatorylabel) Size() uint32 { // Authorization Functions //sys checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) = advapi32.CheckTokenMembership +//sys isTokenRestricted(tokenHandle Token) (ret bool, err error) [!failretval] = advapi32.IsTokenRestricted //sys OpenProcessToken(process Handle, access uint32, token *Token) (err error) = advapi32.OpenProcessToken //sys OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token) (err error) = advapi32.OpenThreadToken //sys ImpersonateSelf(impersonationlevel uint32) (err error) = advapi32.ImpersonateSelf @@ -837,6 +838,16 @@ func (t Token) IsMember(sid *SID) (bool, error) { return b != 0, nil } +// IsRestricted reports whether the access token t is a restricted token. +func (t Token) IsRestricted() (isRestricted bool, err error) { + isRestricted, err = isTokenRestricted(t) + if !isRestricted && err == syscall.EINVAL { + // If err is EINVAL, this returned ERROR_SUCCESS indicating a non-restricted token. + err = nil + } + return +} + const ( WTS_CONSOLE_CONNECT = 0x1 WTS_CONSOLE_DISCONNECT = 0x2 |