PSP: when comparing categories in SELinux levels, ignore its order.

This commit is contained in:
Slava Semushin
2018-01-24 12:02:34 +01:00
parent 2f4cca73af
commit 072214597c
4 changed files with 105 additions and 2 deletions

View File

@@ -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
}