fix(safeio): normalize NT relative access masks
This commit is contained in:
@@ -70,6 +70,16 @@ func TestOwnerOnlyDACLAcceptsWindowsFullControlMask(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestWindowsNTDesiredAccessMapsGenericBits(t *testing.T) {
|
||||
if got, want := normalizeWindowsNTDesiredAccess(windows.GENERIC_READ), uint32(windows.FILE_GENERIC_READ); got != want {
|
||||
t.Fatalf("normalized generic read access = %#x, want %#x", got, want)
|
||||
}
|
||||
want := uint32(windows.FILE_GENERIC_READ | windows.WRITE_DAC | windows.WRITE_OWNER)
|
||||
if got := normalizeWindowsNTDesiredAccess(windows.GENERIC_READ | windows.WRITE_DAC | windows.WRITE_OWNER); got != want {
|
||||
t.Fatalf("normalized protected read access = %#x, want %#x", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestOwnerOnlyDACLNativeShape(t *testing.T) {
|
||||
directory := filepath.Join(t.TempDir(), "auth")
|
||||
if err := os.Mkdir(directory, 0o700); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user