VirtualBox

Changeset 59857 in vbox


Ignore:
Timestamp:
Feb 26, 2016 4:43:35 PM (9 years ago)
Author:
vboxsync
Message:

BugReportTool(bugref:8169): truncate filenames inside TAR archive to fit into 100 characters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBugReport/VBoxBugReport.cpp

    r59815 r59857  
    380380void BugReportTarGzip::processItem(BugReportItem* item)
    381381{
    382     handleRtError(RTTarFileOpen(m_hTar, &m_hTarFile, item->getTitle(),
     382    /*
     383     * @todo Our TAR implementation does not support names larger than 100 characters.
     384     * We truncate the title to make sure it will fit into 100-character field of TAR header.
     385     */
     386    RTCString strTarFile = RTCString(item->getTitle()).substr(0, RTStrNLen(item->getTitle(), 99));
     387    handleRtError(RTTarFileOpen(m_hTar, &m_hTarFile, strTarFile.c_str(),
    383388                                RTFILE_O_CREATE | RTFILE_O_WRITE | RTFILE_O_DENY_NONE),
    384                   "Failed to open '%s' in TAR", item->getTitle());
     389                  "Failed to open '%s' in TAR", strTarFile.c_str());
    385390
    386391    PRTSTREAM strmIn = NULL;
     
    413418    if (m_hTarFile)
    414419    {
    415         RTTarFileClose(m_hTarFile);
     420        handleRtError(RTTarFileClose(m_hTarFile), "Failed to close '%s' in TAR", strTarFile.c_str());
    416421        m_hTarFile = NIL_RTTARFILE;
    417422    }
Note: See TracChangeset for help on using the changeset viewer.

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