2018-02-05 16:05:59 -05:00
|
|
|
package system // import "github.com/docker/docker/pkg/system"
|
2015-09-09 19:23:06 -07:00
|
|
|
|
2022-01-26 13:39:03 +01:00
|
|
|
import "golang.org/x/sys/windows"
|
2015-10-15 11:40:14 -07:00
|
|
|
|
2017-11-15 22:20:33 -08:00
|
|
|
const (
|
2021-06-18 10:37:04 +02:00
|
|
|
// Deprecated: use github.com/docker/pkg/idtools.SeTakeOwnershipPrivilege
|
2017-11-15 22:20:33 -08:00
|
|
|
SeTakeOwnershipPrivilege = "SeTakeOwnershipPrivilege"
|
2021-06-18 10:37:04 +02:00
|
|
|
// Deprecated: use github.com/docker/pkg/idtools.ContainerAdministratorSidString
|
2017-11-15 22:20:33 -08:00
|
|
|
ContainerAdministratorSidString = "S-1-5-93-2-1"
|
2021-06-18 10:37:04 +02:00
|
|
|
// Deprecated: use github.com/docker/pkg/idtools.ContainerUserSidString
|
|
|
|
ContainerUserSidString = "S-1-5-93-2-2"
|
2017-11-15 22:20:33 -08:00
|
|
|
)
|
|
|
|
|
2022-01-26 13:39:03 +01:00
|
|
|
// VER_NT_WORKSTATION, see https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-osversioninfoexa
|
|
|
|
const verNTWorkstation = 0x00000001 // VER_NT_WORKSTATION
|
2016-04-14 17:12:02 -07:00
|
|
|
|
2021-06-18 09:53:50 +02:00
|
|
|
// IsWindowsClient returns true if the SKU is client. It returns false on
|
|
|
|
// Windows server, or if an error occurred when making the GetVersionExW
|
|
|
|
// syscall.
|
2016-04-14 17:12:02 -07:00
|
|
|
func IsWindowsClient() bool {
|
2022-01-26 13:39:03 +01:00
|
|
|
ver := windows.RtlGetVersion()
|
|
|
|
return ver != nil && ver.ProductType == verNTWorkstation
|
2016-04-14 17:12:02 -07:00
|
|
|
}
|