mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
cgroupfs: Allow explicit "/" as initial cgroup.
PiperOrigin-RevId: 448361452
This commit is contained in:
committed by
gVisor bot
parent
e916e4fde3
commit
700014c960
@@ -364,10 +364,14 @@ func (fs *filesystem) prepareInitialCgroup(ctx context.Context, vfsObj *vfs.Virt
|
||||
}
|
||||
ctx.Debugf("cgroupfs.FilesystemType.GetFilesystem: initial cgroup path: %v", initPathStr)
|
||||
initPath := fspath.Parse(initPathStr)
|
||||
if !initPath.Absolute || !initPath.HasComponents() {
|
||||
if !initPath.Absolute {
|
||||
ctx.Warningf("cgroupfs.FilesystemType.GetFilesystem: initial cgroup path invalid: %+v", initPath)
|
||||
return linuxerr.EINVAL
|
||||
}
|
||||
if !initPath.HasComponents() {
|
||||
// Explicit "/" as initial cgroup, nothing to do.
|
||||
return nil
|
||||
}
|
||||
|
||||
ownerCreds := auth.CredentialsFromContext(ctx).Fork()
|
||||
if idata.InitialCgroup.SetOwner {
|
||||
|
||||
Reference in New Issue
Block a user