From c827fa981f54180767def53548a9e074d3c703df Mon Sep 17 00:00:00 2001 From: xSmurf Date: Tue, 7 Jul 2015 00:27:03 +0000 Subject: [PATCH] logging --- fs/fs.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/fs.go b/fs/fs.go index 1210e8f..fbf73a6 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -150,13 +150,15 @@ func (fs *Filesystem) bind(from string, to string, flags int, u *user.User) erro if err := copyPathPermissions(fs.Root(), src); err != nil { return fmt.Errorf("failed to copy path permissions for (%s): %v", src, err) } - fs.log.Info("bind mounting %s -> %s", src, to) + rolog := " " mntflags := syscall.MS_NOSUID | syscall.MS_NODEV if flags&BindReadOnly != 0 { mntflags |= syscall.MS_RDONLY + rolog = "(as readonly) " } else { flags |= syscall.MS_NOEXEC } + fs.log.Info("bind mounting %s%s -> %s", rolog, src, to) return bindMount(src, to, mntflags) } @@ -170,6 +172,7 @@ func (fs *Filesystem) UnbindPath(to string) (error) { } // XXX + fs.log.Info("unbinding %s", to) if err := syscall.Unmount(to, syscall.MNT_DETACH/* | syscall.MNT_FORCE*/); err != nil { return err }