VirtualBox

Changeset 39612 in vbox


Ignore:
Timestamp:
Dec 14, 2011 2:19:55 PM (13 years ago)
Author:
vboxsync
Message:

IPRT/*: add _NO_SYMLINKS flags to certain functions

Location:
trunk
Files:
30 edited

Legend:

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

    r36579 r39612  
    5151RTDECL(bool) RTDirExists(const char *pszPath);
    5252
     53/** @name RTDirCreate  flags.
     54 * @{ */
     55/** Don't allow symbolic links as part of the path. */
     56#define RTDIRCREATE_FLAGS_NO_SYMLINKS  RT_BIT(0)
     57/** @} */
     58
    5359/**
    5460 * Creates a directory.
     
    5763 * @param   pszPath     Path to the directory to create.
    5864 * @param   fMode       The mode of the new directory.
    59  */
    60 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode);
     65 * @param   fCreate     Create flags, RTDIRCREATE_FLAGS_*.
     66 */
     67RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate);
    6168
    6269/**
     
    295302RTDECL(int) RTDirOpen(PRTDIR *ppDir, const char *pszPath);
    296303
     304/** @name RTDirOpenFiltered  flags.
     305 * @{ */
     306/** Don't allow symbolic links as part of the path. */
     307#define RTDIROPENFILTERED_FLAGS_NO_SYMLINKS  RT_BIT(0)
     308/** @} */
     309
    297310/**
    298311 * Opens a directory filtering the entries using dos style wildcards.
     
    303316 * @param   enmFilter   The kind of filter to apply. Setting this to RTDIRFILTER_NONE makes
    304317 *                      this function behave like RTDirOpen.
    305  */
    306 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter);
     318 * @param   fOpen       Open flags, RTDIROPENFILTERED_FLAGS_*.
     319 */
     320RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fOpen);
    307321
    308322/**
  • trunk/include/iprt/file.h

    r39195 r39612  
    213213#define RTFILE_O_NO_CACHE               UINT32_C(0x00080000)
    214214
     215/** Don't allow symbolic links as part of the path. */
     216#define RTFILE_O_NO_SYMLINKS            UINT32_C(0x20000000)
     217
    215218/** Unix file mode mask for use when creating files. */
    216219#define RTFILE_O_CREATE_MODE_MASK       UINT32_C(0x1ff00000)
     
    220223#define RTFILE_O_CREATE_MODE_SHIFT      20
    221224
    222                                       /*UINT32_C(0x20000000),
    223                                         UINT32_C(0x40000000)
    224                                     and UINT32_C(0x80000000) are unused atm. */
     225                                      /* UINT32_C(0x40000000)
     226                                     and UINT32_C(0x80000000) are unused atm. */
    225227
    226228/** Mask of all valid flags.
    227229 * @remark  This doesn't validate the access mode properly.
    228230 */
    229 #define RTFILE_O_VALID_MASK             UINT32_C(0x1ffffff7)
     231#define RTFILE_O_VALID_MASK             UINT32_C(0x3ffffff7)
    230232
    231233/** @} */
     
    562564 * @{ */
    563565/** Replace destination file if present. */
    564 #define RTFILEMOVE_FLAGS_REPLACE    0x1
     566#define RTFILEMOVE_FLAGS_REPLACE      0x1
     567/** Don't allow symbolic links as part of the path. */
     568#define RTFILEMOVE_FLAGS_NO_SYMLINKS  0x2
    565569/** @} */
    566570
  • trunk/include/iprt/mangling.h

    r39550 r39612  
    909909# define RTPathTemp                                     RT_MANGLER(RTPathTemp)
    910910# define RTPathTraverseList                             RT_MANGLER(RTPathTraverseList)
     911# define RTPathUnlink                                   RT_MANGLER(RTPathUnlink)
    911912# define RTPathUserDocuments                            RT_MANGLER(RTPathUserDocuments)
    912913# define RTPathUserHome                                 RT_MANGLER(RTPathUserHome)
  • trunk/include/iprt/path.h

    r36611 r39612  
    892892/** This will replace attempt any target which isn't a directory. */
    893893#define RTPATHRENAME_FLAGS_REPLACE      RT_BIT(0)
     894/** Don't allow symbolic links as part of the path. */
     895#define RTPATHRENAME_FLAGS_NO_SYMLINKS  RT_BIT(1)
    894896/** @} */
    895897
     
    907909RTR3DECL(int) RTPathRename(const char *pszSrc,  const char *pszDst, unsigned fRename);
    908910
     911/** @name RTPathUnlink flags.
     912 * @{ */
     913/** Don't allow symbolic links as part of the path. */
     914#define RTPATHUNLINK_FLAGS_NO_SYMLINKS  RT_BIT(0)
     915/** @} */
     916
     917/**
     918 * Removes the last component of the path.
     919 *
     920 * @returns IPRT status code.
     921 * @param   pszPath     The path.
     922 * @param   fUnlink     Unlink flags, RTPATHUNLINK_FLAGS_*.
     923 */
     924RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink);
     925
    909926#endif /* IN_RING3 */
    910927
  • trunk/include/iprt/symlink.h

    r33676 r39612  
    8686} RTSYMLINKTYPE;
    8787
     88/** @name RTSymlinkCreate flags.
     89 * @{ */
     90/** Don't allow symbolic links as part of the path. */
     91#define RTSYMLINKCREATE_FLAGS_NO_SYMLINKS  RT_BIT(0)
     92/** @} */
     93
    8894/**
    8995 * Creates a symbolic link (@a pszSymlink) targeting @a pszTarget.
     
    99105 *                          make a guess and may attempt query information
    100106 *                          about @a pszTarget in the process.
     107 * @param   fCreate         Create flags, RTSYMLINKCREATE_FLAGS_*.
    101108 */
    102 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType);
     109RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget,
     110                            RTSYMLINKTYPE enmType, uint32_t fCreate);
     111
     112/** @name RTSymlinkDelete flags.
     113 * @{ */
     114/** Don't allow symbolic links as part of the path. */
     115#define RTSYMLINKDELETE_FLAGS_NO_SYMLINKS  RT_BIT(0)
     116/** @} */
    103117
    104118/**
     
    112126 *
    113127 * @param   pszSymlink      The symbolic link that should be removed.
     128 * @param   fDelete         Delete flags, RTSYMLINKDELETE_FLAGS_*.
    114129 */
    115 RTDECL(int) RTSymlinkDelete(const char *pszSymlink);
     130RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete);
     131
     132/** @name RTSymlinkRead  flags.
     133 * @{ */
     134/** Don't allow symbolic links as part of the path. */
     135#define RTSYMLINKREAD_FLAGS_NO_SYMLINKS  RT_BIT(0)
     136/** @} */
    116137
    117138/**
     
    127148 * @param   pszTarget       The target buffer.
    128149 * @param   cbTarget        The size of the target buffer.
     150 * @param   fRead           Read flags, RTSYMLINKREAD_FLAGS_*.
    129151 */
    130 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget);
     152RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
    131153
    132154/**
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp

    r33468 r39612  
    161161                if (pszPathTmp)
    162162                {
    163                     rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT);
     163                    rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT, 0);
    164164                    RTStrFree(pszPathTmp);
    165165                }
     
    248248
    249249        /* Open the directory */
    250         rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT);
     250        rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT, 0);
    251251        if (RT_SUCCESS(rc))
    252252        {
     
    319319
    320320                        /* Open the directory */
    321                         rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT);
     321                        rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT, 0);
    322322                        if (RT_FAILURE(rc))
    323323                            break;
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp

    r39515 r39612  
    989989                    rc = RTDirCreateFullPath(ValueUnion.psz, fDirMode);
    990990                else
    991                     rc = RTDirCreate(ValueUnion.psz, fDirMode);
     991                    rc = RTDirCreate(ValueUnion.psz, fDirMode, 0);
    992992                if (RT_FAILURE(rc))
    993993                    return RTMsgErrorExit(RTEXITCODE_FAILURE, "Could not create directory '%s': %Rra\n",
  • trunk/src/VBox/Debugger/DBGCCommands.cpp

    r38838 r39612  
    18751875
    18761876    PRTDIR pDir;
    1877     rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT);
     1877    rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT, 0);
    18781878    if (RT_SUCCESS(rc))
    18791879    {
  • trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp

    r39543 r39612  
    125125static RTFMODE testRTDirCreateMode;
    126126
    127 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode)
     127extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate)
    128128{
    129129 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __PRETTY_FUNCTION__, pszPath,
     
    389389}
    390390
    391 extern int testRTSymlinkDelete(const char *pszSymlink) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
     391extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete)
     392{ RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
    392393extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget,
    393                               size_t cbTarget) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
     394                              size_t cbTarget, uint32_t fRead)
     395{ RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; }
    394396
    395397/******************************************************************************
  • trunk/src/VBox/HostServices/SharedFolders/teststubs.h

    r39542 r39612  
    3030extern int testRTDirClose(PRTDIR pDir);
    3131#define RTDirCreate          testRTDirCreate
    32 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode);
     32extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate);
    3333#define RTDirOpen            testRTDirOpen
    3434extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath);
     
    7676extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags);
    7777#define RTSymlinkDelete      testRTSymlinkDelete
    78 extern int testRTSymlinkDelete(const char *pszSymlink);
     78extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete);
    7979#define RTSymlinkRead        testRTSymlinkRead
    80 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget);
     80extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead);
    8181
    8282#endif /* __VBSF_TEST_STUBS__H */
  • trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp

    r39607 r39612  
    139139    strcat(pDirEntry->szName, szWildCard);
    140140
    141     rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT);
     141    rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
    142142    *(pszStartComponent-1) = RTPATH_DELIMITER;
    143143    if (RT_FAILURE(rc))
     
    582582static int vbsfConvertFileOpenFlags(unsigned fShflFlags, RTFMODE fMode, SHFLHANDLE handleInitial, uint32_t *pfOpen)
    583583{
    584     uint32_t fOpen = 0;
     584    uint32_t fOpen = RTFILE_O_NO_SYMLINKS;
    585585    int rc = VINF_SUCCESS;
    586586
     
    10111011
    10121012            pParms->Result = SHFL_FILE_CREATED;
    1013             rc = RTDirCreate(pszPath, fMode);
     1013            rc = RTDirCreate(pszPath, fMode, RTDIRCREATE_FLAGS_NO_SYMLINKS);
    10141014            if (RT_FAILURE(rc))
    10151015            {
     
    10311031        {
    10321032            /* Open the directory now */
    1033             rc = RTDirOpen(&pHandle->dir.Handle, pszPath);
     1033            rc = RTDirOpenFiltered(&pHandle->dir.Handle, pszPath,
     1034                                   RTDIRFILTER_NONE, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
    10341035            if (RT_SUCCESS(rc))
    10351036            {
     
    15451546            if (RT_SUCCESS(rc))
    15461547            {
    1547                 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, RTDIRFILTER_WINNT);
     1548                rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath,
     1549                                       RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS);
    15481550
    15491551                /* free the path string */
     
    17281730    if (RT_SUCCESS(rc))
    17291731    {
    1730         rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer);
     1732        rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer, RTSYMLINKREAD_FLAGS_NO_SYMLINKS);
    17311733
    17321734        /* free the path string */
     
    18511853#endif
    18521854
    1853             rc = RTFileSetMode((RTFILE)pHandle->file.Handle, fMode);
     1855            rc = RTFileSetMode(pHandle->file.Handle, fMode);
    18541856            if (rc != VINF_SUCCESS)
    18551857            {
     
    21752177        {
    21762178            if (flags & SHFL_REMOVE_SYMLINK)
    2177                 rc = RTSymlinkDelete(pszFullPath);
    2178             else if (flags & SHFL_REMOVE_FILE)
    2179                 rc = RTFileDelete(pszFullPath);
     2179                rc = RTSymlinkDelete(pszFullPath, RTSYMLINKDELETE_FLAGS_NO_SYMLINKS);
    21802180            else
    2181                 rc = RTDirRemove(pszFullPath);
     2181                rc = RTPathUnlink(pszFullPath, RTPATHUNLINK_FLAGS_NO_SYMLINKS);
    21822182        }
    21832183
     
    22412241            if (flags & SHFL_RENAME_FILE)
    22422242            {
    2243                 rc = RTFileMove(pszFullPathSrc, pszFullPathDest, (flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTFILEMOVE_FLAGS_REPLACE : 0);
     2243                rc = RTFileMove(pszFullPathSrc, pszFullPathDest,
     2244                                  ((flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTFILEMOVE_FLAGS_REPLACE : 0)
     2245                                | RTFILEMOVE_FLAGS_NO_SYMLINKS);
    22442246            }
    22452247            else
    22462248            {
    22472249                /* NT ignores the REPLACE flag and simply return and already exists error. */
    2248                 rc = RTDirRename(pszFullPathSrc, pszFullPathDest, (flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTPATHRENAME_FLAGS_REPLACE : 0);
     2250                rc = RTDirRename(pszFullPathSrc, pszFullPathDest,
     2251                                   ((flags & SHFL_RENAME_REPLACE_IF_EXISTS) ? RTPATHRENAME_FLAGS_REPLACE : 0)
     2252                                 | RTPATHRENAME_FLAGS_NO_SYMLINKS);
    22492253            }
    22502254        }
     
    22862290        return rc;
    22872291
    2288     rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8, RTSYMLINKTYPE_UNKNOWN);
     2292    rc = RTSymlinkCreate(pszFullNewPath, (const char *)pOldPath->String.utf8,
     2293                         RTSYMLINKTYPE_UNKNOWN, RTSYMLINKCREATE_FLAGS_NO_SYMLINKS);
    22892294    if (RT_SUCCESS(rc))
    22902295    {
  • trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp

    r38636 r39612  
    356356    ObjInfo.Attr.fMode &= ~(RTFS_UNIX_IWOTH | RTFS_UNIX_IWGRP);
    357357
    358     rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode);
     358    rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode, 0);
    359359    if (RT_FAILURE(rc))
    360360        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create directory '%s': %Rrc", pszDstDirName, rc);
     
    703703     * If all checks out correctly, rename it to the final directory.
    704704     */
    705     RTDirCreate(pszBaseDir, 0755);
     705    RTDirCreate(pszBaseDir, 0755, 0);
    706706#ifndef RT_OS_WINDOWS
    707707    /*
     
    714714    /** @todo Ownership tricks on windows? */
    715715#endif
    716     rc = RTDirCreate(szTmpPath, 0700);
     716    rc = RTDirCreate(szTmpPath, 0700, 0);
    717717    if (RT_FAILURE(rc))
    718718        return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create temporary directory: %Rrc ('%s')", rc, szTmpPath);
  • trunk/src/VBox/Runtime/generic/RTDirCreateTemp-generic.cpp

    r28800 r39612  
    100100        while (j-- > 0)
    101101            pszX[j] = s_sz[RTRandU32Ex(0, RT_ELEMENTS(s_sz) - 2)];
    102         int rc = RTDirCreate(pszTemplate, 0700);
     102        int rc = RTDirCreate(pszTemplate, 0700, 0);
    103103        if (RT_SUCCESS(rc))
    104104            return rc;
  • trunk/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp

    r36604 r39612  
    5454
    5555    /* First try is to create the path without any numbers. */
    56     int rc = RTDirCreate(pszPath, fMode);
     56    int rc = RTDirCreate(pszPath, fMode, 0);
    5757    if (   RT_SUCCESS(rc)
    5858        || rc != VERR_ALREADY_EXISTS)
     
    8989            return (int)rc2;
    9090        }
    91         rc = RTDirCreate(pszPath, fMode);
     91        rc = RTDirCreate(pszPath, fMode, 0);
    9292        if (RT_SUCCESS(rc))
    9393            return rc;
  • trunk/src/VBox/Runtime/r3/dir.cpp

    r34015 r39612  
    104104         * where the directory exists but we don't have write access to the parent directory.
    105105         */
    106         rc = RTDirCreate(szAbsPath, fMode);
     106        rc = RTDirCreate(szAbsPath, fMode, 0);
    107107        if (rc == VERR_ALREADY_EXISTS)
    108108            rc = VINF_SUCCESS;
     
    674674
    675675
    676 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter)
     676RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fOpen)
    677677{
    678678    /*
  • trunk/src/VBox/Runtime/r3/dir2.cpp

    r34015 r39612  
    116116
    117117                //case RTDIRENTRYTYPE_SYMLINK:
    118                 //    rc = RTSymlinkDelete(pszBuf);
     118                //    rc = RTSymlinkDelete(pszBuf, 0);
    119119                //    break;
    120120
  • trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp

    r39083 r39612  
    7878
    7979
    80 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode)
     80RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate)
    8181{
    8282    int rc;
  • trunk/src/VBox/Runtime/r3/posix/path-posix.cpp

    r36906 r39612  
    523523
    524524
     525RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink)
     526{
     527    return VERR_NOT_IMPLEMENTED;
     528}
     529
     530
    525531RTDECL(bool) RTPathExists(const char *pszPath)
    526532{
  • trunk/src/VBox/Runtime/r3/posix/symlink-posix.cpp

    r33426 r39612  
    9292
    9393
    94 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType)
     94RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType, uint32_t fCreate)
    9595{
    9696    /*
     
    125125    }
    126126
    127     LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d): returns %Rrc\n", pszSymlink, pszSymlink, pszTarget, pszTarget, enmType, rc));
    128     return rc;
    129 }
    130 
    131 
    132 RTDECL(int) RTSymlinkDelete(const char *pszSymlink)
     127    LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d, %#x): returns %Rrc\n", pszSymlink, pszSymlink, pszTarget, pszTarget, enmType, fCreate, rc));
     128    return rc;
     129}
     130
     131
     132RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete)
    133133{
    134134    char const *pszNativeSymlink;
     
    154154    }
    155155
    156     LogFlow(("RTSymlinkDelete(%p={%s}): returns %Rrc\n", pszSymlink, pszSymlink, rc));
    157     return rc;
    158 }
    159 
    160 
    161 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget)
     156    LogFlow(("RTSymlinkDelete(%p={%s}, #%x): returns %Rrc\n", pszSymlink, pszSymlink, fDelete, rc));
     157    return rc;
     158}
     159
     160
     161RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
    162162{
    163163    char *pszMyTarget;
  • trunk/src/VBox/Runtime/r3/win/dir-win.cpp

    r34507 r39612  
    4848
    4949
    50 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode)
     50RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate)
    5151{
    5252    /*
  • trunk/src/VBox/Runtime/r3/win/path-win.cpp

    r36879 r39612  
    579579
    580580
     581RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink)
     582{
     583    return VERR_NOT_IMPLEMENTED;
     584}
     585
     586
    581587RTDECL(bool) RTPathExists(const char *pszPath)
    582588{
  • trunk/src/VBox/Runtime/r3/win/symlink-win.cpp

    r33437 r39612  
    117117
    118118
    119 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType)
     119RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType, uint32_t fCreate)
    120120{
    121121    /*
     
    145145    if (!s_pfnCreateSymbolicLinkW)
    146146    {
    147         LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d): returns VERR_NOT_SUPPORTED - Windows API not found\n",
    148                  pszSymlink, pszSymlink, pszTarget, pszTarget, enmType));
     147        LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d, %#x): returns VERR_NOT_SUPPORTED - Windows API not found\n",
     148                 pszSymlink, pszSymlink, pszTarget, pszTarget, enmType, fCreate));
    149149        return VERR_NOT_SUPPORTED;
    150150    }
     
    216216    }
    217217
    218     LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d): returns %Rrc\n", pszSymlink, pszSymlink, pszTarget, pszTarget, enmType, rc));
     218    LogFlow(("RTSymlinkCreate(%p={%s}, %p={%s}, %d, %#x): returns %Rrc\n", pszSymlink, pszSymlink, pszTarget, pszTarget, enmType, fCreate, rc));
    219219    return rc;
    220220}
    221221
    222222
    223 RTDECL(int) RTSymlinkDelete(const char *pszSymlink)
     223RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete)
    224224{
    225225    /*
     
    259259    }
    260260
    261     LogFlow(("RTSymlinkDelete(%p={%s}): returns %Rrc\n", pszSymlink, pszSymlink, rc));
     261    LogFlow(("RTSymlinkDelete(%p={%s}, %#x): returns %Rrc\n", pszSymlink, pszSymlink, fDelete, rc));
    262262    return rc;
    263263}
    264264
    265265
    266 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget)
     266RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead)
    267267{
    268268    char *pszMyTarget;
  • trunk/src/VBox/Runtime/testcase/tstDir-2.cpp

    r38733 r39612  
    4242        /* open */
    4343        PRTDIR pDir;
    44         int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT);
     44        int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0);
    4545        if (RT_SUCCESS(rc))
    4646        {
  • trunk/src/VBox/Runtime/testcase/tstDir-3.cpp

    r38636 r39612  
    3737    unsigned cFilesMatch = 0;
    3838    PRTDIR pDir;
    39     int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT);
     39    int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0);
    4040    if (RT_SUCCESS(rc))
    4141    {
  • trunk/src/VBox/Runtime/testcase/tstRTSymlink.cpp

    r33806 r39612  
    5151    /* Create it.*/
    5252    RTTESTI_CHECK_RC_OK_RETV(RTPathJoin(szPath1, sizeof(szPath1), pszBaseDir, "tstRTSymlink-link-1"));
    53     RTSymlinkDelete(szPath1); /* clean up previous run */
    54     RTTESTI_CHECK_RC_RETV(RTSymlinkCreate(szPath1, pszTarget, RTSYMLINKTYPE_FILE), VINF_SUCCESS);
     53    RTSymlinkDelete(szPath1, 0); /* clean up previous run */
     54    RTTESTI_CHECK_RC_RETV(RTSymlinkCreate(szPath1, pszTarget, RTSYMLINKTYPE_FILE, 0), VINF_SUCCESS);
    5555
    5656    /* Check the predicate functions. */
     
    6161    memset(szPath2, 0xff, sizeof(szPath2));
    6262    szPath2[sizeof(szPath2) - 1] = '\0';
    63     RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, sizeof(szPath2)), VINF_SUCCESS);
     63    RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, sizeof(szPath2), 0), VINF_SUCCESS);
    6464    RTTESTI_CHECK_MSG(strcmp(szPath2, pszTarget) == 0, ("got=\"%s\" expected=\"%s\"", szPath2, pszTarget));
    6565
    6666    memset(szPath2, 0xff, sizeof(szPath2));
    6767    szPath2[sizeof(szPath2) - 1] = '\0';
    68     RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, cchTarget + 1), VINF_SUCCESS);
     68    RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, cchTarget + 1, 0), VINF_SUCCESS);
    6969    RTTESTI_CHECK_MSG(strcmp(szPath2, pszTarget) == 0, ("got=\"%s\" expected=\"%s\"", szPath2, pszTarget));
    7070
    7171    memset(szPath2, 0xff, sizeof(szPath2));
    7272    szPath2[sizeof(szPath2) - 1] = '\0';
    73     RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, cchTarget), VERR_BUFFER_OVERFLOW);
     73    RTTESTI_CHECK_RC(RTSymlinkRead(szPath1, szPath2, cchTarget, 0), VERR_BUFFER_OVERFLOW);
    7474    RTTESTI_CHECK_MSG(   strncmp(szPath2, pszTarget, cchTarget - 1) == 0
    7575                      && szPath2[cchTarget - 1] == '\0',
     
    109109
    110110    /* Finally, the removal of the symlink. */
    111     RTTESTI_CHECK_RC(RTSymlinkDelete(szPath1), VINF_SUCCESS);
    112     RTTESTI_CHECK_RC(RTSymlinkDelete(szPath1), VERR_FILE_NOT_FOUND);
     111    RTTESTI_CHECK_RC(RTSymlinkDelete(szPath1, 0), VINF_SUCCESS);
     112    RTTESTI_CHECK_RC(RTSymlinkDelete(szPath1, 0), VERR_FILE_NOT_FOUND);
    113113}
    114114
     
    144144    RTTESTI_CHECK(!RTSymlinkIsDangling("/some/non-existing/directory/name/iprt/"));
    145145
    146     RTTESTI_CHECK_RC(RTSymlinkRead(szExecFile, szPath1, sizeof(szPath1)), VERR_NOT_SYMLINK);
    147     RTTESTI_CHECK_RC(RTSymlinkRead(szExecDir,  szPath1, sizeof(szPath1)), VERR_NOT_SYMLINK);
     146    RTTESTI_CHECK_RC(RTSymlinkRead(szExecFile, szPath1, sizeof(szPath1), 0), VERR_NOT_SYMLINK);
     147    RTTESTI_CHECK_RC(RTSymlinkRead(szExecDir,  szPath1, sizeof(szPath1), 0), VERR_NOT_SYMLINK);
    148148
    149149    /*
  • trunk/src/VBox/Storage/VD.cpp

    r39519 r39612  
    31633163    size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX);
    31643164    /* The plugins are in the same directory as the other shared libs. */
    3165     rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT);
     3165    rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0);
    31663166    if (RT_FAILURE(rc))
    31673167    {
     
    32873287    size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX);
    32883288    /* The plugins are in the same directory as the other shared libs. */
    3289     rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT);
     3289    rc = RTDirOpenFiltered(&pPluginDir, pszPluginFilter, RTDIRFILTER_WINNT, 0);
    32903290    if (RT_FAILURE(rc))
    32913291    {
  • trunk/src/VBox/Storage/testcase/tstVD.cpp

    r38636 r39612  
    884884    if (!RTDirExists("tmp"))
    885885    {
    886         rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU);
     886        rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0);
    887887        if (RT_FAILURE(rc))
    888888        {
  • trunk/src/VBox/Storage/testcase/tstVDShareable.cpp

    r38636 r39612  
    131131    if (!RTDirExists("tmp"))
    132132    {
    133         rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU);
     133        rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0);
    134134        if (RT_FAILURE(rc))
    135135        {
  • trunk/src/bldprogs/scm.cpp

    r38636 r39612  
    38183818     */
    38193819    PRTDIR pDir;
    3820     rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE);
     3820    rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE, 0);
    38213821    if (RT_FAILURE(rc))
    38223822    {
  • trunk/src/testcase/tstRunTestcases.cpp

    r38636 r39612  
    171171     */
    172172    PRTDIR pDir;
    173     int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT);
     173    int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0);
    174174    if (RT_SUCCESS(rc))
    175175    {
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