Merge pull request #619 from rhatdan/relabel
Fix relabel to allow volume mounting of /
This commit is contained in:
commit
4369703200
|
@ -105,14 +105,14 @@ func Relabel(path string, fileLabel string, relabel string) error {
|
||||||
if fileLabel == "" {
|
if fileLabel == "" {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
if !strings.ContainsAny(relabel, "zZ") {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
for _, p := range exclude_path {
|
for _, p := range exclude_path {
|
||||||
if path == p {
|
if path == p {
|
||||||
return fmt.Errorf("Relabeling of %s is not allowed", path)
|
return fmt.Errorf("Relabeling of %s is not allowed", path)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !strings.ContainsAny(relabel, "zZ") {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
if strings.Contains(relabel, "z") && strings.Contains(relabel, "Z") {
|
if strings.Contains(relabel, "z") && strings.Contains(relabel, "Z") {
|
||||||
return fmt.Errorf("Bad SELinux option z and Z can not be used together")
|
return fmt.Errorf("Bad SELinux option z and Z can not be used together")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue