Index: trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 39019)
+++ trunk/src/VBox/HostDrivers/Support/SUPLib.cpp	(revision 39086)
@@ -580,5 +580,5 @@
 static int supCallVMMR0ExFake(PVMR0 pVMR0, unsigned uOperation, uint64_t u64Arg, PSUPVMMR0REQHDR pReqHdr)
 {
-    AssertMsgFailed(("%d\n", uOperation));
+    AssertMsgFailed(("%d\n", uOperation)); NOREF(pVMR0); NOREF(uOperation); NOREF(u64Arg); NOREF(pReqHdr);
     return VERR_NOT_SUPPORTED;
 }
@@ -587,4 +587,5 @@
 SUPR3DECL(int) SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu)
 {
+    NOREF(pVMR0);
     if (RT_LIKELY(uOperation == SUP_VMMR0_DO_RAW_RUN))
         return suplibOsIOCtlFast(&g_supLibData, SUP_IOCTL_FAST_DO_RAW_RUN, idCpu);
@@ -1040,4 +1041,5 @@
     AssertPtrNullReturn(paPages, VERR_INVALID_POINTER);
     AssertMsgReturn(cPages > 0 && cPages <= VBOX_MAX_ALLOC_PAGE_COUNT, ("cPages=%zu\n", cPages), VERR_PAGE_COUNT_OUT_OF_RANGE);
+    AssertReturn(!fFlags, VERR_INVALID_PARAMETER);
 
     /* fake */
@@ -1538,4 +1540,5 @@
     return rc;
 #else
+    NOREF(pszDirPath); NOREF(fRecursive); NOREF(fCheckFiles);
     return VINF_SUCCESS;
 #endif
@@ -1615,4 +1618,5 @@
                                                     const char *pszSymbol, unsigned uSymbol, RTUINTPTR *pValue, void *pvUser)
 {
+    NOREF(hLdrMod); NOREF(pvUser); NOREF(uSymbol);
     AssertPtr(pValue);
     AssertPtr(pvUser);
@@ -1754,4 +1758,5 @@
         pArgs->cbStrings += strlen(pszSymbol) + 1;
     }
+    NOREF(hLdrMod); NOREF(uSymbol);
     return VINF_SUCCESS;
 }
@@ -1786,4 +1791,5 @@
         pArgs->psz += cbCopy;
     }
+    NOREF(hLdrMod); NOREF(uSymbol);
     return VINF_SUCCESS;
 }
@@ -2232,6 +2238,4 @@
 SUPR3DECL(int) SUPR3HardenedLdrLoadPlugIn(const char *pszFilename, PRTLDRMOD phLdrMod, PRTERRINFO pErrInfo)
 {
-    int rc;
-
     /*
      * Validate input.
@@ -2247,5 +2251,5 @@
      * Verify the image file.
      */
-    rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pErrInfo);
+    int rc = supR3HardenedVerifyFile(pszFilename, RTHCUINTPTR_MAX, pErrInfo);
     if (RT_FAILURE(rc))
     {
Index: trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp
===================================================================
--- trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp	(revision 39019)
+++ trunk/src/VBox/HostDrivers/Support/SUPR3HardenedVerify.cpp	(revision 39086)
@@ -278,5 +278,5 @@
      */
     int rc = supR3HardenedMakePath(pFile->enmDir, pszDst, cchDst, fFatal);
-    if (RT_SUCCESS(rc))
+    if (RT_SUCCESS(rc) && fWithFilename)
     {
         size_t cchFile = strlen(pFile->pszFile);
@@ -456,5 +456,5 @@
     {
         char szPath[RTPATH_MAX];
-        rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true, fFatal);
+        rc = supR3HardenedMakeFilePath(pFile, szPath, sizeof(szPath), true /*fWithFilename*/, fFatal);
         if (RT_SUCCESS(rc))
         {
@@ -1135,8 +1135,10 @@
 #if defined(RT_OS_WINDOWS)
     /** @todo Windows hardening. */
+    NOREF(pFsObjState); NOREF(fDir); NOREF(fRelaxed); NOREF(pszPath); NOREF(pErrInfo);
     return VINF_SUCCESS;
 
 #elif defined(RT_OS_OS2)
     /* No hardening here - it's a single user system. */
+    NOREF(pFsObjState); NOREF(fDir); NOREF(fRelaxed); NOREF(pszPath); NOREF(pErrInfo);
     return VINF_SUCCESS;
 
@@ -1186,9 +1188,14 @@
            full access. So, to work around we relax the hardening a bit and
            permit grand parents and beyond to be group writable by admin. */
-        if (pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */
+        if (!fRelaxed || pFsObjState->Stat.st_gid != 80 /*admin*/) /** @todo dynamically resolve the admin group? */
 #elif defined(RT_OS_FREEBSD)
         /* HACK ALERT: PC-BSD 9 has group-writable application directory,
-           similar to OS X and their /Applications directory (see above). */
-        if (pFsObjState->Stat.st_gid != 5 /*operators*/)
+           similar to OS X and their /Applications directory (see above).
+           On FreeBSD root is normally the only member of this group. */
+        /** @todo Can we test for fRelaxed here like on the mac or is the 'operator'
+         *        group the owner of the immediate installation directory? More
+         *        details would be greatly appreciated as this HACK affects real FreeBSD
+         *        as well as the PC-BSD fork! */
+        if (pFsObjState->Stat.st_gid != 5 /*operator*/)
 #endif
             return supR3HardenedSetError3(VERR_SUPLIB_WRITE_NON_SYS_GROUP, pErrInfo,
