Skip to content

The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu

writer: compare what an untouched file grants, not its inheritance flags

Claude7becf24cbf72
diff --git a/cli/beacon/internal/endpoint/writer/logaccess_windows_test.go b/cli/beacon/internal/endpoint/writer/logaccess_windows_test.go
index 1afee88a..baea2835 100644
--- a/cli/beacon/internal/endpoint/writer/logaccess_windows_test.go
+++ b/cli/beacon/internal/endpoint/writer/logaccess_windows_test.go
@@ -3,6 +3,7 @@
package writer
import (
+ "fmt"
"os"
"path/filepath"
"reflect"
@@ -291,7 +292,19 @@ func TestShareSystemLogLeavesAnUnsecuredDirectoryAlone(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if !reflect.DeepEqual(before.DACL, after.DACL) {
+ // What the file grants, not whether an entry is marked inherited: making the directory's own
+ // ACL protected, as every shared install does, turns a child's inherited entries into explicit
+ // copies of the same grants.
+ if !reflect.DeepEqual(grants(before.DACL), grants(after.DACL)) {
t.Fatalf("a shared install reset a file it never restricted: %+v -> %+v", before.DACL, after.DACL)
}
}
+
+// grants is a DACL as who is allowed or denied what, without the inheritance flags.
+func grants(dacl []sysacl.ACE) []string {
+ out := make([]string, 0, len(dacl))
+ for _, ace := range dacl {
+ out = append(out, fmt.Sprintf("%d %s %#x", ace.Type, ace.SID, ace.Mask))
+ }
+ return out
+}