mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6f8878872f
In TP5, Hyper-V containers need all image files ACLed so that the virtual machine process can access them. This was fixed post-TP5 in Windows, but for TP5 we need to explicitly add these ACLs. Signed-off-by: John Starks <jostarks@microsoft.com>
18 lines
519 B
Go
18 lines
519 B
Go
package windows
|
|
|
|
import "testing"
|
|
|
|
func TestAddAceToSddlDacl(t *testing.T) {
|
|
cases := [][3]string{
|
|
{"D:", "(A;;;)", "D:(A;;;)"},
|
|
{"D:(A;;;)", "(A;;;)", "D:(A;;;)"},
|
|
{"O:D:(A;;;stuff)", "(A;;;new)", "O:D:(A;;;new)(A;;;stuff)"},
|
|
{"O:D:(D;;;no)(A;;;stuff)", "(A;;;new)", "O:D:(D;;;no)(A;;;new)(A;;;stuff)"},
|
|
}
|
|
|
|
for _, c := range cases {
|
|
if newSddl, worked := addAceToSddlDacl(c[0], c[1]); !worked || newSddl != c[2] {
|
|
t.Errorf("%s + %s == %s, expected %s (%v)", c[0], c[1], newSddl, c[2], worked)
|
|
}
|
|
}
|
|
}
|