Skip to content

Commit

Permalink
Ignore isnot exists errors for proc paths
Browse files Browse the repository at this point in the history
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
  • Loading branch information
crosbymichael committed Apr 24, 2014
1 parent 1cac351 commit 5d4927c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion security/restrict/restrict.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package restrict

import (
"fmt"
"github.com/dotcloud/docker/pkg/system"
"os"
"path/filepath"
"syscall"

"github.com/dotcloud/docker/pkg/system"
)

const flags = syscall.MS_BIND | syscall.MS_REC | syscall.MS_RDONLY
Expand Down Expand Up @@ -36,6 +38,9 @@ func Restrict(rootfs, empty string) error {
source = filepath.Join(rootfs, source)
}
if err := system.Mount(source, dest, "bind", flags, ""); err != nil {
if os.IsNotExist(err) {
continue
}
return fmt.Errorf("unable to mount %s over %s %s", source, dest, err)
}
if err := system.Mount("", dest, "bind", flags|syscall.MS_REMOUNT, ""); err != nil {
Expand Down

0 comments on commit 5d4927c

Please sign in to comment.