Commit 95c63709 authored by Chris Marget's avatar Chris Marget Committed by Han-Wen Nienhuys

Removed UID test and syscall-based unmount.

On a Linux system with go-fuse program running as root, the mount is
performed by calling /bin/fusermount, and the unmount is performed with
syscall.Unmount()

This creates a problem on systems (CentOS 6) with a static-but-edited-by-mount
/etc/mtab file.

 - fusermount adds a line to mtab when the go-fuse program starts
 - syscall.Unmount() doesn't edit the file on program exit
 - subsequent invocations of the program fail to mount with:

    "Mount fail: fusermount exited with code 256"

Deleting the now-inaccurate mtab entry clears things up.

There's probably a workaround by adding "-n" option so that mount doesn't
edit mtab in the first place, but it's not obvious where to insert that when
starting with the hello.go example.
parent 8393ebf1
...@@ -80,9 +80,6 @@ func mount(mountPoint string, opts *MountOptions, ready chan<- error) (fd int, e ...@@ -80,9 +80,6 @@ func mount(mountPoint string, opts *MountOptions, ready chan<- error) (fd int, e
} }
func unmount(mountPoint string) (err error) { func unmount(mountPoint string) (err error) {
if os.Geteuid() == 0 {
return syscall.Unmount(mountPoint, 0)
}
bin, err := fusermountBinary() bin, err := fusermountBinary()
if err != nil { if err != nil {
return err return err
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment