VirtualBox

Changeset 25292 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 10, 2009 10:29:57 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
55839
Message:

RTDirReadEx parameter to resolve symlinks.

Location:
trunk/src/VBox
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VBoxHDD.cpp

    r24887 r25292  
    651651    }
    652652
    653     while ((rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING)) != VERR_NO_MORE_FILES)
     653    while ((rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK)) != VERR_NO_MORE_FILES)
    654654    {
    655655        RTLDRMOD hPlugin = NIL_RTLDRMOD;
     
    664664            pPluginDirEntry = (PRTDIRENTRYEX)RTMemAllocZ(cbPluginDirEntry);
    665665            /* Retry. */
    666             rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING);
     666            rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    667667            if (RT_FAILURE(rc))
    668668                break;
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstShflCase.cpp

    r18460 r25292  
    126126}
    127127
    128 int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
    129 {
     128int rtDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     129{
     130    NOREF(fFlags);
    130131    switch(iDirList)
    131132    {
     
    229230        size_t cbDirEntrySize = cbDirEntry;
    230231
    231         rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
     232        rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
    232233        if (rc == VERR_NO_MORE_FILES)
    233234            break;
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r24374 r25292  
    143143        size_t cbDirEntrySize = cbDirEntry;
    144144
    145         rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
     145        rc = RTDirReadEx(hSearch, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
    146146        if (rc == VERR_NO_MORE_FILES)
    147147            break;
     
    15321532            pDirEntry = pDirEntryOrg;
    15331533
    1534             rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING);
     1534            rc = RTDirReadEx(DirHandle, pDirEntry, &cbDirEntrySize, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
    15351535            if (rc == VERR_NO_MORE_FILES)
    15361536            {
  • trunk/src/VBox/Runtime/r3/linux/sysfs.cpp

    r23349 r25292  
    402402        {
    403403            RTDIRENTRYEX Entry;
    404             rc = RTDirReadEx(pDir, &Entry, NULL, RTFSOBJATTRADD_UNIX);
     404            rc = RTDirReadEx(pDir, &Entry, NULL, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
    405405            if (RT_FAILURE(rc))
    406406            {
     
    413413                break;
    414414            }
    415             if (RTFS_IS_SYMLINK(Entry.Info.Attr.fMode)) /* paranoia */
     415            if (RTFS_IS_SYMLINK(Entry.Info.Attr.fMode)) /* paranoia. @todo RTDirReadEx now returns symlinks, see also #if 1 below. */
    416416                continue;
    417417
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r21672 r25292  
    389389
    390390
    391 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
     391RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
    392392{
    393393    /*
     
    401401                    ("Invalid enmAdditionalAttribs=%p\n", enmAdditionalAttribs),
    402402                    VERR_INVALID_PARAMETER);
     403    AssertMsgReturn(RTPATH_F_IS_VALID(fFlags, 0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    403404    size_t cbDirEntry = sizeof(*pDirEntry);
    404405    if (pcbDirEntry)
     
    448449                memcpy(pszNamePath, pDir->pszPath, pDir->cchPath);
    449450                memcpy(pszNamePath + pDir->cchPath, pszName, cchName + 1);
    450                 rc = RTPathQueryInfo(pszNamePath, &pDirEntry->Info, enmAdditionalAttribs);
     451                rc = RTPathQueryInfoEx(pszNamePath, &pDirEntry->Info, enmAdditionalAttribs, fFlags);
    451452            }
    452453            else
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r23298 r25292  
    310310
    311311
    312 RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs)
    313 {
     312RTDECL(int) RTDirReadEx(PRTDIR pDir, PRTDIRENTRYEX pDirEntry, size_t *pcbDirEntry, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags)
     313{
     314    /** @todo Symlinks: Find[First|Next]FileW will return info about
     315        the link, so RTPATH_F_FOLLOW_LINK is not handled correctly. */
    314316    /*
    315317     * Validate input.
     
    331333        return VERR_INVALID_PARAMETER;
    332334    }
     335    AssertMsgReturn(RTPATH_F_IS_VALID(fFlags, 0), ("%#x\n", fFlags), VERR_INVALID_PARAMETER);
    333336    size_t cbDirEntry = sizeof(*pDirEntry);
    334337    if (pcbDirEntry)
  • trunk/src/VBox/Runtime/testcase/tstDir.cpp

    r14831 r25292  
    3333#include <iprt/stream.h>
    3434#include <iprt/err.h>
     35#include <iprt/path.h>
    3536//#include <iprt/
    3637
     
    106107                    {
    107108                        RTDIRENTRYEX DirEntry;
    108                         rc = RTDirReadEx(pDir, &DirEntry, NULL, RTFSOBJATTRADD_UNIX);
     109                        rc = RTDirReadEx(pDir, &DirEntry, NULL, RTFSOBJATTRADD_UNIX, RTPATH_F_ON_LINK);
    109110                        if (RT_FAILURE(rc))
    110111                            break;
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