VirtualBox

Changeset 67254 in vbox


Ignore:
Timestamp:
Jun 2, 2017 5:29:13 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
115949
Message:

Main/ApplianceExport: Set special user and group names and IDs in the TAR output so the vbox version can be easily identified. Also normalize the file mode mask in the TAR output a little. Hope no OVF/OPC reader are offended by this...

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r67249 r67254  
    493493        $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
    494494
     495src-server/ApplianceImplExport.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
     496
    495497ifn1of ($(KBUILD_TARGET), win darwin)
    496498        VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
  • trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp

    r67252 r67254  
    20422042    /*
    20432043     * Open the output file and attach a TAR creator to it.
     2044     * The OVF 1.1.0 spec specifies the TAR format to be compatible with USTAR
     2045     * according to POSIX 1003.1-2008.  We use the 1988 spec here as it's the
     2046     * only variant we currently implement.
    20442047     */
    20452048    HRESULT hrc;
     
    20502053    if (RT_SUCCESS(vrc))
    20512054    {
    2052         /** @todo which format does the standard dictate here actually?
    2053          *  GNU or USTAR/POSIX? */
    20542055        RTVFSFSSTREAM hVfsFssTar;
    2055         vrc = RTZipTarFsStreamToIoStream(hVfsIosTar, RTZIPTARFORMAT_GNU, 0 /*fFlags*/, &hVfsFssTar);
     2056        vrc = RTZipTarFsStreamToIoStream(hVfsIosTar, RTZIPTARFORMAT_USTAR, 0 /*fFlags*/, &hVfsFssTar);
    20562057        RTVfsIoStrmRelease(hVfsIosTar);
    20572058        if (RT_SUCCESS(vrc))
    20582059        {
     2060            RTZipTarFsStreamSetFileMode(hVfsFssTar, 0660, 0440);
     2061            RTZipTarFsStreamSetOwner(hVfsFssTar, VBOX_VERSION_MAJOR,
     2062                                       pTask->enFormat == ovf::OVFVersion_0_9 ? "vboxovf09"
     2063                                     : pTask->enFormat == ovf::OVFVersion_1_0 ? "vboxovf10"
     2064                                     : pTask->enFormat == ovf::OVFVersion_2_0 ? "vboxovf20"
     2065                                     :                                          "vboxovf");
     2066            RTZipTarFsStreamSetGroup(hVfsFssTar, VBOX_VERSION_MINOR,
     2067                                     "vbox_v" RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "."
     2068                                     RT_XSTR(VBOX_VERSION_MAJOR) "r" RT_XSTR(VBOX_SVN_REV));
     2069
    20592070            hrc = i_writeFSImpl(pTask, writeLock, hVfsFssTar);
    20602071            RTVfsFsStrmRelease(hVfsFssTar);
     
    21892200            if (RT_SUCCESS(vrc))
    21902201            {
     2202                RTZipTarFsStreamSetFileMode(hVfsFssTar, 0660, 0440);
     2203                RTZipTarFsStreamSetOwner(hVfsFssTar, VBOX_VERSION_MAJOR, "vboxopc10");
     2204                RTZipTarFsStreamSetGroup(hVfsFssTar, VBOX_VERSION_MINOR,
     2205                                         "vbox_v" RT_XSTR(VBOX_VERSION_MAJOR) "." RT_XSTR(VBOX_VERSION_MINOR) "."
     2206                                         RT_XSTR(VBOX_VERSION_MAJOR) "r" RT_XSTR(VBOX_SVN_REV));
     2207
    21912208                /*
    21922209                 * Let the Medium code do the heavy work.
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette