(mountSource, mountPoint string, allowExec bool, allowSuid bool)
| 1342 | } |
| 1343 | |
| 1344 | func (p linux) bindMountDir(mountSource, mountPoint string, allowExec bool, allowSuid bool) error { |
| 1345 | bindMounter := boshdisk.NewLinuxBindMounter(p.diskManager.GetMounter()) |
| 1346 | mounted, err := bindMounter.IsMounted(mountPoint) |
| 1347 | |
| 1348 | if !mounted && err == nil { |
| 1349 | err = bindMounter.Mount(mountSource, mountPoint) |
| 1350 | if err != nil { |
| 1351 | return bosherr.WrapErrorf(err, "Bind mounting %s dir over %s", mountSource, mountPoint) |
| 1352 | } |
| 1353 | } else if err != nil { |
| 1354 | return err |
| 1355 | } |
| 1356 | |
| 1357 | mountOptions := []string{"nodev"} |
| 1358 | if !allowSuid { |
| 1359 | mountOptions = append(mountOptions, "nosuid") |
| 1360 | } |
| 1361 | if !allowExec { |
| 1362 | mountOptions = append(mountOptions, "noexec") |
| 1363 | } |
| 1364 | return bindMounter.RemountInPlace(mountPoint, mountOptions...) |
| 1365 | } |
| 1366 | |
| 1367 | func (p linux) changeTmpDirPermissions(path string) error { |
| 1368 | _, _, _, err := p.cmdRunner.RunCommand("chown", "root:vcap", path) |
no test coverage detected