PSP: when comparing categories in SELinux levels, ignore its order.
This commit is contained in:
@@ -222,3 +222,17 @@ func hasPathPrefix(s, pathPrefix string) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// EqualStringSlices compares string slices for equality. Slices are equal when
|
||||
// their sizes and elements on similar positions are equal.
|
||||
func EqualStringSlices(a, b []string) bool {
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < len(a); i++ {
|
||||
if a[i] != b[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user