fix(safeio): retain attribute inspection on private create
This commit is contained in:
@@ -461,6 +461,11 @@ func createWindowsPrivateRegularAtWithAccess(parent windows.Handle, name string,
|
|||||||
return nil, ErrUnsafeFile
|
return nil, ErrUnsafeFile
|
||||||
}
|
}
|
||||||
defer security.Close()
|
defer security.Close()
|
||||||
|
// The caller's data authority is intentionally preserved (GENERIC_WRITE is used for
|
||||||
|
// streaming creates), but privateWindowsRegularInfo must inspect attributes and links
|
||||||
|
// before returning the handle. FILE_READ_ATTRIBUTES grants that inspection without
|
||||||
|
// adding read-data authority to a write-only create.
|
||||||
|
access |= windows.FILE_READ_ATTRIBUTES
|
||||||
handle, err := openWindowsRelativeObject(
|
handle, err := openWindowsRelativeObject(
|
||||||
parent,
|
parent,
|
||||||
name,
|
name,
|
||||||
|
|||||||
Reference in New Issue
Block a user