File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -106,11 +106,17 @@ type cgroupData struct {
106106// sense of the word). This includes EROFS (which for an unprivileged user is
107107// basically a permission error) and EACCES (for similar reasons) as well as
108108// the normal EPERM.
109- func isIgnorableError (err error ) bool {
109+ func isIgnorableError (rootless bool , err error ) bool {
110+ // We do not ignore errors if we are root.
111+ if ! rootless {
112+ return false
113+ }
114+ // Is it an ordinary EPERM?
110115 if os .IsPermission (errors .Cause (err )) {
111116 return true
112117 }
113118
119+ // Try to handle other errnos.
114120 var errno error
115121 switch err := errors .Cause (err ).(type ) {
116122 case * os.PathError :
@@ -172,7 +178,7 @@ func (m *Manager) Apply(pid int) (err error) {
172178 // been set, we don't bail on error in case of permission problems.
173179 // Cases where limits have been set (and we couldn't create our own
174180 // cgroup) are handled by Set.
175- if m .Rootless && isIgnorableError ( err ) && m .Cgroups .Path == "" {
181+ if isIgnorableError ( m .Rootless , err ) && m .Cgroups .Path == "" {
176182 delete (m .Paths , sys .Name ())
177183 continue
178184 }
You can’t perform that action at this time.
0 commit comments