mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
builder: fixPermissionsWindows(): use golang.org/x/sys/windows
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
3bba43b894
commit
70a4d886cd
1 changed files with 3 additions and 7 deletions
|
@ -67,21 +67,17 @@ func fixPermissionsWindows(source, destination, SID string) error {
|
|||
sddlString := system.SddlAdministratorsLocalSystem
|
||||
sddlString += "(A;OICI;GRGWGXRCWDSD;;;" + SID + ")"
|
||||
|
||||
securityDescriptor, err := winio.SddlToSecurityDescriptor(sddlString)
|
||||
securityDescriptor, err := windows.SecurityDescriptorFromString(sddlString)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var daclPresent uint32
|
||||
var daclDefaulted uint32
|
||||
var dacl *byte
|
||||
|
||||
err = system.GetSecurityDescriptorDacl(&securityDescriptor[0], &daclPresent, &dacl, &daclDefaulted)
|
||||
dacl, _, err := securityDescriptor.DACL()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return system.SetNamedSecurityInfo(windows.StringToUTF16Ptr(destination), windows.SE_FILE_OBJECT, windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION, sid, nil, dacl, nil)
|
||||
return windows.SetNamedSecurityInfo(destination, windows.SE_FILE_OBJECT, windows.OWNER_SECURITY_INFORMATION|windows.DACL_SECURITY_INFORMATION, sid, nil, dacl, nil)
|
||||
}
|
||||
|
||||
func validateCopySourcePath(imageSource *imageMount, origPath, platform string) error {
|
||||
|
|
Loading…
Reference in a new issue