commit abba50bc5a6fb4746cd84d41ba115f00443409cd
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sat Jan 19 19:55:17 2019 +0000
Patch 61 might be useful on el7
...AutoMount-Change-Linux-mount-code-to-use-.patch | 131 +++++++++++++++++++++
VirtualBox.spec | 7 +-
2 files changed, 137 insertions(+), 1 deletion(-)
---
diff --git a/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
b/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
new file mode 100644
index 0000000..63447ad
--- /dev/null
+++ b/0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
@@ -0,0 +1,131 @@
+From 369dd2ee3c82c4417fee04aeec933c74fd198e78 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede(a)redhat.com>
+Date: Tue, 23 Jan 2018 15:09:20 +0100
+Subject: [PATCH resend] VBoxServiceAutoMount: Change Linux mount code to use
+ an options string
+
+Signed-off-by: Hans de Goede <hdegoede(a)redhat.com>
+---
+ .../common/VBoxService/VBoxServiceAutoMount.cpp | 62 +++-------------------
+ 1 file changed, 8 insertions(+), 54 deletions(-)
+
+diff --git a/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
b/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
+--- ./src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp.orig 2018-11-25
02:36:31.829306539 +0000
++++ ./src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp 2018-11-25
02:41:41.632973288 +0000
+@@ -40,6 +40,7 @@
+ #include <iprt/ctype.h>
+ #include <iprt/dir.h>
+ #include <iprt/mem.h>
++#include <iprt/param.h>
+ #include <iprt/path.h>
+ #include <iprt/semaphore.h>
+ #include <iprt/sort.h>
+@@ -117,6 +118,9 @@ RT_C_DECLS_END
+ # define VBOXSERVICE_AUTOMOUNT_MIQF SHFL_MIQF_PATH
+ #endif
+
++#ifndef MAX_MNTOPT_STR
++#define MAX_MNTOPT_STR PAGE_SIZE
++#endif
+
+
/*********************************************************************************************************************************
+ * Structures and Typedefs
*
+@@ -398,13 +402,13 @@ static int vbsvcAutoMountSharedFolderOld
+ int rc = vbsvcAutoMountPrepareMountPointOld(pszMountPoint, pszShareName,
&Opts);
+ if (RT_SUCCESS(rc))
+ {
++ char szOptBuf[MAX_MNTOPT_STR] = { '\0', };
++ RTStrPrintf(szOptBuf, sizeof(szOptBuf),
"uid=%d,gid=%d,dmode=%0o,fmode=%0o,dmask=%0o,fmask=%0o",
++ Opts.uid, Opts.gid, Opts.dmode, Opts.fmode, Opts.dmask,
Opts.fmask);
+ # ifdef RT_OS_SOLARIS
+ int fFlags = 0;
+ if (Opts.ronly)
+ fFlags |= MS_RDONLY;
+- char szOptBuf[MAX_MNTOPT_STR] = { '\0', };
+- RTStrPrintf(szOptBuf, sizeof(szOptBuf),
"uid=%d,gid=%d,dmode=%0o,fmode=%0o,dmask=%0o,fmask=%0o",
+- Opts.uid, Opts.gid, Opts.dmode, Opts.fmode, Opts.dmask,
Opts.fmask);
+ int r = mount(pszShareName,
+ pszMountPoint,
+ fFlags | MS_OPTIONSTR,
+@@ -421,34 +425,11 @@ static int vbsvcAutoMountSharedFolderOld
+
+ # else /* RT_OS_LINUX */
+ unsigned long fFlags = MS_NODEV;
+-
+- /*const char *szOptions = { "rw" }; - ??? */
+- struct vbsf_mount_info_new mntinf;
+- RT_ZERO(mntinf);
+-
+- mntinf.nullchar = '\0';
+- mntinf.signature[0] = VBSF_MOUNT_SIGNATURE_BYTE_0;
+- mntinf.signature[1] = VBSF_MOUNT_SIGNATURE_BYTE_1;
+- mntinf.signature[2] = VBSF_MOUNT_SIGNATURE_BYTE_2;
+- mntinf.length = sizeof(mntinf);
+-
+- mntinf.uid = Opts.uid;
+- mntinf.gid = Opts.gid;
+- mntinf.ttl = Opts.ttl;
+- mntinf.dmode = Opts.dmode;
+- mntinf.fmode = Opts.fmode;
+- mntinf.dmask = Opts.dmask;
+- mntinf.fmask = Opts.fmask;
+- mntinf.tag[0] = '\0';
+-
+- strcpy(mntinf.name, pszShareName);
+- strcpy(mntinf.nls_name, "\0");
+-
+ int r = mount(pszShareName,
+ pszMountPoint,
+ "vboxsf",
+ fFlags,
+- &mntinf);
++ szOptBuf);
+ if (r == 0)
+ {
+ VGSvcVerbose(0, "vbsvcAutoMountWorker: Shared folder '%s' was
mounted to '%s'\n", pszShareName, pszMountPoint);
+@@ -481,34 +462,6 @@ static int vbsvcAutoMountSharedFolderOld
+ }
+ else /* r == -1, we got some error in errno. */
+ {
+- if (errno == EPROTO)
+- {
+- VGSvcVerbose(3, "vbsvcAutoMountWorker: Messed up share name,
re-trying ...\n");
+-
+- /** @todo r=bird: What on earth is going on here????? Why can't
you
+- * strcpy(mntinf.name, pszShareName) to fix it again? */
+-
+- /* Sometimes the mount utility messes up the share name. Try to
+- * un-mangle it again. */
+- char szCWD[RTPATH_MAX];
+- size_t cchCWD;
+- if (!getcwd(szCWD, sizeof(szCWD)))
+- {
+- VGSvcError("vbsvcAutoMountWorker: Failed to get the current
working directory\n");
+- szCWD[0] = '\0';
+- }
+- cchCWD = strlen(szCWD);
+- if (!strncmp(pszMountPoint, szCWD, cchCWD))
+- {
+- while (pszMountPoint[cchCWD] == '/')
+- ++cchCWD;
+- /* We checked before that we have enough space */
+- strcpy(mntinf.name, pszMountPoint + cchCWD);
+- }
+- r = mount(mntinf.name, pszMountPoint, "vboxsf", fFlags,
&mntinf);
+- }
+- if (r == -1) /* Was there some error from one of the tries above? */
+- {
+ switch (errno)
+ {
+ /* If we get EINVAL here, the system already has mounted the Shared
Folder to another
+@@ -527,7 +480,6 @@ static int vbsvcAutoMountSharedFolderOld
+ rc = RTErrConvertFromErrno(errno);
+ break;
+ }
+- }
+ }
+ # endif
+ }
+--
+2.14.3
+
diff --git a/VirtualBox.spec b/VirtualBox.spec
index 5873796..9bcdb87 100644
--- a/VirtualBox.spec
+++ b/VirtualBox.spec
@@ -34,7 +34,7 @@
Name: VirtualBox
Version: 6.0.2
-Release: 1%{?prerel:.%{prerel}}%{?dist}
+Release: 2%{?prerel:.%{prerel}}%{?dist}
Summary: A general-purpose full virtualizer for PC hardware
License: GPLv2 or (GPLv2 and CDDL)
@@ -73,6 +73,7 @@ Patch50: VirtualBox-5.1.0-add-Mageia-support.patch
Patch51: VirtualBox-5.1.0-revert-VBox.sh.patch
# from Fedora
Patch60: VirtualBox-5.2.10-xclient.patch
+Patch61: 0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch
Patch65: VirtualBox-remove-volatile-asm.patch
@@ -294,6 +295,7 @@ rm -r src/libs/zlib-1.2.8/
#patch50 -p1 -b .mageia-support
%patch51 -p1 -b .revert-VBox.sh
%patch60 -p1 -b .xclient
+%patch61 -p1 -b .automount
%patch65 -p1 -b .asm
%build
@@ -800,6 +802,9 @@ getent passwd vboxadd >/dev/null || \
%{_datadir}/%{name}-kmod-%{version}
%changelog
+* Sat Jan 19 2019 Sérgio Basto <sergio(a)serjux.com> - 6.0.2-2
+- Patch 61 might be useful on el7
+
* Thu Jan 17 2019 Vasiliy N. Glazov <vascom2(a)gmail.com> - 6.0.2-1
- Update to 6.0.2