|
|
@ -161,14 +161,16 @@ func (d *daemonState) launch(p *oz.Profile, pwd string, args, env []string, uid,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (sbox *Sandbox) launchProgram(pwd string, args []string, log *logging.Logger) {
|
|
|
|
func (sbox *Sandbox) launchProgram(pwd string, args []string, log *logging.Logger) {
|
|
|
|
for _, fpath := range args {
|
|
|
|
if sbox.profile.AllowFiles {
|
|
|
|
if _, err := os.Stat(fpath); err == nil {
|
|
|
|
for _, fpath := range args {
|
|
|
|
if filepath.IsAbs(fpath) == false {
|
|
|
|
if _, err := os.Stat(fpath); err == nil {
|
|
|
|
fpath = path.Join(pwd, fpath)
|
|
|
|
if filepath.IsAbs(fpath) == false {
|
|
|
|
}
|
|
|
|
fpath = path.Join(pwd, fpath)
|
|
|
|
log.Info("Adding file `%s` to sandbox `%s`.", fpath, sbox.profile.Name)
|
|
|
|
}
|
|
|
|
if err := sbox.fs.AddBindWhitelist(fpath, fpath, false); err != nil {
|
|
|
|
log.Info("Adding file `%s` to sandbox `%s`.", fpath, sbox.profile.Name)
|
|
|
|
log.Warning("Error adding file `%s`!", fpath)
|
|
|
|
if err := sbox.fs.AddBindWhitelist(fpath, fpath, false); err != nil {
|
|
|
|
|
|
|
|
log.Warning("Error adding file `%s`!", fpath)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|