Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package vagrant-sshfs for openSUSE:Factory 
checked in at 2022-06-23 10:24:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vagrant-sshfs (Old)
 and      /work/SRC/openSUSE:Factory/.vagrant-sshfs.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "vagrant-sshfs"

Thu Jun 23 10:24:07 2022 rev:19 rq:984396 version:1.3.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/vagrant-sshfs/vagrant-sshfs.changes      
2022-06-13 13:03:24.181190108 +0200
+++ /work/SRC/openSUSE:Factory/.vagrant-sshfs.new.1548/vagrant-sshfs.changes    
2022-06-23 10:24:49.819776496 +0200
@@ -1,0 +2,24 @@
+Tue Jun 21 08:43:04 UTC 2022 - Dan ??erm??k <[email protected]>
+
+- New upstream release 1.3.7
+
+Dusty Mabe <[email protected]> (12):
+      00f5737 guest: Enterprise Linux 9 has landed
+      e90bbdb guest: add Alma Linux support
+      e76db4d guest: handle Alma/Rocky until fixes land upstream
+      b77809e add support for owner, group, and mount_options
+      b37e1e5 tests: switch config.ssh.insert_key to boolean in Vagrantfile
+      dba8c30 Update to Fedora 36 for build container and test VM
+      cc887ad guest: upload fuse module loading for FreeBSD
+      08c1c83 sshfs_reverse_mount: fixup botched copy/paste
+      bf72f0f sshfs_reverse_mount: create guest directory if not exists
+      51be8cb sshfs_reverse_mount: use ruby Etc lib for owner/group
+      3f13f07 Gemfile: bump to latest versions of vagrant and vagrant-libvirt
+      f60ff0e version: bump to 1.3.7
+
+Even Onsager <[email protected]> (3):
+      ecb8c03 Add guest capabilities file for Rocky (based on CentOS)
+      95e8ffc Add Rocky guest_capability to plugin.rb
+      ade5564 Remove superfluous case/when (only rocky_8 exists)
+
+-------------------------------------------------------------------

Old:
----
  vagrant-sshfs-1.3.6.tar.gz
  vagrant-sshfs-1.3.6.tar.gz.asc

New:
----
  vagrant-sshfs-1.3.7.tar.gz
  vagrant-sshfs-1.3.7.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ vagrant-sshfs.spec ++++++
--- /var/tmp/diff_new_pack.oIJgHh/_old  2022-06-23 10:24:50.287777004 +0200
+++ /var/tmp/diff_new_pack.oIJgHh/_new  2022-06-23 10:24:50.295777013 +0200
@@ -23,7 +23,7 @@
 %define mod_name %{vagrant_plugin_name}
 %define mod_full_name %{vagrant_plugin_name}-%{version}
 Name:           %{vagrant_plugin_name}
-Version:        1.3.6
+Version:        1.3.7
 Release:        0
 Summary:        SSHFS synced folder implementation for Vagrant
 License:        GPL-2.0-only

++++++ 0001-Use-opensuse-Tumbleweed.-uname-m-box-instead-of-Fedo.patch ++++++
--- /var/tmp/diff_new_pack.oIJgHh/_old  2022-06-23 10:24:50.319777039 +0200
+++ /var/tmp/diff_new_pack.oIJgHh/_new  2022-06-23 10:24:50.323777043 +0200
@@ -1,26 +1,26 @@
-From ce3bfd63c220437d4921eac3660e57de22698493 Mon Sep 17 00:00:00 2001
+From 4b81caf95e5dc8e5eeba3f10f5c61584ddfd3101 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <[email protected]>
 Date: Wed, 1 Apr 2020 22:34:10 +0200
-Subject: [PATCH] Use opensuse/Tumbleweed.$(uname -m) box instead of Fedora/34
+Subject: [PATCH] Use opensuse/Tumbleweed.$(uname -m) box instead of Fedora/36
 
 ---
  test/misc/Vagrantfile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/test/misc/Vagrantfile b/test/misc/Vagrantfile
-index ce390ea..9874f79 100644
+index 834ef40..92c4d16 100644
 --- a/test/misc/Vagrantfile
 +++ b/test/misc/Vagrantfile
-@@ -22,7 +22,7 @@ Vagrant.configure(2) do |config|
-     config.vm.synced_folder "/tmp/reverse_mount_etc/", "/etc", type: "sshfs", 
reverse: true
+@@ -41,7 +41,7 @@ Vagrant.configure(2) do |config|
+         mount_options: ['ro']
  
      host = 'sshfs-tests'
--    box  = 'fedora/34-cloud-base'
+-    box  = 'fedora/36-cloud-base'
 +    box  = "opensuse/Tumbleweed.#{(RUBY_PLATFORM.split '-')[0]}"
  
      config.vm.define host do | tmp |
          tmp.vm.hostname = host
 -- 
-2.27.0
+2.35.3
 
 

++++++ vagrant-sshfs-1.3.6.tar.gz -> vagrant-sshfs-1.3.7.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Gemfile new/Gemfile
--- old/Gemfile 2021-05-03 21:42:30.000000000 +0200
+++ new/Gemfile 2022-06-20 22:25:14.000000000 +0200
@@ -6,11 +6,11 @@
   # 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 => 
'v2.2.16'
+  gem "vagrant", :git => "https://github.com/mitchellh/vagrant.git";, :ref => 
'v2.2.19'
 end
 
 group :plugins do
   # 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.4.1'
+  gem "vagrant-libvirt" , '0.7.0'
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/build.sh new/build.sh
--- old/build.sh        2021-05-03 21:42:30.000000000 +0200
+++ new/build.sh        2022-06-20 22:25:14.000000000 +0200
@@ -1,7 +1,7 @@
 #!/bin/bash -x
 set -ex
 
-ctr=$(buildah from registry.fedoraproject.org/fedora:33)
+ctr=$(buildah from registry.fedoraproject.org/fedora:36)
 
 rpms=(
   make gcc ruby ruby-devel redhat-rpm-config # for building gems
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/cap/guest/alma/sshfs_client.rb 
new/lib/vagrant-sshfs/cap/guest/alma/sshfs_client.rb
--- old/lib/vagrant-sshfs/cap/guest/alma/sshfs_client.rb        1970-01-01 
01:00:00.000000000 +0100
+++ new/lib/vagrant-sshfs/cap/guest/alma/sshfs_client.rb        2022-06-20 
22:25:14.000000000 +0200
@@ -0,0 +1,39 @@
+module VagrantPlugins
+  module GuestAlma
+    module Cap
+      class SSHFSClient
+        def self.sshfs_install(machine)
+
+          case machine.guest.capability("flavor")
+            when :alma_8
+              # No need to install epel. fuse-sshfs comes from the powertools 
repo
+              # https://bugzilla.redhat.com/show_bug.cgi?id=1758884
+              # https://github.com/dustymabe/vagrant-sshfs/issues/123
+              machine.communicate.sudo("yum -y install --enablerepo=powertools 
fuse-sshfs")
+            when :alma_9, :alma # alma9 or unknown
+              # Install fuse-sshfs from epel
+              if !epel_installed(machine)
+                epel_install(machine)
+              end
+              machine.communicate.sudo("yum -y install fuse-sshfs")
+          end
+        end
+
+        def self.sshfs_installed(machine)
+          machine.communicate.test("rpm -q fuse-sshfs")
+        end
+
+        protected
+
+        def self.epel_installed(machine)
+          machine.communicate.test("rpm -q epel-release")
+        end
+
+        def self.epel_install(machine)
+          machine.communicate.sudo("yum -y install epel-release")
+        end
+
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb 
new/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb
--- old/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb      2021-05-03 
21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/guest/centos/sshfs_client.rb      2022-06-20 
22:25:14.000000000 +0200
@@ -4,13 +4,26 @@
       class SSHFSClient
         def self.sshfs_install(machine)
 
+          # Until a newer version of Vagrant ships with 
https://github.com/hashicorp/vagrant/pull/12785
+          # we need to handle the case where Alma or Rocky end up here
+          if machine.communicate.test("grep 'VERSION_ID=\"8' /etc/os-release")
+              machine.communicate.sudo("yum -y install --enablerepo=powertools 
fuse-sshfs")
+              return
+          elsif machine.communicate.test("grep 'VERSION_ID=\"9' 
/etc/os-release")
+              if !epel_installed(machine)
+                epel_install(machine)
+              end
+              machine.communicate.sudo("yum -y install fuse-sshfs")
+              return
+          end
+
           case machine.guest.capability("flavor")
             when :centos_8
               # No need to install epel. fuse-sshfs comes from the powertools 
repo
               # https://bugzilla.redhat.com/show_bug.cgi?id=1758884
               # https://github.com/dustymabe/vagrant-sshfs/issues/123
               machine.communicate.sudo("yum -y install --enablerepo=powertools 
fuse-sshfs")
-            when :centos_7, :centos # centos7 and centos6
+            when :centos_9, :centos_7, :centos # centos{9,7,6}
               # Install fuse-sshfs from epel
               if !epel_installed(machine)
                 epel_install(machine)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb 
new/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb
--- old/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb     2021-05-03 
21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/guest/freebsd/sshfs_client.rb     2022-06-20 
22:25:14.000000000 +0200
@@ -4,14 +4,22 @@
       class SSHFSClient
         def self.sshfs_install(machine)
           machine.communicate.sudo("pkg install -y fusefs-sshfs")
-          machine.communicate.sudo("kldload fuse")
+          # older FreeBSD used fuse, newer uses fusefs
+          # https://github.com/dustymabe/vagrant-sshfs/issues/124
+          machine.communicate.sudo("kldload fuse || kldload fusefs")
         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")
+              # fuse may not get loaded at boot, so check if it's loaded
+              # If not loaded then force load it
+              loaded = machine.communicate.test("kldstat -m fuse || kldstat -m 
fusefs")
+              if not loaded
+                # older FreeBSD used fuse, newer uses fusefs
+                # https://github.com/dustymabe/vagrant-sshfs/issues/124
+                machine.communicate.sudo("kldload fuse || kldload fusefs")
+              end
           end
 
           installed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb 
new/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb
--- old/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb        
2021-05-03 21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/guest/linux/sshfs_forward_mount.rb        
2022-06-20 22:25:14.000000000 +0200
@@ -2,6 +2,7 @@
 require "vagrant/util/retryable"
 require "vagrant/util/platform"
 require "tempfile"
+require Vagrant.source_root.join("plugins/synced_folders/unix_mount_helpers")
 
 # This is already done for us in lib/vagrant-sshfs.rb. We needed to
 # do it there before Process.uid is called the first time by Vagrant
@@ -15,6 +16,7 @@
     module Cap
       class MountSSHFS
         extend Vagrant::Util::Retryable
+        extend VagrantPlugins::SyncedFolder::UnixMountHelpers
         @@logger = Log4r::Logger.new("vagrant::synced_folders::sshfs_mount")
 
         def self.list_mounts_command
@@ -80,7 +82,25 @@
               hostpath = File.expand_path(opts[:hostpath], 
machine.env.root_path)
               hostpath  = Vagrant::Util::Platform.fs_real_path(hostpath).to_s
           end
-           
+
+          # Support for user provided mount_options, owner, group
+          # 
https://github.com/hashicorp/vagrant/blob/2c3397c46851ef29a3589bf3214a3eee12da8484/website/content/docs/synced-folders/basic_usage.mdx#options
+          mount_options = opts.fetch(:mount_options, [])
+          # Determine owner/group info to use
+          if (opts.has_key?(:owner) and opts[:owner]) or
+             (opts.has_key?(:group) and opts[:group])
+            detected_ids = detect_owner_group_ids(
+                machine, expanded_guest_path, mount_options, opts)
+            mount_uid = detected_ids[:uid]
+            mount_gid = detected_ids[:gid]
+            mount_options.append("uid=#{mount_uid}")
+            mount_options.append("gid=#{mount_gid}")
+          end
+          # Combine mount_options into sshfs_opts_append (also user provided)
+          if not mount_options.empty?()
+            opts[:sshfs_opts_append] =
+              opts[:sshfs_opts_append].to_s + ' -o ' + mount_options.join(',') 
+ ' '
+          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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb 
new/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb
--- old/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb      2021-05-03 
21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/guest/redhat/sshfs_client.rb      2022-06-20 
22:25:14.000000000 +0200
@@ -14,7 +14,7 @@
               # on the system, which may have unintended consequences on RHEL8.
               machine.communicate.sudo("rpm --import 
https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7";)
               machine.communicate.sudo("yum -y install fuse-sshfs 
--repofrompath=epel7,'http://download.fedoraproject.org/pub/epel/7/$basearch'")
-            when :rhel_7, :rhel # rhel7 and rhel6
+            when :rhel_9, :rhel_7, :rhel # rhel{9,7,6}
               # Install fuse-sshfs from epel
               if !epel_installed(machine)
                 epel_install(machine)
@@ -35,10 +35,18 @@
 
         def self.epel_install(machine)
           case machine.guest.capability("flavor")
+            when :rhel_9
+              machine.communicate.sudo("rpm -ivh 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm";)
             when :rhel_7
               machine.communicate.sudo("rpm -ivh 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm";)
             when :rhel # rhel6
-              machine.communicate.sudo("rpm -ivh 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm";)
+              # Until a newer version of Vagrant ships with 
https://github.com/hashicorp/vagrant/pull/12785
+              # we need to handle the case where Alma 9 and RHEL 9 end up here.
+              if machine.communicate.test("grep 'VERSION_ID=\"9' 
/etc/os-release")
+                machine.communicate.sudo("rpm -ivh 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm";)
+              else
+                machine.communicate.sudo("rpm -ivh 
https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm";)
+              end
           end
         end
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb 
new/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb
--- old/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb       1970-01-01 
01:00:00.000000000 +0100
+++ new/lib/vagrant-sshfs/cap/guest/rocky/sshfs_client.rb       2022-06-20 
22:25:14.000000000 +0200
@@ -0,0 +1,39 @@
+module VagrantPlugins
+  module GuestRocky
+    module Cap
+      class SSHFSClient
+        def self.sshfs_install(machine)
+
+          case machine.guest.capability("flavor")
+            when :rocky_8
+              # No need to install epel. fuse-sshfs comes from the powertools 
repo
+              # https://bugzilla.redhat.com/show_bug.cgi?id=1758884
+              # https://github.com/dustymabe/vagrant-sshfs/issues/123
+              machine.communicate.sudo("yum -y install --enablerepo=powertools 
fuse-sshfs")
+            when :rocky_9, :rocky # rocky9 or unknown
+              # Install fuse-sshfs from epel
+              if !epel_installed(machine)
+                epel_install(machine)
+              end
+              machine.communicate.sudo("yum -y install fuse-sshfs")
+          end
+        end
+
+        def self.sshfs_installed(machine)
+          machine.communicate.test("rpm -q fuse-sshfs")
+        end
+
+        protected
+
+        def self.epel_installed(machine)
+          machine.communicate.test("rpm -q epel-release")
+        end
+
+        def self.epel_install(machine)
+          machine.communicate.sudo("yum -y install epel-release")
+        end
+
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/vagrant-sshfs/cap/host/darwin/sshfs_reverse_mount.rb 
new/lib/vagrant-sshfs/cap/host/darwin/sshfs_reverse_mount.rb
--- old/lib/vagrant-sshfs/cap/host/darwin/sshfs_reverse_mount.rb        
2021-05-03 21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/host/darwin/sshfs_reverse_mount.rb        
2022-06-20 22:25:14.000000000 +0200
@@ -1,3 +1,4 @@
+require "etc"
 require "log4r"
 require "vagrant/util/retryable"
 require "tempfile"
@@ -56,6 +57,12 @@
           expanded_guest_path = machine.guest.capability(
             :shell_expand_guest_path, opts[:guestpath])
 
+          # Create the mountpoint inside the guest
+          machine.communicate.tap do |comm|
+            comm.sudo("mkdir -p #{expanded_guest_path}")
+            comm.sudo("chmod 777 #{expanded_guest_path}")
+          end
+
           # Mount path information
           hostpath = opts[:hostpath].dup
           hostpath.gsub!("'", "'\\\\''")
@@ -68,10 +75,8 @@
           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
@@ -84,9 +89,35 @@
 
           ssh_opts_append = opts[:ssh_opts_append].to_s # provided by user
 
+          # Support for user provided mount_options, owner, group
+          # 
https://github.com/hashicorp/vagrant/blob/2c3397c46851ef29a3589bf3214a3eee12da8484/website/content/docs/synced-folders/basic_usage.mdx#options
+          mount_options = opts.fetch(:mount_options, [])
+          if (opts.has_key?(:owner) and opts[:owner]) or
+             (opts.has_key?(:group) and opts[:group])
+            # Identify the uid
+            if opts.has_key?(:owner) and opts[:owner]
+              mount_uid = Etc::getpwnam(opts[:owner]).uid
+            else
+              mount_uid = Etc::getpwnam(Etc.getlogin).uid
+            end
+            # Identify the gid. If a group was provided use that otherwise use
+            # the group detected with the detected user id.
+            if opts.has_key?(:group) and opts[:group]
+              mount_gid = Etc::getgrnam(opts[:group]).gid
+            else
+              mount_gid = Etc::getpwnam(Etc.getlogin).gid
+            end
+            # Add them to the mount options
+            mount_options.append("uid=#{mount_uid}")
+            mount_options.append("gid=#{mount_gid}")
+          end
+
           # SSHFS executable options
           sshfs_opts = opts[:sshfs_opts]
           sshfs_opts_append = opts[:sshfs_opts_append].to_s # provided by user
+          if not mount_options.empty?()
+            sshfs_opts_append+= ' -o ' + mount_options.join(',') + ' '
+          end
 
           username = machine.ssh_info[:username]
           host = machine.ssh_info[:host]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb 
new/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb
--- old/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb 2021-05-03 
21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/cap/host/linux/sshfs_reverse_mount.rb 2022-06-20 
22:25:14.000000000 +0200
@@ -1,3 +1,4 @@
+require "etc"
 require "log4r"
 require "vagrant/util/retryable"
 require "tempfile"
@@ -55,6 +56,12 @@
           expanded_guest_path = machine.guest.capability(
             :shell_expand_guest_path, opts[:guestpath])
 
+          # Create the mountpoint inside the guest
+          machine.communicate.tap do |comm|
+            comm.sudo("mkdir -p #{expanded_guest_path}")
+            comm.sudo("chmod 777 #{expanded_guest_path}")
+          end
+
           # Mount path information
           hostpath = opts[:hostpath].dup
           hostpath.gsub!("'", "'\\\\''")
@@ -81,9 +88,35 @@
 
           ssh_opts_append = opts[:ssh_opts_append].to_s # provided by user
 
+          # Support for user provided mount_options, owner, group
+          # 
https://github.com/hashicorp/vagrant/blob/2c3397c46851ef29a3589bf3214a3eee12da8484/website/content/docs/synced-folders/basic_usage.mdx#options
+          mount_options = opts.fetch(:mount_options, [])
+          if (opts.has_key?(:owner) and opts[:owner]) or
+             (opts.has_key?(:group) and opts[:group])
+            # Identify the uid
+            if opts.has_key?(:owner) and opts[:owner]
+              mount_uid = Etc::getpwnam(opts[:owner]).uid
+            else
+              mount_uid = Etc::getpwnam(Etc.getlogin).uid
+            end
+            # Identify the gid. If a group was provided use that otherwise use
+            # the group detected with the detected user id.
+            if opts.has_key?(:group) and opts[:group]
+              mount_gid = Etc::getgrnam(opts[:group]).gid
+            else
+              mount_gid = Etc::getpwnam(Etc.getlogin).gid
+            end
+            # Add them to the mount options
+            mount_options.append("uid=#{mount_uid}")
+            mount_options.append("gid=#{mount_gid}")
+          end
+
           # SSHFS executable options
           sshfs_opts = opts[:sshfs_opts]
           sshfs_opts_append = opts[:sshfs_opts_append].to_s # provided by user
+          if not mount_options.empty?()
+            sshfs_opts_append+= ' -o ' + mount_options.join(',') + ' '
+          end
 
           username = machine.ssh_info[:username]
           host = machine.ssh_info[:host]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/plugin.rb 
new/lib/vagrant-sshfs/plugin.rb
--- old/lib/vagrant-sshfs/plugin.rb     2021-05-03 21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/plugin.rb     2022-06-20 22:25:14.000000000 +0200
@@ -107,6 +107,26 @@
         VagrantPlugins::GuestCentOS::Cap::SSHFSClient
       end
 
+      guest_capability("rocky", "sshfs_installed") do
+        require_relative "cap/guest/rocky/sshfs_client"
+        VagrantPlugins::GuestRocky::Cap::SSHFSClient
+      end
+
+      guest_capability("rocky", "sshfs_install") do
+        require_relative "cap/guest/rocky/sshfs_client"
+        VagrantPlugins::GuestRocky::Cap::SSHFSClient
+      end
+
+      guest_capability("alma", "sshfs_installed") do
+        require_relative "cap/guest/alma/sshfs_client"
+        VagrantPlugins::GuestAlma::Cap::SSHFSClient
+      end
+
+      guest_capability("alma", "sshfs_install") do
+        require_relative "cap/guest/alma/sshfs_client"
+        VagrantPlugins::GuestAlma::Cap::SSHFSClient
+      end
+
       guest_capability("fedora", "sshfs_installed") do
         require_relative "cap/guest/fedora/sshfs_client"
         VagrantPlugins::GuestFedora::Cap::SSHFSClient
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/vagrant-sshfs/version.rb 
new/lib/vagrant-sshfs/version.rb
--- old/lib/vagrant-sshfs/version.rb    2021-05-03 21:42:30.000000000 +0200
+++ new/lib/vagrant-sshfs/version.rb    2022-06-20 22:25:14.000000000 +0200
@@ -1,5 +1,5 @@
 module VagrantPlugins
   module SyncedFolderSSHFS
-    VERSION = "1.3.6"
+    VERSION = "1.3.7"
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/misc/README.txt new/test/misc/README.txt
--- old/test/misc/README.txt    2021-05-03 21:42:30.000000000 +0200
+++ new/test/misc/README.txt    2022-06-20 22:25:14.000000000 +0200
@@ -5,12 +5,12 @@
 # To test we will first create the directory on the machine where
 # we will mount the guest /etc/ into the host (the reverse mount).
 
-mkdir /tmp/reverse_mount_etc
+mkdir /tmp/reverse_mount_etc_uid_gid/
 
 # Next we will define where our 3rd party host is (the normal mount).
 # This can be another vagrant box or whatever machine you want.
-export THIRD_PARTY_HOST='192.168.121.73'                                       
                                                                                
                        
-export THIRD_PARTY_HOST_USER='vagrant'                                         
                                                                                
                        
+export THIRD_PARTY_HOST='192.168.121.73'
+export THIRD_PARTY_HOST_USER='vagrant'
 export THIRD_PARTY_HOST_PASS='vagrant'
 
 # Open an extra file descriptor to test it is not passed onto child processes
@@ -18,27 +18,33 @@
 tmpfile=$(mktemp)
 exec {extra_fd}<> "$tmpfile"
 
-# Next vagrant up - will do 4 mounts
+# Next vagrant up - will do 5 mounts
 #  - slave
+#  - slave with owner/group
 #  - slave with sym link
-#  - normal
-#  - reverse
+#  - normal (from 3rd party host)
+#  - reverse with owner/group
 vagrant up
 
 # Next run the script to test the mounts:
 $ bash dotests.sh 
 Testing slave forward mount!
-        d635332fe7aa4d4fb48e5cb9357bdedf
+        1358d4a18a2d4ba7be380b991e899952
+Testing slave forward mount with owner/group!
+        root:wheel
+        1358d4a18a2d4ba7be380b991e899952
 Testing slave forward mount with a symlink!
-        d635332fe7aa4d4fb48e5cb9357bdedf
+        1358d4a18a2d4ba7be380b991e899952
 Testing normal forward mount!
-        6ccc3034df924bd289dd16205bf3d629
-Testing reverse mount!
-        508619e7e68e446c84d1fcdf7e0dc577
-
-# We are printing out the machine-id under each mount. The first two
-should be the same, because they are from the same machine. The last
-two should be different.
+        ef56862ae88f43c0a81962ba6f68a668
+Testing reverse mount with owner/group!
+        root:wheel
+        ef4f3b50e2034b3593a9eb8b71350abe
+
+# We are printing out the machine-id under each mount. The first three
+should be the same, because they are from the same machine (the host).
+The last two should be different; one from 3rd party machine and one
+from the test VM itself (read from the host).
 
 # Close our file descriptor. No other process should be using it
 exec {extra_fd}>&-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/misc/Vagrantfile new/test/misc/Vagrantfile
--- old/test/misc/Vagrantfile   2021-05-03 21:42:30.000000000 +0200
+++ new/test/misc/Vagrantfile   2022-06-20 22:25:14.000000000 +0200
@@ -1,28 +1,47 @@
 Vagrant.configure(2) do |config|
 
-    config.ssh.insert_key = 'true'
+    config.ssh.insert_key = true
 
     # Test a forward slave mount:
     #   mounting /etc/ from the vagrant host into the guest
-    config.vm.synced_folder "/etc/", "/tmp/forward_slave_mount_etc/", type: 
"sshfs"
+    config.vm.synced_folder "/etc/", "/tmp/forward_slave_mount_etc/",
+        type: "sshfs",
+        mount_options: ['ro']
+
+    # Test a forward slave with owner/group info:
+    #   mounting /etc/ from the vagrant host into the guest
+    config.vm.synced_folder "/etc/", "/tmp/forward_slave_mount_etc_uid_gid/",
+        type: "sshfs",
+        mount_options: ['ro', 'default_permissions'],
+        owner: "root",
+        group: "wheel"
 
     # Test a forward mount to a location that is a symbolic link
     # https://github.com/dustymabe/vagrant-sshfs/issues/44
-    config.vm.synced_folder "/etc/", 
"/var/run/forward_slave_mount_sym_link_test/", type: "sshfs"
+    config.vm.synced_folder "/etc/", 
"/var/run/forward_slave_mount_sym_link_test/",
+        type: "sshfs",
+        mount_options: ['ro']
 
     # 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",
+    config.vm.synced_folder "/etc/", "/tmp/forward_normal_mount_etc/",
+        type: "sshfs",
         ssh_host: ENV['THIRD_PARTY_HOST'],
         ssh_username: ENV['THIRD_PARTY_HOST_USER'],
-        ssh_password: ENV['THIRD_PARTY_HOST_PASS']
+        ssh_password: ENV['THIRD_PARTY_HOST_PASS'],
+        mount_options: ['ro']
 
-    # Test a reverse mount:
+    # Test a reverse mount with owner/group
     # mounting /etc/ from vagrant guest into vagrant host
-    config.vm.synced_folder "/tmp/reverse_mount_etc/", "/etc", type: "sshfs", 
reverse: true
+    config.vm.synced_folder "/tmp/reverse_mount_etc_uid_gid/", "/etc",
+        type: "sshfs",
+        reverse: true,
+        owner: "root",
+        group: "wheel",
+        mount_options: ['ro']
 
     host = 'sshfs-tests'
-    box  = 'fedora/34-cloud-base'
+    box  = 'fedora/36-cloud-base'
 
     config.vm.define host do | tmp |
         tmp.vm.hostname = host
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/test/misc/dotests.sh new/test/misc/dotests.sh
--- old/test/misc/dotests.sh    2021-05-03 21:42:30.000000000 +0200
+++ new/test/misc/dotests.sh    2022-06-20 22:25:14.000000000 +0200
@@ -6,6 +6,11 @@
 echo -en "Testing slave forward mount!\n\t"
 vagrant ssh -- cat /tmp/forward_slave_mount_etc/machine-id
 
+echo -en "Testing slave forward mount with owner/group!\n\t"
+vagrant ssh -- stat --printf '%U:%G' /tmp/forward_slave_mount_etc_uid_gid
+echo -en "\n\t"
+vagrant ssh -- cat /tmp/forward_slave_mount_etc_uid_gid/machine-id
+
 # https://github.com/dustymabe/vagrant-sshfs/issues/44
 echo -en "Testing slave forward mount with a symlink!\n\t"
 vagrant ssh -- cat /run/forward_slave_mount_sym_link_test/machine-id
@@ -13,5 +18,7 @@
 echo -en "Testing normal forward mount!\n\t"
 vagrant ssh -- cat /tmp/forward_normal_mount_etc/machine-id
 
-echo -en "Testing reverse mount!\n\t"
-cat /tmp/reverse_mount_etc/machine-id
+echo -en "Testing reverse mount with owner/group!\n\t"
+stat --printf '%U:%G' /tmp/reverse_mount_etc_uid_gid/
+echo -en "\n\t"
+cat /tmp/reverse_mount_etc_uid_gid/machine-id

Reply via email to