diff -Nru vagrant-sshfs-1.3.0/debian/changelog vagrant-sshfs-1.3.1/debian/changelog --- vagrant-sshfs-1.3.0/debian/changelog 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/changelog 2019-01-26 22:20:29.000000000 +0000 @@ -1,3 +1,14 @@ +vagrant-sshfs (1.3.1-1) unstable; urgency=medium + + * New upstream version 1.3.1 + * point Vcs tags to salsa.debian.org + * make debian/watch check the PGP signatures + * update to current gemwatch + * use HTTPS for debian/copyright URL + * Standards-Version: 4.3.0: remove get-orig-source + + -- Hans-Christoph Steiner Sat, 26 Jan 2019 22:20:29 +0000 + vagrant-sshfs (1.3.0-2) unstable; urgency=medium * Team upload. diff -Nru vagrant-sshfs-1.3.0/debian/control vagrant-sshfs-1.3.1/debian/control --- vagrant-sshfs-1.3.0/debian/control 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/control 2019-01-26 22:20:29.000000000 +0000 @@ -7,9 +7,9 @@ gem2deb, rake, vagrant (>= 1.5) -Standards-Version: 3.9.8 -Vcs-Git: https://anonscm.debian.org/pkg-ruby-extras/vagrant-sshfs.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-ruby-extras/vagrant-sshfs.git +Standards-Version: 4.3.0 +Vcs-Git: https://salsa.debian.org/ruby-team/vagrant-sshfs.git +Vcs-Browser: https://salsa.debian.org/ruby-team/vagrant-sshfs Homepage: https://github.com/dustymabe/vagrant-sshfs Testsuite: autopkgtest-pkg-ruby XS-Ruby-Versions: all diff -Nru vagrant-sshfs-1.3.0/debian/copyright vagrant-sshfs-1.3.1/debian/copyright --- vagrant-sshfs-1.3.0/debian/copyright 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/copyright 2017-08-30 10:03:00.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: vagrant-sshfs Source: https://github.com/dustymabe/vagrant-sshfs diff -Nru vagrant-sshfs-1.3.0/debian/patches/remove-win32-process.patch vagrant-sshfs-1.3.1/debian/patches/remove-win32-process.patch --- vagrant-sshfs-1.3.0/debian/patches/remove-win32-process.patch 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/patches/remove-win32-process.patch 2019-01-26 22:20:29.000000000 +0000 @@ -9,6 +9,6 @@ - spec.add_dependency 'win32-process' - - spec.add_development_dependency 'bundler', '~> 1.7' - spec.add_development_dependency 'rake', '~> 10.0' - spec.add_development_dependency 'cucumber', '~> 2.1' + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'cucumber' diff -Nru vagrant-sshfs-1.3.0/debian/rules vagrant-sshfs-1.3.1/debian/rules --- vagrant-sshfs-1.3.0/debian/rules 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/rules 2019-01-26 22:16:56.000000000 +0000 @@ -11,9 +11,3 @@ override_dh_auto_install: dh_auto_install dh_vagrant_plugin - -newtarball = new$(DEB_VERSION_UPSTREAM).tar.gz -get-orig-source: - wget --continue -O $(newtarball) \ - https://github.com/dustymabe/vagrant-sshfs/archive/v$(DEB_VERSION_UPSTREAM).tar.gz - mk-origtargz --rename $(newtarball) diff -Nru vagrant-sshfs-1.3.0/debian/watch vagrant-sshfs-1.3.1/debian/watch --- vagrant-sshfs-1.3.0/debian/watch 2017-02-14 11:59:55.000000000 +0000 +++ vagrant-sshfs-1.3.1/debian/watch 2019-01-26 22:20:29.000000000 +0000 @@ -1,2 +1,3 @@ -version=3 -http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/vagrant-sshfs .*/vagrant-sshfs-(.*).tar.gz +version=4 +opts=pgpsigurlmangle=s/$/.asc/ \ +https://gemwatch.debian.net/vagrant-sshfs .*/vagrant-sshfs-(.*).tar.gz diff -Nru vagrant-sshfs-1.3.0/features/sshfs_cwd_mount.feature vagrant-sshfs-1.3.1/features/sshfs_cwd_mount.feature --- vagrant-sshfs-1.3.0/features/sshfs_cwd_mount.feature 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/features/sshfs_cwd_mount.feature 2018-03-12 00:46:42.000000000 +0000 @@ -3,9 +3,9 @@ # human readable. All Gherkin files have a .feature extension # # See more here: https://en.wikipedia.org/wiki/Cucumber_(software) -# -# Additoinally in the setup/env.rb file we set up Aruba. Aruba is used -# to define most of the basic step definitions that we use as part of +# +# Additionally in the setup/env.rb file we set up Aruba. Aruba is used +# to define most of the basic step definitions that we use as part of # the Gherkin syntax in this file. # # For more information on the step definitions provided see: @@ -21,7 +21,7 @@ # Disable the default rsync config.vm.synced_folder '.', '/vagrant', disabled: true - # If using libvirt and nested virt (vagrant in vagrant) then + # If using libvirt and nested virt (vagrant in vagrant) then # we need to use a different network than 192.168.121.0 config.vm.provider :libvirt do |libvirt| libvirt.management_network_name = 'vagrant-libvirt-test' @@ -42,5 +42,5 @@ Examples: | box | | centos/7 | - - + + diff -Nru vagrant-sshfs-1.3.0/features/step_definitions/sshfs_cwd_mount_steps.rb vagrant-sshfs-1.3.1/features/step_definitions/sshfs_cwd_mount_steps.rb --- vagrant-sshfs-1.3.0/features/step_definitions/sshfs_cwd_mount_steps.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/features/step_definitions/sshfs_cwd_mount_steps.rb 2018-03-12 00:46:42.000000000 +0000 @@ -1,6 +1,6 @@ -# This is a cucumber step definition. Cucumber scenarios become automated -# tests with the addition of what are called step definitions. A step -# definition is a block of code associated with one or more steps by a +# This is a cucumber step definition. Cucumber scenarios become automated +# tests with the addition of what are called step definitions. A step +# definition is a block of code associated with one or more steps by a # regular expression (or, in simple cases, a string). # # This is the step definition for the `And vagrant current working diff -Nru vagrant-sshfs-1.3.0/Gemfile vagrant-sshfs-1.3.1/Gemfile --- vagrant-sshfs-1.3.0/Gemfile 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/Gemfile 2018-03-12 00:46:42.000000000 +0000 @@ -6,12 +6,12 @@ # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the # Vagrant environment itself using `vagrant plugin`. - gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :ref => 'v1.8.6' + gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git", :ref => 'v2.0.2' end group :plugins do gem "vagrant-sshfs" , path: "." # Add vagrant-libvirt plugin here, otherwise you won't be able to # use libvirt as a provider when you execute `bundle exec vagrant up` - gem "vagrant-libvirt" , '0.0.33' + gem "vagrant-libvirt" , '0.0.43' end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/action_hostpath_fixup.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/action_hostpath_fixup.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/action_hostpath_fixup.rb 1970-01-01 00:00:00.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/action_hostpath_fixup.rb 2018-03-12 00:46:42.000000000 +0000 @@ -0,0 +1,130 @@ +require "log4r" + +require "vagrant/action/builtin/mixin_synced_folders" + +module VagrantPlugins + module SyncedFolderSSHFS + + # Class that contains common function that are called by both + # HostPathFix and HostPathUnfix classes. + class HostPathFixCommon + + include Vagrant::Action::Builtin::MixinSyncedFolders + + def initialize() + @logger = Log4r::Logger.new("vagrant::synced_folders::sshfs") + end + + def fix(data) + # If this is an arbitrary host mount we need to set the hostpath + # to something that will pass the config checks that assume the + # hostpath is coming from the vagrant host and not from an arbitrary + # host. Save off the original hostpath and then set the hostpath to + # "." to pass the checks. + if data[:ssh_host] + data[:hostpath_orig] = data[:hostpath] + data[:hostpath] = "." + end + end + + def unfix(data) + # If this is a reverse mounted folder or an arbitrary host mount + # then we'll set "hostpath_exact" so they don't try to create a + # folder on the host in Vagrant::Action::Builtin::SyncedFolders. + if data[:ssh_host] + data[:hostpath_exact] = true + data[:hostpath] = data[:hostpath_orig] + data.delete(:hostpath_orig) + end + end + + # Loop through synced folder entries and either fix or unfix + # based on the fix arg + def loop_and_fix_unfix(env, fix) + + opts = { + cached: !!env[:synced_folders_cached], + config: env[:synced_folders_config], + } + + @logger.debug("SyncedFolders loading from cache: #{opts[:cached]}") + folders = synced_folders(env[:machine], **opts) + + folders.each do |impl_name, fs| + next if impl_name != :sshfs + @logger.debug("Synced Folder Implementation: #{impl_name}") + + fs.each do |id, data| + + # replace data with a copy since we may delete/add new data to the config + data = data.dup + + if fix + @logger.debug("fixup host path before: - #{id}: #{data[:hostpath]} => #{data[:guestpath]}") + fix(data) + @logger.debug("fixup host path after: - #{id}: #{data[:hostpath]} => #{data[:guestpath]}") + else + @logger.debug("unfixup host path before: - #{id}: #{data[:hostpath]} => #{data[:guestpath]}") + unfix(data) + @logger.debug("fixup host path after: - #{id}: #{data[:hostpath]} => #{data[:guestpath]}") + end + + # Replace the entry in the config with the updated one + env[:machine].config.vm.synced_folders.delete(id) + env[:machine].config.vm.synced_folder( + data[:hostpath], + data[:guestpath], + data) + end + end + end + end + + # Class that will massage the data for synced folders that are + # arbitrary host mounts (contain ssh_host in the options) to make + # it so that "host path checking" isn't performed on the vagrant + # host machine + class HostPathFix + + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::synced_folders::sshfs") + end + + def call(env) + classname = "VagrantPlugins::SyncedFolderSSHFS::HostPathFix" + @logger.debug("Executing hook within #{classname}") + + # This part is for the IN action call + HostPathFixCommon.new().loop_and_fix_unfix(env, fix=true) + + # Now continue until the OUT call + @app.call(env) + + end + end + + + # Class that will undo the data manipulation that was done in + # HostPathFix and also set hostpath_exact=true if necessary + class HostPathUnfix + + def initialize(app, env) + @app = app + @logger = Log4r::Logger.new("vagrant::synced_folders::sshfs") + end + + def call(env) + classname = "VagrantPlugins::SyncedFolderSSHFS::HostPathUnfix" + @logger.debug("Executing hook within #{classname}") + + # This part is for the IN action call + HostPathFixCommon.new().loop_and_fix_unfix(env, fix=false) + + # Now continue until the OUT call + @app.call(env) + + end + end + end +end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/debian/sshfs_client.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/debian/sshfs_client.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/debian/sshfs_client.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/debian/sshfs_client.rb 2018-03-12 00:46:42.000000000 +0000 @@ -3,6 +3,7 @@ module Cap class SSHFSClient def self.sshfs_install(machine) + machine.communicate.sudo("apt-get update") machine.communicate.sudo("apt-get install -y sshfs") end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb 1970-01-01 00:00:00.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb 2018-03-12 00:46:42.000000000 +0000 @@ -0,0 +1,22 @@ +module VagrantPlugins + module GuestFreeBSD + module Cap + class SSHFSClient + def self.sshfs_install(machine) + machine.communicate.sudo("pkg install -y fusefs-sshfs") + machine.communicate.sudo("kldload fuse") + end + + def self.sshfs_installed(machine) + installed = machine.communicate.test("pkg info fusefs-sshfs") + if installed + # fuse may not get loaded at boot, so check if it's loaded otherwise force load it + machine.communicate.sudo("kldstat -m fuse || kldload fuse") + end + + installed + end + end + end + end +end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_forward_mount.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_forward_mount.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_forward_mount.rb 1970-01-01 00:00:00.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_forward_mount.rb 2018-03-12 00:46:42.000000000 +0000 @@ -0,0 +1,13 @@ +require_relative "../linux/sshfs_forward_mount" + +module VagrantPlugins + module GuestFreeBSD + module Cap + class MountSSHFS < VagrantPlugins::GuestLinux::Cap::MountSSHFS + def self.list_mounts_command + "mount -p" + end + end + end + end +end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb 2018-03-12 00:46:42.000000000 +0000 @@ -1,5 +1,6 @@ require "log4r" require "vagrant/util/retryable" +require "vagrant/util/platform" require "tempfile" # This is already done for us in lib/vagrant-sshfs.rb. We needed to @@ -16,13 +17,17 @@ extend Vagrant::Util::Retryable @@logger = Log4r::Logger.new("vagrant::synced_folders::sshfs_mount") + def self.list_mounts_command + "cat /proc/mounts" + end + def self.sshfs_forward_is_folder_mounted(machine, opts) mounted = false guest_path = opts[:guestpath] # If the path doesn't exist at all in the machine then we # can safely say it is not mounted - exists = machine.communicate.test("test -e #{guest_path}") + exists = machine.communicate.test("test -e #{guest_path}", sudo: true) return false unless exists # find the absolute path so that we can properly check if it is mounted @@ -31,7 +36,7 @@ :sshfs_get_absolute_path, guest_path) # consult /proc/mounts to see if it is mounted or not - machine.communicate.execute("cat /proc/mounts") do |type, data| + machine.communicate.execute(self.list_mounts_command) do |type, data| if type == :stdout data.each_line do |line| if line.split()[1] == absolute_guest_path @@ -48,7 +53,7 @@ # opts contains something like: # { :type=>:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -66,16 +71,23 @@ comm.sudo("chmod 777 #{expanded_guest_path}") end - # Mount path information - hostpath = opts[:hostpath].dup - hostpath.gsub!("'", "'\\\\''") + # Mount path information: if arbitrary host mounting then + # take as is. If not, then expand the hostpath to the real + # path. + if opts[:ssh_host] + hostpath = opts[:hostpath].dup + else + hostpath = File.expand_path(opts[:hostpath], machine.env.root_path) + hostpath = Vagrant::Util::Platform.fs_real_path(hostpath).to_s + end + # Add in some sshfs/fuse options that are common to both mount methods opts[:sshfs_opts] = ' -o allow_other ' # allow non-root users to access opts[:sshfs_opts]+= ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # Do a normal mount only if the user provided host information @@ -116,25 +128,25 @@ protected def self.windows_uninherit_handles(machine) - # For win32-process Process.create, if we pass any file handles to the - # underlying process for stdin/stdout/stderr then all file handles are + # For win32-process Process.create, if we pass any file handles to the + # underlying process for stdin/stdout/stderr then all file handles are # inherited by default. We'll explicitly go through and set all Handles # to not be inheritable by default. See following links for more info - # + # # https://github.com/djberg96/win32-process/blob/6b380f450aebb69d44bb7accd958ecb6b9e1d246/lib/win32/process.rb#L445-L447 # bInheritHandles from https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx - # + # # In 6f285cd we made it so that we would uninherit all filehandles by # default on windows. Some users have reported that this operation # is erroring because `The parameter is incorrect.`. See #52 - # We will make the uninheriting operation best effort. The rationale - # is that if a file handle was not able to be set to uninheritable + # We will make the uninheriting operation best effort. The rationale + # is that if a file handle was not able to be set to uninheritable # then it probably wasn't one that would get inherited in the first place. # - # For each open IO object + # For each open IO object ObjectSpace.each_object(IO) do |io| if !io.closed? - fileno = io.fileno + fileno = io.fileno @@logger.debug("Setting file handle #{fileno} to not be inherited") begin self.windows_uninherit_handle(fileno) @@ -151,7 +163,7 @@ def self.windows_uninherit_handle(fileno) # Right now we'll be doing this using private methods from the win32-process - # module by calling For each open IO object. Much of this code was copied from + # module by calling For each open IO object. Much of this code was copied from # that module. We access the private methods by using the object.send(:method, args) # technique. In the future we want to get a patch upstream so we don't need to # access private methods. Upstream request is here: @@ -170,15 +182,15 @@ end # Now clear the HANDLE_FLAG_INHERIT from the HANDLE so that the handle - # won't get shared by default. See: + # won't get shared by default. See: # https://msdn.microsoft.com/en-us/library/windows/desktop/ms724935(v=vs.85).aspx - # + # bool = Process.send(:SetHandleInformation, handle, Process::Constants::HANDLE_FLAG_INHERIT, 0) raise SystemCallError.new("SetHandleInformation", FFI.errno) unless bool end - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_slave_mount(machine, opts, hostpath, expanded_guest_path) @@ -198,24 +210,35 @@ # The remote sshfs command that will run (in slave mode) sshfs_opts+= ' -o slave ' - sshfs_cmd = "sudo -E sshfs :#{hostpath} #{expanded_guest_path}" + sshfs_cmd = "sudo -E sshfs :#{hostpath} #{expanded_guest_path}" sshfs_cmd+= sshfs_opts + ' ' + sshfs_opts_append + ' ' # The ssh command to connect to guest and then launch sshfs - # Note the backslash escapes for IdentityFile - handles spaces in key path ssh_opts = opts[:ssh_opts] ssh_opts+= ' -o User=' + machine.ssh_info[:username] ssh_opts+= ' -o Port=' + machine.ssh_info[:port].to_s - ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' ssh_opts+= ' -o UserKnownHostsFile=/dev/null ' ssh_opts+= ' -F /dev/null ' # Don't pick up options from user's config + if machine.ssh_info.key?(:private_key_path) and + machine.ssh_info[:private_key_path] and + machine.ssh_info[:private_key_path][0] + # Add IdentityFile since there is one + # Note the backslash escapes for IdentityFile - handles spaces in key path + ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' + end + + # Use an SSH ProxyCommand when corresponding Vagrant setting is defined + if machine.ssh_info[:proxy_command] + ssh_opts+= " -o ProxyCommand=\"" + machine.ssh_info[:proxy_command] + "\"" + end + ssh_cmd = ssh_path + ssh_opts + ' ' + ssh_opts_append + ' ' + machine.ssh_info[:host] ssh_cmd+= ' "' + sshfs_cmd + '"' # Log some information @@logger.debug("sftp-server cmd: #{sftp_server_cmd}") @@logger.debug("ssh cmd: #{ssh_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.slave_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.slave_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Create two named pipes for communication between sftp-server and @@ -234,8 +257,8 @@ # The way this works is by hooking up the stdin+stdout of the # sftp-server process to the stdin+stdout of the sshfs process # running inside the guest in slave mode. An illustration is below: - # - # stdout => w1 pipe1 r1 => stdin + # + # stdout => w1 pipe1 r1 => stdin # />------------->==============>----------->\ # / \ # | | @@ -243,7 +266,7 @@ # | | # \ / # \<-------------<==============<-----------:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -46,7 +46,7 @@ protected - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_mount(machine, opts) @@ -64,7 +64,7 @@ opts[:sshfs_opts] = ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # SSH connection options @@ -74,6 +74,13 @@ ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' ssh_opts+= ' -o UserKnownHostsFile=/dev/null ' ssh_opts+= ' -F /dev/null ' # Don't pick up options from user's config + if machine.ssh_info.key?(:private_key_path) and + machine.ssh_info[:private_key_path] and + machine.ssh_info[:private_key_path][0] + # Add IdentityFile since there is one + # Note the backslash escapes for IdentityFile - handles spaces in key path + ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' + end ssh_opts_append = opts[:ssh_opts_append].to_s # provided by user @@ -88,12 +95,12 @@ # The sshfs command to mount the guest directory on the host sshfs_cmd = "#{sshfs_path} #{ssh_opts} #{ssh_opts_append} " sshfs_cmd+= "#{sshfs_opts} #{sshfs_opts_append} " - sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" + sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" # Log some information @@logger.debug("sshfs cmd: #{sshfs_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Log STDERR to predictable files so that we can inspect them @@ -104,7 +111,7 @@ # Launch sshfs command to mount guest dir into the host if Vagrant::Util::Platform.windows? - # Need to handle Windows differently. Kernel.spawn fails to work, + # Need to handle Windows differently. Kernel.spawn fails to work, # if the shell creating the process is closed. # See https://github.com/dustymabe/vagrant-sshfs/issues/31 Process.create(:command_line => ssh_cmd, diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb 2018-03-12 00:46:42.000000000 +0000 @@ -29,7 +29,7 @@ # opts contains something like: # { :type=>:sshfs, # :guestpath=>"/sharedfolder", - # :hostpath=>"/guests/sharedfolder", + # :hostpath=>"/guests/sharedfolder", # :disabled=>false # :ssh_host=>"192.168.1.1" # :ssh_port=>"22" @@ -45,7 +45,7 @@ protected - # Perform a mount by running an sftp-server on the vagrant host + # Perform a mount by running an sftp-server on the vagrant host # and piping stdin/stdout to sshfs running inside the guest def self.sshfs_mount(machine, opts) @@ -63,16 +63,21 @@ opts[:sshfs_opts] = ' -o noauto_cache '# disable caching based on mtime # Add in some ssh options that are common to both mount methods - opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question + opts[:ssh_opts] = ' -o StrictHostKeyChecking=no '# prevent yes/no question opts[:ssh_opts]+= ' -o ServerAliveInterval=30 ' # send keepalives # SSH connection options - # Note the backslash escapes for IdentityFile - handles spaces in key path ssh_opts = opts[:ssh_opts] ssh_opts+= ' -o Port=' + machine.ssh_info[:port].to_s - ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' ssh_opts+= ' -o UserKnownHostsFile=/dev/null ' ssh_opts+= ' -F /dev/null ' # Don't pick up options from user's config + if machine.ssh_info.key?(:private_key_path) and + machine.ssh_info[:private_key_path] and + machine.ssh_info[:private_key_path][0] + # Add IdentityFile since there is one + # Note the backslash escapes for IdentityFile - handles spaces in key path + ssh_opts+= ' -o "IdentityFile=\"' + machine.ssh_info[:private_key_path][0] + '\""' + end ssh_opts_append = opts[:ssh_opts_append].to_s # provided by user @@ -87,12 +92,12 @@ # The sshfs command to mount the guest directory on the host sshfs_cmd = "#{sshfs_path} #{ssh_opts} #{ssh_opts_append} " sshfs_cmd+= "#{sshfs_opts} #{sshfs_opts_append} " - sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" + sshfs_cmd+= "#{username}@#{host}:#{expanded_guest_path} #{hostpath}" # Log some information @@logger.debug("sshfs cmd: #{sshfs_cmd}") - machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", + machine.ui.info(I18n.t("vagrant.sshfs.actions.reverse_mounting_folder", hostpath: hostpath, guestpath: expanded_guest_path)) # Log STDERR to predictable files so that we can inspect them @@ -103,7 +108,7 @@ # Launch sshfs command to mount guest dir into the host if Vagrant::Util::Platform.windows? - # Need to handle Windows differently. Kernel.spawn fails to work, + # Need to handle Windows differently. Kernel.spawn fails to work, # if the shell creating the process is closed. # See https://github.com/dustymabe/vagrant-sshfs/issues/31 Process.create(:command_line => ssh_cmd, diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/plugin.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/plugin.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/plugin.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/plugin.rb 2018-03-12 00:46:42.000000000 +0000 @@ -20,6 +20,23 @@ Command::SSHFS end + # The following two hooks allow us to workaround + # the config validations that assume the hostpaths + # are coming from our host machine. This is not the + # case for arbitrary host mounts. + action_hook("sshfs_hostpath_fixup") do |hook| + require_relative "action_hostpath_fixup" + hook.before( + Vagrant::Action::Builtin::ConfigValidate, + HostPathFix) + end + action_hook("sshfs_hostpath_unfix") do |hook| + require_relative "action_hostpath_fixup" + hook.after( + Vagrant::Action::Builtin::ConfigValidate, + HostPathUnfix) + end + host_capability("linux", "sshfs_reverse_mount_folder") do require_relative "cap/host/linux/sshfs_reverse_mount" VagrantPlugins::HostLinux::Cap::MountSSHFS @@ -120,6 +137,35 @@ VagrantPlugins::GuestSUSE::Cap::SSHFSClient end + guest_capability("freebsd", "sshfs_forward_mount_folder") do + require_relative "cap/guest/freebsd/sshfs_forward_mount" + VagrantPlugins::GuestFreeBSD::Cap::MountSSHFS + end + + guest_capability("freebsd", "sshfs_forward_unmount_folder") do + require_relative "cap/guest/freebsd/sshfs_forward_mount" + VagrantPlugins::GuestFreeBSD::Cap::MountSSHFS + end + + guest_capability("freebsd", "sshfs_forward_is_folder_mounted") do + require_relative "cap/guest/freebsd/sshfs_forward_mount" + VagrantPlugins::GuestFreeBSD::Cap::MountSSHFS + end + + guest_capability("freebsd", "sshfs_get_absolute_path") do + require_relative "cap/guest/linux/sshfs_get_absolute_path" + VagrantPlugins::GuestLinux::Cap::SSHFSGetAbsolutePath + end + + guest_capability("freebsd", "sshfs_install") do + require_relative "cap/guest/freebsd/sshfs_client" + VagrantPlugins::GuestFreeBSD::Cap::SSHFSClient + end + + guest_capability("freebsd", "sshfs_installed") do + require_relative "cap/guest/freebsd/sshfs_client" + VagrantPlugins::GuestFreeBSD::Cap::SSHFSClient + end end end end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/synced_folder/sshfs_forward_mount.rb 2018-03-12 00:46:42.000000000 +0000 @@ -101,7 +101,7 @@ if not opts.has_key?(:ssh_password) or not opts[:ssh_password] if not ssh_info.has_key?(:forward_agent) or not ssh_info[:forward_agent] prompt_for_password = true - end + end end # Now do the prompt diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/synced_folder.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/synced_folder.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/synced_folder.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/synced_folder.rb 2018-03-12 00:46:42.000000000 +0000 @@ -113,6 +113,7 @@ ENV['PATH'] += ':/usr/libexec/openssh' # Linux (Red Hat Family) ENV['PATH'] += ':/usr/lib/openssh' # Linux (Debian Family) ENV['PATH'] += ':/usr/lib/ssh' # Linux (Arch Linux Family) + ENV['PATH'] += ':/usr/lib/misc' # Linux (Gentoo Family) ENV['PATH'] += ':/usr/libexec/' # Mac OS X end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs/version.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs/version.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs/version.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs/version.rb 2018-03-12 00:46:42.000000000 +0000 @@ -1,5 +1,5 @@ module VagrantPlugins module SyncedFolderSSHFS - VERSION = "1.3.0" + VERSION = "1.3.1" end end diff -Nru vagrant-sshfs-1.3.0/lib/vagrant-sshfs.rb vagrant-sshfs-1.3.1/lib/vagrant-sshfs.rb --- vagrant-sshfs-1.3.0/lib/vagrant-sshfs.rb 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/lib/vagrant-sshfs.rb 2018-03-12 00:46:42.000000000 +0000 @@ -4,8 +4,8 @@ raise "The Vagrant sshfs plugin must be run within Vagrant" end -# Only load the gem on Windows since it replaces some methods in Ruby's -# Process class. Also load it here before Process.uid is called the first +# Only load the gem on Windows since it replaces some methods in Ruby's +# Process class. Also load it here before Process.uid is called the first # time by Vagrant. The Process.create() function actually gets used in # lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb if Vagrant::Util::Platform.windows? diff -Nru vagrant-sshfs-1.3.0/RELEASE.txt vagrant-sshfs-1.3.1/RELEASE.txt --- vagrant-sshfs-1.3.0/RELEASE.txt 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/RELEASE.txt 2018-03-12 00:46:42.000000000 +0000 @@ -44,6 +44,13 @@ $ ls pkg/vagrant-sshfs-1.2.0.gem* pkg/vagrant-sshfs-1.2.0.gem pkg/vagrant-sshfs-1.2.0.gem.asc +# make tar.gz and zip files +git archive --format=tar.gz v1.3.0 > vagrant-sshfs-1.3.0.tar.gz +gpg --armor --detach-sign vagrant-sshfs-1.3.0.tar.gz +git archive --format=zip v1.3.0 > vagrant-sshfs-1.3.0.zip +gpg --armor --detach-sign vagrant-sshfs-1.3.0.zip + + # Update release notes and upload files on github # push to rubygems with: diff -Nru vagrant-sshfs-1.3.0/test/libvirt/Vagrantfile vagrant-sshfs-1.3.1/test/libvirt/Vagrantfile --- vagrant-sshfs-1.3.0/test/libvirt/Vagrantfile 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/test/libvirt/Vagrantfile 2018-03-12 00:46:42.000000000 +0000 @@ -12,7 +12,7 @@ end host = 'viv-libvirt' # vagrant in vagrant - to test libvirt - box = 'fedora/24-cloud-base' + box = 'fedora/25-cloud-base' config.vm.define host do | tmp | tmp.vm.hostname = host diff -Nru vagrant-sshfs-1.3.0/test/misc/Vagrantfile vagrant-sshfs-1.3.1/test/misc/Vagrantfile --- vagrant-sshfs-1.3.0/test/misc/Vagrantfile 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/test/misc/Vagrantfile 2018-03-12 00:46:42.000000000 +0000 @@ -10,7 +10,7 @@ # https://github.com/dustymabe/vagrant-sshfs/issues/44 config.vm.synced_folder "/etc/", "/sbin/forward_slave_mount_sym_link_test/", type: "sshfs" - # Test a forward normal mount: + # Test a forward normal mount: # mounting a folder from a 3rd party host into guest config.vm.synced_folder "/etc/", "/tmp/forward_normal_mount_etc/", type: "sshfs", ssh_host: ENV['THIRD_PARTY_HOST'], @@ -22,7 +22,7 @@ config.vm.synced_folder "/tmp/reverse_mount_etc/", "/etc", type: "sshfs", reverse: true host = 'vagrant-sshfs-tests' - box = 'fedora/24-cloud-base' + box = 'fedora/25-cloud-base' config.vm.define host do | tmp | tmp.vm.hostname = host diff -Nru vagrant-sshfs-1.3.0/test/virtualbox/Vagrantfile vagrant-sshfs-1.3.1/test/virtualbox/Vagrantfile --- vagrant-sshfs-1.3.0/test/virtualbox/Vagrantfile 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/test/virtualbox/Vagrantfile 2018-03-12 00:46:42.000000000 +0000 @@ -16,7 +16,7 @@ end host = 'viv-virtbox' # vagrant in vagrant - to test virtbox - box = 'fedora/24-cloud-base' + box = 'fedora/25-cloud-base' config.vm.define host do | tmp | tmp.vm.hostname = host diff -Nru vagrant-sshfs-1.3.0/vagrant-sshfs.gemspec vagrant-sshfs-1.3.1/vagrant-sshfs.gemspec --- vagrant-sshfs-1.3.0/vagrant-sshfs.gemspec 2017-01-06 21:34:35.000000000 +0000 +++ vagrant-sshfs-1.3.1/vagrant-sshfs.gemspec 2018-03-12 00:46:42.000000000 +0000 @@ -23,9 +23,9 @@ spec.add_dependency 'win32-process' - spec.add_development_dependency 'bundler', '~> 1.7' - spec.add_development_dependency 'rake', '~> 10.0' - spec.add_development_dependency 'cucumber', '~> 2.1' - spec.add_development_dependency 'aruba', '~> 0.13' - spec.add_development_dependency 'komenda', '~> 0.1.6' + spec.add_development_dependency 'bundler' + spec.add_development_dependency 'rake' + spec.add_development_dependency 'cucumber' + spec.add_development_dependency 'aruba' + spec.add_development_dependency 'komenda' end