Documentation ¶
Index ¶
- Constants
- func Apply(name string, replace, inherit bool, entries ...api.ExplicitAccess) error
- func Chmod(name string, fileMode os.FileMode) error
- func DenyName(accessPermissions uint32, name string) api.ExplicitAccess
- func DenySid(accessPermissions uint32, sid *windows.SID) api.ExplicitAccess
- func GetEffectiveFileAccessMode(name string) (os.FileMode, error)
- func GetEffectiveRegKeyAccessMode(name string) (os.FileMode, error)
- func GetExplicitFileAccessMode(name string) (os.FileMode, error)
- func GetExplicitRegKeyAccessMode(name string) (os.FileMode, error)
- func GrantName(accessPermissions uint32, name string) api.ExplicitAccess
- func GrantSid(accessPermissions uint32, sid *windows.SID) api.ExplicitAccess
Constants ¶
const ( SID_NAME_CREATOR_OWNER = "S-1-3-0" SID_NAME_CREATOR_GROUP = "S-1-3-1" SID_NAME_EVERYONE = "S-1-1-0" SID_NAME_AUTHENTICATED_USERS = "S-1-5-11" )
const DELETE = 0x10000
const FILE_APPEND_DATA = windows.FILE_APPEND_DATA // for a directory, the ability to add a subdirectory
const FILE_EXECUTE = 0x20 // for a directory, the ability to traverse
const FILE_READ_ATTRIBUTES = 0x80
const FILE_READ_DATA = windows.FILE_LIST_DIRECTORY // for a directory, the ability to list contents
access mask constants from https://docs.microsoft.com/en-us/windows/desktop/wmisdk/file-and-directory-access-rights-constants the x/sys/windows package defines some but not all of these constants
const FILE_READ_EA = 0x08
const FILE_WRITE_ATTRIBUTES = windows.FILE_WRITE_ATTRIBUTES
const FILE_WRITE_DATA = 0x02 // for a directory, the ability to add a file
the windows package only has this by the "LIST_DIRECTORY" name
const FILE_WRITE_EA = 0x10
const PERM_EXECUTE uint32 = 0 | FILE_EXECUTE | FILE_READ_ATTRIBUTES | windows.STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE
const PERM_READ uint32 = 0 | FILE_READ_ATTRIBUTES | FILE_READ_DATA | FILE_READ_EA | windows.STANDARD_RIGHTS_READ | SYNCHRONIZE
const PERM_WRITE uint32 = 0 | FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_DATA | FILE_WRITE_EA | windows.STANDARD_RIGHTS_WRITE | SYNCHRONIZE
const SYNCHRONIZE = windows.SYNCHRONIZE
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
func Apply(name string, replace, inherit bool, entries ...api.ExplicitAccess) error
Apply the provided access control entries to a file. If the replace parameter is true, existing entries will be overwritten. If the inherit parameter is true, the file will inherit ACEs from its parent.
func Chmod ¶
Change the permissions of the specified file. Only the nine least-significant bytes are used, allowing access by the file's owner, the file's group, and everyone else to be explicitly controlled.
func DenyName ¶
func DenyName(accessPermissions uint32, name string) api.ExplicitAccess
Create an ExplicitAccess instance denying permissions to the provided name.
func DenySid ¶
func DenySid(accessPermissions uint32, sid *windows.SID) api.ExplicitAccess
Create an ExplicitAccess instance denying permissions to the provided SID.
Types ¶
This section is empty.