Skip to content

Commit

Permalink
sshfs_reverse_mount: make reverse mounts work with relative paths
Browse files Browse the repository at this point in the history
Previously the reverse mount "checking" would fail because
/proc/mounts contains an absolute path, not a relative path.
  • Loading branch information
dustymabe committed Nov 11, 2016
1 parent 411c08e commit 26af654
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def self.sshfs_reverse_is_folder_mounted(env, opts)
hostpath = opts[:hostpath].dup
hostpath.gsub!("'", "'\\\\''")
hostpath = hostpath.chomp('/') # remove trailing / if exists
hostpath = File.expand_path(hostpath) # get the absolute path of the file
mounts = File.open('/proc/mounts', 'r')
mounts.each_line do |line|
if line.split()[1] == hostpath
Expand Down

0 comments on commit 26af654

Please sign in to comment.