forked from pool/virtualbox
be31349318
- Under some circumstances, shared folders are mounted as root. File "debug_mountsf.patch" is added to allow recovery on affected systems. Automounted volumes are not fixed by this patch; however, manual mounting with the uid/gid options are correct. OBS-URL: https://build.opensuse.org/request/show/863389 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=584
23 lines
1.0 KiB
Diff
23 lines
1.0 KiB
Diff
Index: VirtualBox-6.1.16/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
|
|
===================================================================
|
|
--- VirtualBox-6.1.16.orig/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
|
|
+++ VirtualBox-6.1.16/src/VBox/Additions/linux/sharedfolders/mount.vboxsf.c
|
|
@@ -456,6 +456,7 @@ main(int argc, char **argv)
|
|
unsigned long flags = MS_NODEV;
|
|
char *host_name;
|
|
char *mount_point;
|
|
+ char options[120];
|
|
struct vbsf_mount_info_new mntinf;
|
|
struct vbsf_mount_opts opts =
|
|
{
|
|
@@ -579,7 +580,8 @@ main(int argc, char **argv)
|
|
* options you also would have to adjust VBoxServiceAutoMount.cpp
|
|
* to keep this code here slick without having VbglR3.
|
|
*/
|
|
- err = mount(host_name, mount_point, "vboxsf", flags, &mntinf);
|
|
+ sprintf(options, "uid=%d,gid=%d\n", mntinf.uid, mntinf.gid);
|
|
+ err = mount(host_name, mount_point, "vboxsf", flags, options);
|
|
saved_errno = errno;
|
|
|
|
/* Some versions of the mount utility (unknown which, if any) will turn the
|