Skip to content

syscall: use Windows FILE_FLAG_BACKUP_SEMANTICS in remaining places (Open) #23312

@mappu

Description

@mappu

Hi,

FILE_FLAG_BACKUP_SEMANTICS is an optional flag to the Windows CreateFile API. It allows accessing files when privilege would be denied by normal Windows ACLs, except for that the user account has the SE_BACKUP_NAME privilege. If the calling user account does not have this privilege, adding this flag has no impact to behaviour nor performance.

Go already uses FILE_FLAG_BACKUP_SEMANTICS in some CreateFile calls (e.g. Readlink, Utimes, UtimesNano, from issues #8090 and #10804) but not in other cases (notably Open). So it's inconsistent.

I would like to request that FILE_FLAG_BACKUP_SEMANTICS is added to the Open call in src/syscall/syscall_windows.go.

As well as fixing the inconsistency, this would allow Go users to open files on disk, in those cases where their permission to do so comes via SE_BACKUP_NAME instead of windows ACLs.

Thanks
mappu

More information:

What version of Go are you using (go version)?

go version go1.9.2 windows/amd64

Does this issue reproduce with the latest release?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-Windows

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions