mirror of
https://github.com/containers/podman.git
synced 2026-03-13 08:01:19 +08:00
Improve relabel EPERM error for rootless
Fixes: https://github.com/containers/podman/issues/27184 Signed-off-by: Jan Rodák <hony.com@seznam.cz>
This commit is contained in:
@@ -3121,6 +3121,10 @@ func (c *Container) relabel(src, mountLabel string, shared bool) error {
|
||||
logrus.Debugf("Labeling not supported on %q", src)
|
||||
return nil
|
||||
}
|
||||
|
||||
if errors.Is(err, unix.EPERM) {
|
||||
return fmt.Errorf("failed to change selinux label: insufficient permissions, possibly due to a file owned by another user (current user: uid %d): %w", rootless.GetRootlessUID(), err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user