Index: trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp
===================================================================
--- trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp	(revision 104925)
+++ trunk/src/VBox/Additions/common/VBoxService/VBoxServiceAutoMount.cpp	(revision 104954)
@@ -389,11 +389,8 @@
     if (RT_SUCCESS(rc))
     {
-        uint32_t cbOpts = RTSystemGetPageSize();
-        char *pszOpts = (char *)alloca(cbOpts);
-        RT_BZERO(pszOpts, cbOpts);
-
 # ifdef RT_OS_SOLARIS
         int const fFlags = MS_OPTIONSTR;
-        RTStrPrintf(pszOpts, cbOpts, "uid=0,gid=%d,dmode=0770,fmode=0770,dmask=0000,fmask=0000", grp_vboxsf->gr_gid);
+        char szOptBuf[MAX_MNTOPT_STR] = { '\0', };
+        RTStrPrintf(szOptBuf, sizeof(szOptBuf), "uid=0,gid=%d,dmode=0770,fmode=0770,dmask=0000,fmask=0000", grp_vboxsf->gr_gid);
         int r = mount(pszShareName,
                       pszMountPoint,
@@ -402,6 +399,6 @@
                       NULL,                     /* char *dataptr */
                       0,                        /* int datalen */
-                      pszOpts,
-                      cbOpts);
+                      szOptBuf,
+                      sizeof(szOptBuf));
         if (r == 0)
             VGSvcVerbose(0, "vbsvcAutoMountWorker: Shared folder '%s' was mounted to '%s'\n", pszShareName, pszMountPoint);
@@ -411,4 +408,7 @@
 
 # else /* RT_OS_LINUX */
+        uint32_t cbOpts = RTSystemGetPageSize();
+        char *pszOpts = (char *)alloca(cbOpts);
+        RT_BZERO(pszOpts, cbOpts);
         struct utsname uts;
         AssertStmt(uname(&uts) != -1, strcpy(uts.release, "4.4.0"));
@@ -1469,4 +1469,10 @@
     }
 
+#  if defined(RT_OS_LINUX)
+    /*
+     * Linux a bit more work...
+     */
+    struct utsname uts;
+    AssertStmt(uname(&uts) != -1, strcpy(uts.release, "4.4.0"));
     /*
      * Allocate options string buffer which is limited to a page on most systems.
@@ -1474,11 +1480,4 @@
     uint32_t cbOpts = RTSystemGetPageSize();
     char *pszOpts = (char *)alloca(cbOpts);
-
-#  if defined(RT_OS_LINUX)
-    /*
-     * Linux a bit more work...
-     */
-    struct utsname uts;
-    AssertStmt(uname(&uts) != -1, strcpy(uts.release, "4.4.0"));
 
     /* Built mount option string.  Need st_name for pre 2.6.0 kernels. */
@@ -1538,14 +1537,15 @@
      *       with EOVERFLOW in vfs_buildoptionstr() during domount() otherwise.
      */
-    ssize_t cchOpts = RTStrPrintf2(pszOpts, cbOpts,
+    char szOpts[MAX_MNTOPT_STR] = { '\0', };
+    ssize_t cchOpts = RTStrPrintf2(szOpts, sizeof(szOpts),
                                    "uid=0,gid=%d,dmode=0770,fmode=0770,dmask=0000,fmask=0000,tag=%s", gidMount, g_szTag);
     if (cchOpts <= 0)
     {
-        VGSvcError("vbsvcAutomounterMountIt: pszOpts overflow! %zd\n", cchOpts);
+        VGSvcError("vbsvcAutomounterMountIt: szOpts overflow! %zd\n", cchOpts);
         return VERR_BUFFER_OVERFLOW;
     }
 
     rc = mount(pEntry->pszName, pEntry->pszActualMountPoint, MS_OPTIONSTR, "vboxfs",
-               NULL /*dataptr*/, 0 /* datalen */, pszOpts, MAX_MNTOPT_STR);
+               NULL /*dataptr*/, 0 /* datalen */, szOpts, MAX_MNTOPT_STR);
     if (rc == 0)
     {
@@ -1556,6 +1556,6 @@
 
     rc = errno;
-    VGSvcError("vbsvcAutomounterMountIt: mount failed for '%s' on '%s' (pszOpts=%s): %s (%d)\n",
-               pEntry->pszName, pEntry->pszActualMountPoint, pszOpts, strerror(rc), rc);
+    VGSvcError("vbsvcAutomounterMountIt: mount failed for '%s' on '%s' (szOpts=%s): %s (%d)\n",
+               pEntry->pszName, pEntry->pszActualMountPoint, szOpts, strerror(rc), rc);
     return VERR_OPEN_FAILED;
 
Index: trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c
===================================================================
--- trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c	(revision 104925)
+++ trunk/src/VBox/Additions/solaris/SharedFolders/vboxfs_mount.c	(revision 104954)
@@ -47,6 +47,4 @@
 #include <sys/mount.h>
 
-#include <iprt/param.h> /* For PAGE_SIZE */
-
 #include "vboxfs.h"
 
@@ -55,5 +53,5 @@
 *   Global Variables                                                                                                             *
 *********************************************************************************************************************************/
-static char g_achOptBuf[PAGE_SIZE] = { '\0', };
+static char g_achOptBuf[MAX_MNTOPT_STR] = { '\0', };
 static const int g_RetErr = 33;
 static const int g_RetMagic = 2;
