mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
Only set cwd when not empty
For existing consumers of libconatiner to not require cwd inside the libcontainer code. This can be done at the runc level and is already evaluated there. Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -134,8 +134,10 @@ func finalizeNamespace(config *initConfig) error {
|
||||
if err := w.drop(); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := syscall.Chdir(config.Cwd); err != nil {
|
||||
return err
|
||||
if config.Cwd != "" {
|
||||
if err := syscall.Chdir(config.Cwd); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user