feat(aa-log): unify the isOwner function across features.

This commit is contained in:
Alexandre Pujol 2024-10-06 20:17:19 +01:00
parent 856c425dd5
commit 29a1642598
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
2 changed files with 5 additions and 6 deletions

View file

@ -29,7 +29,7 @@ func init() {
}
}
func isOwner(log map[string]string) bool {
func IsOwner(log map[string]string) bool {
fsuid, hasFsUID := log["fsuid"]
ouid, hasOuUID := log["ouid"]
isDbus := strings.Contains(log["operation"], "dbus")
@ -98,7 +98,7 @@ func newFileFromLog(log map[string]string) Rule {
return &File{
Base: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Owner: isOwner(log),
Owner: IsOwner(log),
Path: log["name"],
Access: accesses,
Target: log["target"],
@ -262,7 +262,7 @@ func newLinkFromLog(log map[string]string) Rule {
return &Link{
Base: newBaseFromLog(log),
Qualifier: newQualifierFromLog(log),
Owner: isOwner(log),
Owner: IsOwner(log),
Path: log["name"],
Target: log["target"],
}