2014-01-13 21:36:59 -05:00
|
|
|
package lxc
|
2013-12-18 13:16:26 -05:00
|
|
|
|
|
|
|
import (
|
2014-06-19 14:07:57 -04:00
|
|
|
"fmt"
|
2015-01-12 13:43:33 -05:00
|
|
|
|
2014-07-24 18:25:29 -04:00
|
|
|
"github.com/docker/libcontainer/utils"
|
2013-12-18 13:16:26 -05:00
|
|
|
)
|
|
|
|
|
2014-08-08 16:18:18 -04:00
|
|
|
func finalizeNamespace(args *InitArgs) error {
|
2014-06-19 14:57:09 -04:00
|
|
|
if err := utils.CloseExecFrom(3); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2015-03-05 12:55:14 -05:00
|
|
|
if err := setupUser(args.User); err != nil {
|
2014-06-19 14:07:57 -04:00
|
|
|
return fmt.Errorf("setup user %s", err)
|
|
|
|
}
|
2014-06-19 14:57:09 -04:00
|
|
|
if err := setupWorkingDirectory(args); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2014-06-19 14:07:57 -04:00
|
|
|
return nil
|
|
|
|
}
|