From 858702d89b701f99c3b71381281a3f163962064e Mon Sep 17 00:00:00 2001 From: xSmurf Date: Sat, 27 Jun 2015 04:39:05 +0000 Subject: [PATCH] Blacklist items binded as readonly --- fs/fs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/fs.go b/fs/fs.go index 40423a8..ccb28d0 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -226,6 +226,9 @@ func (fs *Filesystem) blacklist(target string) error { if err := syscall.Mount(fs.absPath(src), fs.absPath(t), "", syscall.MS_BIND, "mode=400,gid=0"); err != nil { return fmt.Errorf("failed to bind %s -> %s for blacklist: %v", src, t, err) } + if err := remount(fs.absPath(t), syscall.MS_RDONLY); err != nil { + return fmt.Errorf("failed to bind %s -> %s for blacklist: %v", src, t, err) + } return nil }