hectane / go-acl

Go library for manipulating ACLs on Windows
MIT License
119 stars 31 forks source link

GetNamesSecurityInfo Limited to Paths < 260 Characters #5

Closed teschste closed 6 years ago

teschste commented 6 years ago

When calling api.GetNamedSecurityInfo to identify the owner of a file, if the path and filename passed are 260 characters or longer, the call is failing. The error returned is "The operation completed successfully." but no security Descriptor or Owner SID are returned, so the owner cannot be lookup up.

In today's LAN environments, being able to lookup file information for paths that are longer than 260 characters is a must.

For now I will continue to do this in .Net but I was really hoping to move this to Go, to improve performance.

Thanks!

teschste commented 6 years ago

Never mind, I forgot that for long paths, you need to prepend the path with \?\ for drive letters and \?\UNC\ for UNC paths. Closing issue.