VirtualBox

Changeset 70884 in vbox


Ignore:
Timestamp:
Feb 6, 2018 4:26:08 PM (7 years ago)
Author:
vboxsync
Message:

IPRT: Added RTDIR_F_NO_FOLLOW (not implemented yet).

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/dir.h

    r69761 r70884  
    352352/** Deny relative opening of anything above this directory. */
    353353#define RTDIR_F_DENY_ASCENT     RT_BIT_32(1)
     354/** Don't follow symbolic links in the final component. */
     355#define RTDIR_F_NO_FOLLOW       RT_BIT_32(2)
    354356/** Valid flag mask.   */
    355 #define RTDIR_F_VALID_MASK      UINT32_C(0x00000003)
     357#define RTDIR_F_VALID_MASK      UINT32_C(0x00000007)
    356358/** @} */
    357359
  • trunk/src/VBox/Runtime/r3/nt/direnum-r3-nt.cpp

    r70419 r70884  
    108108#endif
    109109    if (hRelativeDir == ~(uintptr_t)0 && pvNativeRelative == NULL)
     110    {
     111        AssertMsg(pDir->fFlags & RTDIR_F_NO_FOLLOW /* Add FILE_OPEN_REPARSE_POINT and see how that works out (it better!). Need fallbacks for pre Vista. */,
     112                  ("Implement RTDIR_F_NO_FOLLOW!\n"));
    110113        rc = RTNtPathOpenDir(pszPathBuf,
    111114                             FILE_LIST_DIRECTORY | FILE_READ_ATTRIBUTES | FILE_TRAVERSE | SYNCHRONIZE,
     
    120123#endif
    121124                             );
     125    }
    122126    else if (pvNativeRelative != NULL)
     127    {
     128        AssertMsg(pDir->fFlags & RTDIR_F_NO_FOLLOW /* Add FILE_OPEN_REPARSE_POINT and see how that works out (it better!). Need fallbacks for pre Vista. */,
     129                  ("Implement RTDIR_F_NO_FOLLOW!\n"));
    123130        rc = RTNtPathOpenDirEx((HANDLE)hRelativeDir,
    124131                               (struct _UNICODE_STRING *)pvNativeRelative,
     
    135142
    136143                               );
     144    }
    137145    else
    138146    {
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r69753 r70884  
    237237    if (RT_SUCCESS(rc))
    238238    {
    239         pDir->pDir = opendir(pszNativePath);
     239        if (!(pDir->fFlags & RTDIR_F_NO_FOLLOW))
     240            pDir->pDir = opendir(pszNativePath);
     241        else
     242        {
     243            AssertMsgFailed(("implement RTDIR_F_NO_FOLLOW\n"));
     244            pDir->pDir = opendir(pszNativePath);
     245        }
    240246        if (pDir->pDir)
    241247        {
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