(t initType, config *initConfig, pipe *syncSocket, consoleSocket, pidfdSocket, fifoFile, logPipe *os.File)
| 239 | } |
| 240 | |
| 241 | func containerInit(t initType, config *initConfig, pipe *syncSocket, consoleSocket, pidfdSocket, fifoFile, logPipe *os.File) error { |
| 242 | // Clean the RLIMIT_NOFILE cache in go runtime. |
| 243 | // Issue: https://github.com/opencontainers/runc/issues/4195 |
| 244 | maybeClearRlimitNofileCache(config.Rlimits) |
| 245 | |
| 246 | switch t { |
| 247 | case initSetns: |
| 248 | i := &linuxSetnsInit{ |
| 249 | pipe: pipe, |
| 250 | consoleSocket: consoleSocket, |
| 251 | pidfdSocket: pidfdSocket, |
| 252 | config: config, |
| 253 | logPipe: logPipe, |
| 254 | } |
| 255 | return i.Init() |
| 256 | case initStandard: |
| 257 | i := &linuxStandardInit{ |
| 258 | pipe: pipe, |
| 259 | consoleSocket: consoleSocket, |
| 260 | pidfdSocket: pidfdSocket, |
| 261 | parentPid: unix.Getppid(), |
| 262 | config: config, |
| 263 | fifoFile: fifoFile, |
| 264 | logPipe: logPipe, |
| 265 | } |
| 266 | return i.Init() |
| 267 | } |
| 268 | return fmt.Errorf("unknown init type %q", t) |
| 269 | } |
| 270 | |
| 271 | // verifyCwd ensures that the current directory is actually inside the mount |
| 272 | // namespace root of the current process. |
no test coverage detected
searching dependent graphs…