security

package
v1.247356.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SE_UNKNOWN_OBJECT_TYPE = iota
	SE_FILE_OBJECT
)

https://docs.microsoft.com/en-us/windows/win32/api/accctrl/ne-accctrl-se_object_type

View Source
const (
	ACCESS_ALLOWED_ACE_TYPE = 0
	ACCESS_DENIED_ACE_TYPE  = 1
	FILE_ALL_ACCESS         = (windows.STANDARD_RIGHTS_ALL | 0x1FF)
)

https://github.com/mhammond/pywin32/blob/70ddf693927fa1635f15e9ef41eb1aea37fdf32a/win32/Lib/ntsecuritycon.py

View Source
const (
	AclSizeInformationEnum    = 2
	DACL_SECURITY_INFORMATION = 0x00004
)

Variables

This section is empty.

Functions

func CheckFileRights

func CheckFileRights(filePath string) error

CheckFileRights check that the given filename has access controls and system permission for Administrator, Local System

func GetAce

func GetAce(acl *Acl, index uint32, ace **AccessAllowedAce) error

Obtain a pointer to an access control entry (ACE) in an access control list (ACL). For more information: https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-getace

func GetAclInformation

func GetAclInformation(acl *Acl, info *AclSizeInformation, class uint32) error

Retrieve information about access control list (e.g a file) For more information: https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-getaclinformation

func GetNamedSecurityInfo

func GetNamedSecurityInfo(objectName string, objectType int32, secInfo uint32, owner, group **windows.SID, dacl, sacl **Acl, secDesc *windows.Handle) error

Retrieve a copy of security descriptor for an object specified by name (e.g a file) For more information: https://docs.microsoft.com/en-us/windows/win32/api/aclapi/nf-aclapi-getnamedsecurityinfoa

Types

type Acl

type Acl struct {
	AclRevision uint8
	Sbz1        uint8
	AclSize     uint16
	AceCount    uint16
	Sbz2        uint16
}

https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-acl

type AclSizeInformation

type AclSizeInformation struct {
	AceCount      uint32
	AclBytesInUse uint32
	AclBytesFree  uint32
}

https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-acl_size_information

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL