Index: /trunk/include/iprt/fsisomaker.h
===================================================================
--- /trunk/include/iprt/fsisomaker.h	(revision 68146)
+++ /trunk/include/iprt/fsisomaker.h	(revision 68147)
@@ -118,4 +118,42 @@
  */
 RTDECL(int) RTFsIsoMakerSetJolietRockRidgeLevel(RTFSISOMAKER hIsoMaker, uint8_t uLevel);
+
+/**
+ * Sets the default file mode settings.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The default file mode.
+ */
+RTDECL(int) RTFsIsoMakerSetDefaultFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode);
+
+/**
+ * Sets the default dir mode settings.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The default dir mode.
+ */
+RTDECL(int) RTFsIsoMakerSetDefaultDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode);
+
+/**
+ * Sets the forced file mode, if @a fForce is true also the default mode is set.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The file mode.
+ * @param   fForce              Indicate whether forced mode is active or not.
+ */
+RTDECL(int) RTFsIsoMakerSetForcedFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce);
+
+/**
+ * Sets the forced dir mode, if @a fForce is true also the default mode is set.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The dir mode.
+ * @param   fForce              Indicate whether forced mode is active or not.
+ */
+RTDECL(int) RTFsIsoMakerSetForcedDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce);
 
 /**
Index: /trunk/include/iprt/mangling.h
===================================================================
--- /trunk/include/iprt/mangling.h	(revision 68146)
+++ /trunk/include/iprt/mangling.h	(revision 68147)
@@ -933,4 +933,8 @@
 # define RTFsIsoMakerSetRockRidgeLevel                  RT_MANGLER(RTFsIsoMakerSetRockRidgeLevel)
 # define RTFsIsoMakerSetJolietRockRidgeLevel            RT_MANGLER(RTFsIsoMakerSetJolietRockRidgeLevel)
+# define RTFsIsoMakerSetDefaultDirMode                  RT_MANGLER(RTFsIsoMakerSetDefaultDirMode)
+# define RTFsIsoMakerSetDefaultFileMode                 RT_MANGLER(RTFsIsoMakerSetDefaultFileMode)
+# define RTFsIsoMakerSetForcedDirMode                   RT_MANGLER(RTFsIsoMakerSetForcedDirMode)
+# define RTFsIsoMakerSetForcedFileMode                  RT_MANGLER(RTFsIsoMakerSetForcedFileMode)
 # define RTFsIsoMakerSetSysAreaContent                  RT_MANGLER(RTFsIsoMakerSetSysAreaContent)
 # define RTFsIsoMakerSetStringProp                      RT_MANGLER(RTFsIsoMakerSetStringProp)
Index: /trunk/src/VBox/Runtime/common/fs/isomaker.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/fs/isomaker.cpp	(revision 68146)
+++ /trunk/src/VBox/Runtime/common/fs/isomaker.cpp	(revision 68147)
@@ -507,4 +507,13 @@
     RTFMODE                 fDefaultDirMode;
 
+    /** Forced file mode mask (permissions only). */
+    RTFMODE                 fForcedFileMode;
+    /** Set if fForcedFileMode is active. */
+    bool                    fForcedFileModeActive;
+    /** Set if fForcedDirMode is active. */
+    bool                    fForcedDirModeActive;
+    /** Forced directory mode mask (permissions only). */
+    RTFMODE                 fForcedDirMode;
+
     /** Number of common source files. */
     uint32_t                cCommonSources;
@@ -818,4 +827,9 @@
         pThis->fDefaultDirMode              = 0555 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY | RTFS_DOS_READONLY;
 
+        //pThis->fForcedFileMode            = 0;
+        //pThis->fForcedFileModeActive      = false;
+        //pThis->fForcedDirModeActive       = false;
+        //pThis->fForcedDirMode             = 0;
+
         //pThis->cCommonSources             = 0;
         //pThis->paCommonSources            = NULL;
@@ -1216,4 +1230,92 @@
 
     pThis->Joliet.uRockRidgeLevel = uLevel;
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Sets the default file mode settings.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The default file mode.
+ */
+RTDECL(int) RTFsIsoMakerSetDefaultFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode)
+{
+    PRTFSISOMAKERINT pThis = hIsoMaker;
+    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
+    Assert(!(fMode & ~RTFS_UNIX_ALL_PERMS));
+
+    pThis->fDefaultFileMode &= ~RTFS_UNIX_ALL_PERMS;
+    pThis->fDefaultFileMode |= fMode & RTFS_UNIX_ALL_PERMS;
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Sets the default dir mode settings.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The default dir mode.
+ */
+RTDECL(int) RTFsIsoMakerSetDefaultDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode)
+{
+    PRTFSISOMAKERINT pThis = hIsoMaker;
+    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
+    Assert(!(fMode & ~RTFS_UNIX_ALL_PERMS));
+
+    pThis->fDefaultDirMode &= ~RTFS_UNIX_ALL_PERMS;
+    pThis->fDefaultDirMode |= fMode & RTFS_UNIX_ALL_PERMS;
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Sets the forced file mode, if @a fForce is true also the default mode is set.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The file mode.
+ * @param   fForce              Indicate whether forced mode is active or not.
+ */
+RTDECL(int) RTFsIsoMakerSetForcedFileMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce)
+{
+    PRTFSISOMAKERINT pThis = hIsoMaker;
+    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
+    Assert(!(fMode & ~RTFS_UNIX_ALL_PERMS));
+
+    pThis->fForcedFileMode       = fMode & RTFS_UNIX_ALL_PERMS;
+    pThis->fForcedFileModeActive = fForce;
+    if (fForce)
+    {
+        pThis->fDefaultFileMode &= ~RTFS_UNIX_ALL_PERMS;
+        pThis->fDefaultFileMode |= fMode & RTFS_UNIX_ALL_PERMS;
+    }
+    return VINF_SUCCESS;
+}
+
+
+/**
+ * Sets the forced dir mode, if @a fForce is true also the default mode is set.
+ *
+ * @returns IRPT status code.
+ * @param   hIsoMaker           The ISO maker handle.
+ * @param   fMode               The dir mode.
+ * @param   fForce              Indicate whether forced mode is active or not.
+ */
+RTDECL(int) RTFsIsoMakerSetForcedDirMode(RTFSISOMAKER hIsoMaker, RTFMODE fMode, bool fForce)
+{
+    PRTFSISOMAKERINT pThis = hIsoMaker;
+    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
+    Assert(!(fMode & ~RTFS_UNIX_ALL_PERMS));
+
+    pThis->fForcedDirModeActive  = fForce;
+    pThis->fForcedDirMode        = fMode & RTFS_UNIX_ALL_PERMS;
+    if (fForce)
+    {
+        pThis->fDefaultDirMode  &= ~RTFS_UNIX_ALL_PERMS;
+        pThis->fDefaultDirMode  |= fMode & RTFS_UNIX_ALL_PERMS;
+    }
     return VINF_SUCCESS;
 }
@@ -2888,4 +2990,7 @@
         pObj->AccessedTime      = pObjInfo->AccessTime;
         pObj->fMode             = pObjInfo->Attr.fMode;
+        if (enmType == RTFSISOMAKEROBJTYPE_DIR ? pThis->fForcedDirModeActive : pThis->fForcedFileModeActive)
+            pObj->fMode = (pObj->fMode & ~RTFS_UNIX_ALL_PERMS)
+                        | (enmType == RTFSISOMAKEROBJTYPE_DIR ? pThis->fForcedDirMode : pThis->fForcedFileMode);
         pObj->uid               = pObjInfo->Attr.u.Unix.uid != NIL_RTUID ? pObjInfo->Attr.u.Unix.uid : pThis->uidDefault;
         pObj->gid               = pObjInfo->Attr.u.Unix.gid != NIL_RTGID ? pObjInfo->Attr.u.Unix.gid : pThis->gidDefault;
Index: /trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp	(revision 68146)
+++ /trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp	(revision 68147)
@@ -113,4 +113,7 @@
     RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144,
     RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288,
+
+    RTFSISOMAKERCMD_OPT_NO_FILE_MODE,
+    RTFSISOMAKERCMD_OPT_NO_DIR_MODE,
 
     /*
@@ -350,4 +353,12 @@
      */
     uint32_t            afNameSpecifiers[RTFSISOMAKERCMD_MAX_NAMES];
+    /** The forced directory mode. */
+    RTFMODE             fDirMode;
+    /** Set if fDirMode should be applied.   */
+    bool                fDirModeActive;
+    /** Set if fFileMode should be applied.   */
+    bool                fFileModeActive;
+    /** The force file mode. */
+    RTFMODE             fFileMode;
     /** @} */
 
@@ -456,4 +467,7 @@
     { "--eltorito-floppy-144",          RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144,            RTGETOPT_REQ_NOTHING },
     { "--eltorito-floppy-288",          RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288,            RTGETOPT_REQ_NOTHING },
+
+    { "--no-file-mode",                 RTFSISOMAKERCMD_OPT_NO_FILE_MODE,                   RTGETOPT_REQ_NOTHING },
+    { "--no-dir-mode",                  RTFSISOMAKERCMD_OPT_NO_DIR_MODE,                    RTGETOPT_REQ_NOTHING },
 
 #define DD(a_szLong, a_chShort, a_fFlags) { a_szLong, a_chShort, a_fFlags  }, { "-" a_szLong, a_chShort, a_fFlags  }
@@ -485,4 +499,9 @@
     { "--volume-id",                    RTFSISOMAKERCMD_OPT_VOLUME_ID,                      RTGETOPT_REQ_STRING  }, /* should've been '-V' */
     DD("-volset",                       RTFSISOMAKERCMD_OPT_VOLUME_SET_ID,                  RTGETOPT_REQ_STRING  ),
+
+    /* Other: */
+    DD("-file-mode",                    RTFSISOMAKERCMD_OPT_FILE_MODE,                      RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
+    DD("-dir-mode",                     RTFSISOMAKERCMD_OPT_DIR_MODE,                       RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
+    DD("-new-dir-mode",                 RTFSISOMAKERCMD_OPT_NEW_DIR_MODE,                   RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
 
     /*
@@ -510,8 +529,6 @@
     { "--dont-append-dot",              'd',                                                RTGETOPT_REQ_NOTHING },
     { "--deep-directories",             'D',                                                RTGETOPT_REQ_NOTHING },
-    DD("-dir-mode",                     RTFSISOMAKERCMD_OPT_DIR_MODE,                       RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
     DD("-dvd-video",                    RTFSISOMAKERCMD_OPT_DVD_VIDEO,                      RTGETOPT_REQ_NOTHING ),
     DD("-follow-symlinks",              'f',                                                RTGETOPT_REQ_NOTHING ),
-    DD("-file-mode",                    RTFSISOMAKERCMD_OPT_FILE_MODE,                      RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
     DD("-gid",                          RTFSISOMAKERCMD_OPT_GID,                            RTGETOPT_REQ_UINT32  ),
     DD("-gui",                          RTFSISOMAKERCMD_OPT_GUI,                            RTGETOPT_REQ_NOTHING ),
@@ -549,5 +566,4 @@
     DD("-dev",                          'M',                                                RTGETOPT_REQ_STRING  ),
     { "--omit-version-numbers",         'N',                                                RTGETOPT_REQ_NOTHING },
-    DD("-new-dir-mode",                 RTFSISOMAKERCMD_OPT_NEW_DIR_MODE,                   RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_OCT ),
     DD("-nobak",                        RTFSISOMAKERCMD_OPT_NO_BACKUP_FILES,                RTGETOPT_REQ_NOTHING ),
     DD("-no-bak",                       RTFSISOMAKERCMD_OPT_NO_BACKUP_FILES,                RTGETOPT_REQ_NOTHING ),
@@ -2599,4 +2615,73 @@
 
 /**
+ * Handles the --dir-mode and --file-mode options.
+ *
+ * @returns IPRT status code.
+ * @param   pOpts               The ISO maker command instance.
+ * @param   fDir                True if applies to dir, false if applies to
+ *                              files.
+ * @param   fMode               The forced mode.
+ */
+static int rtFsIsoMakerCmdOptSetFileOrDirMode(PRTFSISOMAKERCMDOPTS pOpts, bool fDir, RTFMODE fMode)
+{
+    /* Change the mode masks. */
+    int rc;
+    if (fDir)
+        rc = RTFsIsoMakerSetForcedDirMode(pOpts->hIsoMaker, fMode, true /*fForced*/);
+    else
+        rc = RTFsIsoMakerSetForcedFileMode(pOpts->hIsoMaker, fMode, true /*fForced*/);
+    if (RT_SUCCESS(rc))
+    {
+        /* Then enable rock.*/
+        rc = RTFsIsoMakerSetRockRidgeLevel(pOpts->hIsoMaker, 2);
+        if (RT_SUCCESS(rc))
+            return VINF_SUCCESS;
+        return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to enable rock ridge: %Rrc", rc);
+    }
+    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set %s force & default mode mask to %04o: %Rrc",
+                                  fMode, fDir ? "directory" : "file", rc);
+}
+
+
+/**
+ * Handles the --no-dir-mode and --no-file-mode options that counters
+ * --dir-mode and --file-mode.
+ *
+ * @returns IPRT status code.
+ * @param   pOpts               The ISO maker command instance.
+ * @param   fDir                True if applies to dir, false if applies to
+ *                              files.
+ */
+static int rtFsIsoMakerCmdOptDisableFileOrDirMode(PRTFSISOMAKERCMDOPTS pOpts, bool fDir)
+{
+    int rc;
+    if (fDir)
+        rc = RTFsIsoMakerSetForcedDirMode(pOpts->hIsoMaker, 0, false /*fForced*/);
+    else
+        rc = RTFsIsoMakerSetForcedFileMode(pOpts->hIsoMaker, 0, true /*fForced*/);
+    if (RT_SUCCESS(rc))
+        return VINF_SUCCESS;
+    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to disable forced %s mode mask: %Rrc", fDir ? "directory" : "file", rc);
+}
+
+
+
+/**
+ * Handles the --new-dir-mode option.
+ *
+ * @returns IPRT status code.
+ * @param   pOpts               The ISO maker command instance.
+ * @param   fMode               The forced mode.
+ */
+static int rtFsIsoMakerCmdOptSetNewDirMode(PRTFSISOMAKERCMDOPTS pOpts, RTFMODE fMode)
+{
+    int rc = RTFsIsoMakerSetDefaultDirMode(pOpts->hIsoMaker, fMode);
+    if (RT_SUCCESS(rc))
+        return VINF_SUCCESS;
+    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set default dir mode mask to %04o: %Rrc", fMode, rc);
+}
+
+
+/**
  * Loads an argument file (e.g. a .iso-file) and parses it.
  *
@@ -2767,4 +2852,12 @@
                 break;
 
+            case RTFSISOMAKERCMD_OPT_NO_FILE_MODE:
+                rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, false /*fDir*/);
+                break;
+            case RTFSISOMAKERCMD_OPT_NO_DIR_MODE:
+                rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, true /*fDir*/);
+                break;
+
+
             /*
              * Joliet related options.
@@ -2885,4 +2978,17 @@
                 pOpts->pszOutFile = ValueUnion.psz;
                 break;
+
+            case RTFSISOMAKERCMD_OPT_DIR_MODE:
+                rc = rtFsIsoMakerCmdOptSetFileOrDirMode(pOpts, true /*fDir*/, ValueUnion.u32);
+                break;
+
+            case RTFSISOMAKERCMD_OPT_FILE_MODE:
+                rc = rtFsIsoMakerCmdOptSetFileOrDirMode(pOpts, false /*fDir*/, ValueUnion.u32);
+                break;
+
+            case RTFSISOMAKERCMD_OPT_NEW_DIR_MODE:
+                rc = rtFsIsoMakerCmdOptSetNewDirMode(pOpts, ValueUnion.u32);
+                break;
+
 
             /*
