Fix relabel for SELinux
With the changes merged into runc/libcontainer, are now causing SELinux to attempt a relabel always, even if the user did not request the relabel. If the user does not specify Z or z on the volume mount we should not attempt a relabel. Signed-off-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
e509fe604c
commit
d9011b3617
1 changed files with 4 additions and 3 deletions
|
@ -135,9 +135,10 @@ func (daemon *Daemon) registerMountPoints(container *Container, hostConfig *runc
|
|||
bind.Driver = v.DriverName()
|
||||
bind = setBindModeIfNull(bind)
|
||||
}
|
||||
shared := label.IsShared(bind.Mode)
|
||||
if err := label.Relabel(bind.Source, container.MountLabel, shared); err != nil {
|
||||
return err
|
||||
if label.RelabelNeeded(bind.Mode) {
|
||||
if err := label.Relabel(bind.Source, container.MountLabel, label.IsShared(bind.Mode)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
binds[bind.Destination] = true
|
||||
mountPoints[bind.Destination] = bind
|
||||
|
|
Loading…
Reference in a new issue