rclone/cmd/mountlib
Ivan Andreev 8c10dee510 mountlib: use procfs to validate mount on linux - #5593
Current way of checking whether mountpoint has been already mounted (directory
list) can result in race if rclone runs under Automount (classic or systemd).

This patch adopts Linux ProcFS for the check. Note that mountpoint is considered
empty if it's tagged as "mounted" by autofs. Also ProcFS is used to check whether
rclone mount was successful (ie. tagged by a string containing "rclone").

On macOS/BSD where ProcFS is unavailable the old method is still used.

This patch also moves a few utility functions unchanged to utils.go:
CheckOverlap, CheckAllowings, SetVolumeName.
2021-10-02 23:45:16 +03:00
..
check_linux.go mountlib: use procfs to validate mount on linux - #5593 2021-10-02 23:45:16 +03:00
check_other.go mountlib: use procfs to validate mount on linux - #5593 2021-10-02 23:45:16 +03:00
daemon_unix.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
daemon.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
help.go build: make go1.14 the minimum supported Go for building 2021-08-20 19:04:29 +01:00
mount.go mountlib: use procfs to validate mount on linux - #5593 2021-10-02 23:45:16 +03:00
rc_test.go mountlib: refactor before adding serve docker (#5415) 2021-07-10 23:56:09 +03:00
rc.go mountlib: refactor before adding serve docker (#5415) 2021-07-10 23:56:09 +03:00
sighup_unsupported.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
sighup.go build: apply gofmt from golang 1.17 2021-09-09 20:43:59 +03:00
utils.go mountlib: use procfs to validate mount on linux - #5593 2021-10-02 23:45:16 +03:00