mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
libct: remove relabeling dead code
There is no way to set Mount.Relabel field via OCI spec (config.json), and so the relabeling code is never used. My guess it's a leftover from times when runc used to be part of Docker. Remove it, and mark Relabel field as deprecated. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -43,8 +43,10 @@ type Mount struct {
|
|||||||
// Mount data applied to the mount.
|
// Mount data applied to the mount.
|
||||||
Data string `json:"data,omitempty"`
|
Data string `json:"data,omitempty"`
|
||||||
|
|
||||||
// Relabel source if set, "z" indicates shared, "Z" indicates unshared.
|
// Relabel field is ignored.
|
||||||
Relabel string `json:"relabel,omitempty"`
|
//
|
||||||
|
// Deprecated: do not use. This field will be removed in runc 1.7.
|
||||||
|
Relabel string
|
||||||
|
|
||||||
// RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2).
|
// RecAttr represents mount properties to be applied recursively (AT_RECURSIVE), see mount_setattr(2).
|
||||||
RecAttr *unix.MountAttr `json:"rec_attr,omitempty"`
|
RecAttr *unix.MountAttr `json:"rec_attr,omitempty"`
|
||||||
|
|||||||
@@ -747,16 +747,6 @@ func mountToRootfs(c *mountConfig, m mountEntry) error {
|
|||||||
return fmt.Errorf("failed to set user-requested vfs flags on bind-mount: %w", err)
|
return fmt.Errorf("failed to set user-requested vfs flags on bind-mount: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if m.Relabel != "" {
|
|
||||||
if err := label.Validate(m.Relabel); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
shared := label.IsShared(m.Relabel)
|
|
||||||
if err := label.Relabel(m.Source, mountLabel, shared); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return setRecAttr(m)
|
return setRecAttr(m)
|
||||||
case "cgroup":
|
case "cgroup":
|
||||||
if cgroups.IsCgroup2UnifiedMode() {
|
if cgroups.IsCgroup2UnifiedMode() {
|
||||||
|
|||||||
Reference in New Issue
Block a user