Changeset 39612 in vbox
- Timestamp:
- Dec 14, 2011 2:19:55 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 30 edited
-
include/iprt/dir.h (modified) (4 diffs)
-
include/iprt/file.h (modified) (3 diffs)
-
include/iprt/mangling.h (modified) (1 diff)
-
include/iprt/path.h (modified) (2 diffs)
-
include/iprt/symlink.h (modified) (4 diffs)
-
src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp (modified) (3 diffs)
-
src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp (modified) (1 diff)
-
src/VBox/Debugger/DBGCCommands.cpp (modified) (1 diff)
-
src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp (modified) (2 diffs)
-
src/VBox/HostServices/SharedFolders/teststubs.h (modified) (2 diffs)
-
src/VBox/HostServices/SharedFolders/vbsf.cpp (modified) (10 diffs)
-
src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp (modified) (3 diffs)
-
src/VBox/Runtime/generic/RTDirCreateTemp-generic.cpp (modified) (1 diff)
-
src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp (modified) (2 diffs)
-
src/VBox/Runtime/r3/dir.cpp (modified) (2 diffs)
-
src/VBox/Runtime/r3/dir2.cpp (modified) (1 diff)
-
src/VBox/Runtime/r3/posix/dir-posix.cpp (modified) (1 diff)
-
src/VBox/Runtime/r3/posix/path-posix.cpp (modified) (1 diff)
-
src/VBox/Runtime/r3/posix/symlink-posix.cpp (modified) (3 diffs)
-
src/VBox/Runtime/r3/win/dir-win.cpp (modified) (1 diff)
-
src/VBox/Runtime/r3/win/path-win.cpp (modified) (1 diff)
-
src/VBox/Runtime/r3/win/symlink-win.cpp (modified) (4 diffs)
-
src/VBox/Runtime/testcase/tstDir-2.cpp (modified) (1 diff)
-
src/VBox/Runtime/testcase/tstDir-3.cpp (modified) (1 diff)
-
src/VBox/Runtime/testcase/tstRTSymlink.cpp (modified) (4 diffs)
-
src/VBox/Storage/VD.cpp (modified) (2 diffs)
-
src/VBox/Storage/testcase/tstVD.cpp (modified) (1 diff)
-
src/VBox/Storage/testcase/tstVDShareable.cpp (modified) (1 diff)
-
src/bldprogs/scm.cpp (modified) (1 diff)
-
src/testcase/tstRunTestcases.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/dir.h
r36579 r39612 51 51 RTDECL(bool) RTDirExists(const char *pszPath); 52 52 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 53 59 /** 54 60 * Creates a directory. … … 57 63 * @param pszPath Path to the directory to create. 58 64 * @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 */ 67 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate); 61 68 62 69 /** … … 295 302 RTDECL(int) RTDirOpen(PRTDIR *ppDir, const char *pszPath); 296 303 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 297 310 /** 298 311 * Opens a directory filtering the entries using dos style wildcards. … … 303 316 * @param enmFilter The kind of filter to apply. Setting this to RTDIRFILTER_NONE makes 304 317 * 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 */ 320 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fOpen); 307 321 308 322 /** -
trunk/include/iprt/file.h
r39195 r39612 213 213 #define RTFILE_O_NO_CACHE UINT32_C(0x00080000) 214 214 215 /** Don't allow symbolic links as part of the path. */ 216 #define RTFILE_O_NO_SYMLINKS UINT32_C(0x20000000) 217 215 218 /** Unix file mode mask for use when creating files. */ 216 219 #define RTFILE_O_CREATE_MODE_MASK UINT32_C(0x1ff00000) … … 220 223 #define RTFILE_O_CREATE_MODE_SHIFT 20 221 224 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. */ 225 227 226 228 /** Mask of all valid flags. 227 229 * @remark This doesn't validate the access mode properly. 228 230 */ 229 #define RTFILE_O_VALID_MASK UINT32_C(0x 1ffffff7)231 #define RTFILE_O_VALID_MASK UINT32_C(0x3ffffff7) 230 232 231 233 /** @} */ … … 562 564 * @{ */ 563 565 /** 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 565 569 /** @} */ 566 570 -
trunk/include/iprt/mangling.h
r39550 r39612 909 909 # define RTPathTemp RT_MANGLER(RTPathTemp) 910 910 # define RTPathTraverseList RT_MANGLER(RTPathTraverseList) 911 # define RTPathUnlink RT_MANGLER(RTPathUnlink) 911 912 # define RTPathUserDocuments RT_MANGLER(RTPathUserDocuments) 912 913 # define RTPathUserHome RT_MANGLER(RTPathUserHome) -
trunk/include/iprt/path.h
r36611 r39612 892 892 /** This will replace attempt any target which isn't a directory. */ 893 893 #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) 894 896 /** @} */ 895 897 … … 907 909 RTR3DECL(int) RTPathRename(const char *pszSrc, const char *pszDst, unsigned fRename); 908 910 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 */ 924 RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink); 925 909 926 #endif /* IN_RING3 */ 910 927 -
trunk/include/iprt/symlink.h
r33676 r39612 86 86 } RTSYMLINKTYPE; 87 87 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 88 94 /** 89 95 * Creates a symbolic link (@a pszSymlink) targeting @a pszTarget. … … 99 105 * make a guess and may attempt query information 100 106 * about @a pszTarget in the process. 107 * @param fCreate Create flags, RTSYMLINKCREATE_FLAGS_*. 101 108 */ 102 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType); 109 RTDECL(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 /** @} */ 103 117 104 118 /** … … 112 126 * 113 127 * @param pszSymlink The symbolic link that should be removed. 128 * @param fDelete Delete flags, RTSYMLINKDELETE_FLAGS_*. 114 129 */ 115 RTDECL(int) RTSymlinkDelete(const char *pszSymlink); 130 RTDECL(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 /** @} */ 116 137 117 138 /** … … 127 148 * @param pszTarget The target buffer. 128 149 * @param cbTarget The size of the target buffer. 150 * @param fRead Read flags, RTSYMLINKREAD_FLAGS_*. 129 151 */ 130 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget );152 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead); 131 153 132 154 /** -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceCpuHotPlug.cpp
r33468 r39612 161 161 if (pszPathTmp) 162 162 { 163 rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT );163 rc = RTDirOpenFiltered(&pDirCurr, pszPathTmp, RTDIRFILTER_WINNT, 0); 164 164 RTStrFree(pszPathTmp); 165 165 } … … 248 248 249 249 /* Open the directory */ 250 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT );250 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPath, RTDIRFILTER_WINNT, 0); 251 251 if (RT_SUCCESS(rc)) 252 252 { … … 319 319 320 320 /* Open the directory */ 321 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT );321 rc = RTDirOpenFiltered(&pAcpiCpuPathLvl->pDir, pszPathDir, RTDIRFILTER_WINNT, 0); 322 322 if (RT_FAILURE(rc)) 323 323 break; -
trunk/src/VBox/Additions/common/VBoxService/VBoxServiceToolBox.cpp
r39515 r39612 989 989 rc = RTDirCreateFullPath(ValueUnion.psz, fDirMode); 990 990 else 991 rc = RTDirCreate(ValueUnion.psz, fDirMode );991 rc = RTDirCreate(ValueUnion.psz, fDirMode, 0); 992 992 if (RT_FAILURE(rc)) 993 993 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Could not create directory '%s': %Rra\n", -
trunk/src/VBox/Debugger/DBGCCommands.cpp
r38838 r39612 1875 1875 1876 1876 PRTDIR pDir; 1877 rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT );1877 rc = RTDirOpenFiltered(&pDir, szPath, RTDIRFILTER_WINNT, 0); 1878 1878 if (RT_SUCCESS(rc)) 1879 1879 { -
trunk/src/VBox/HostServices/SharedFolders/testcase/tstSharedFolderService.cpp
r39543 r39612 125 125 static RTFMODE testRTDirCreateMode; 126 126 127 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode )127 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate) 128 128 { 129 129 /* RTPrintf("%s: pszPath=%s, fMode=0x%llx\n", __PRETTY_FUNCTION__, pszPath, … … 389 389 } 390 390 391 extern int testRTSymlinkDelete(const char *pszSymlink) { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 391 extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete) 392 { RTPrintf("%s\n", __PRETTY_FUNCTION__); return 0; } 392 393 extern 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; } 394 396 395 397 /****************************************************************************** -
trunk/src/VBox/HostServices/SharedFolders/teststubs.h
r39542 r39612 30 30 extern int testRTDirClose(PRTDIR pDir); 31 31 #define RTDirCreate testRTDirCreate 32 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode );32 extern int testRTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate); 33 33 #define RTDirOpen testRTDirOpen 34 34 extern int testRTDirOpen(PRTDIR *ppDir, const char *pszPath); … … 76 76 extern int testRTPathQueryInfoEx(const char *pszPath, PRTFSOBJINFO pObjInfo, RTFSOBJATTRADD enmAdditionalAttribs, uint32_t fFlags); 77 77 #define RTSymlinkDelete testRTSymlinkDelete 78 extern int testRTSymlinkDelete(const char *pszSymlink );78 extern int testRTSymlinkDelete(const char *pszSymlink, uint32_t fDelete); 79 79 #define RTSymlinkRead testRTSymlinkRead 80 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget );80 extern int testRTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead); 81 81 82 82 #endif /* __VBSF_TEST_STUBS__H */ -
trunk/src/VBox/HostServices/SharedFolders/vbsf.cpp
r39607 r39612 139 139 strcat(pDirEntry->szName, szWildCard); 140 140 141 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT );141 rc = RTDirOpenFiltered(&hSearch, pDirEntry->szName, RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS); 142 142 *(pszStartComponent-1) = RTPATH_DELIMITER; 143 143 if (RT_FAILURE(rc)) … … 582 582 static int vbsfConvertFileOpenFlags(unsigned fShflFlags, RTFMODE fMode, SHFLHANDLE handleInitial, uint32_t *pfOpen) 583 583 { 584 uint32_t fOpen = 0;584 uint32_t fOpen = RTFILE_O_NO_SYMLINKS; 585 585 int rc = VINF_SUCCESS; 586 586 … … 1011 1011 1012 1012 pParms->Result = SHFL_FILE_CREATED; 1013 rc = RTDirCreate(pszPath, fMode );1013 rc = RTDirCreate(pszPath, fMode, RTDIRCREATE_FLAGS_NO_SYMLINKS); 1014 1014 if (RT_FAILURE(rc)) 1015 1015 { … … 1031 1031 { 1032 1032 /* 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); 1034 1035 if (RT_SUCCESS(rc)) 1035 1036 { … … 1545 1546 if (RT_SUCCESS(rc)) 1546 1547 { 1547 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, RTDIRFILTER_WINNT); 1548 rc = RTDirOpenFiltered(&pHandle->dir.SearchHandle, pszFullPath, 1549 RTDIRFILTER_WINNT, RTDIROPENFILTERED_FLAGS_NO_SYMLINKS); 1548 1550 1549 1551 /* free the path string */ … … 1728 1730 if (RT_SUCCESS(rc)) 1729 1731 { 1730 rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer );1732 rc = RTSymlinkRead(pszFullPath, (char *) pBuffer, cbBuffer, RTSYMLINKREAD_FLAGS_NO_SYMLINKS); 1731 1733 1732 1734 /* free the path string */ … … 1851 1853 #endif 1852 1854 1853 rc = RTFileSetMode( (RTFILE)pHandle->file.Handle, fMode);1855 rc = RTFileSetMode(pHandle->file.Handle, fMode); 1854 1856 if (rc != VINF_SUCCESS) 1855 1857 { … … 2175 2177 { 2176 2178 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); 2180 2180 else 2181 rc = RT DirRemove(pszFullPath);2181 rc = RTPathUnlink(pszFullPath, RTPATHUNLINK_FLAGS_NO_SYMLINKS); 2182 2182 } 2183 2183 … … 2241 2241 if (flags & SHFL_RENAME_FILE) 2242 2242 { 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); 2244 2246 } 2245 2247 else 2246 2248 { 2247 2249 /* 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); 2249 2253 } 2250 2254 } … … 2286 2290 return rc; 2287 2291 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); 2289 2294 if (RT_SUCCESS(rc)) 2290 2295 { -
trunk/src/VBox/Main/src-helper-apps/VBoxExtPackHelperApp.cpp
r38636 r39612 356 356 ObjInfo.Attr.fMode &= ~(RTFS_UNIX_IWOTH | RTFS_UNIX_IWGRP); 357 357 358 rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode );358 rc = RTDirCreate(pszDstDirName, ObjInfo.Attr.fMode, 0); 359 359 if (RT_FAILURE(rc)) 360 360 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create directory '%s': %Rrc", pszDstDirName, rc); … … 703 703 * If all checks out correctly, rename it to the final directory. 704 704 */ 705 RTDirCreate(pszBaseDir, 0755 );705 RTDirCreate(pszBaseDir, 0755, 0); 706 706 #ifndef RT_OS_WINDOWS 707 707 /* … … 714 714 /** @todo Ownership tricks on windows? */ 715 715 #endif 716 rc = RTDirCreate(szTmpPath, 0700 );716 rc = RTDirCreate(szTmpPath, 0700, 0); 717 717 if (RT_FAILURE(rc)) 718 718 return RTMsgErrorExit(RTEXITCODE_FAILURE, "Failed to create temporary directory: %Rrc ('%s')", rc, szTmpPath); -
trunk/src/VBox/Runtime/generic/RTDirCreateTemp-generic.cpp
r28800 r39612 100 100 while (j-- > 0) 101 101 pszX[j] = s_sz[RTRandU32Ex(0, RT_ELEMENTS(s_sz) - 2)]; 102 int rc = RTDirCreate(pszTemplate, 0700 );102 int rc = RTDirCreate(pszTemplate, 0700, 0); 103 103 if (RT_SUCCESS(rc)) 104 104 return rc; -
trunk/src/VBox/Runtime/generic/RTDirCreateUniqueNumbered-generic.cpp
r36604 r39612 54 54 55 55 /* First try is to create the path without any numbers. */ 56 int rc = RTDirCreate(pszPath, fMode );56 int rc = RTDirCreate(pszPath, fMode, 0); 57 57 if ( RT_SUCCESS(rc) 58 58 || rc != VERR_ALREADY_EXISTS) … … 89 89 return (int)rc2; 90 90 } 91 rc = RTDirCreate(pszPath, fMode );91 rc = RTDirCreate(pszPath, fMode, 0); 92 92 if (RT_SUCCESS(rc)) 93 93 return rc; -
trunk/src/VBox/Runtime/r3/dir.cpp
r34015 r39612 104 104 * where the directory exists but we don't have write access to the parent directory. 105 105 */ 106 rc = RTDirCreate(szAbsPath, fMode );106 rc = RTDirCreate(szAbsPath, fMode, 0); 107 107 if (rc == VERR_ALREADY_EXISTS) 108 108 rc = VINF_SUCCESS; … … 674 674 675 675 676 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter )676 RTDECL(int) RTDirOpenFiltered(PRTDIR *ppDir, const char *pszPath, RTDIRFILTER enmFilter, uint32_t fOpen) 677 677 { 678 678 /* -
trunk/src/VBox/Runtime/r3/dir2.cpp
r34015 r39612 116 116 117 117 //case RTDIRENTRYTYPE_SYMLINK: 118 // rc = RTSymlinkDelete(pszBuf );118 // rc = RTSymlinkDelete(pszBuf, 0); 119 119 // break; 120 120 -
trunk/src/VBox/Runtime/r3/posix/dir-posix.cpp
r39083 r39612 78 78 79 79 80 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode )80 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate) 81 81 { 82 82 int rc; -
trunk/src/VBox/Runtime/r3/posix/path-posix.cpp
r36906 r39612 523 523 524 524 525 RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink) 526 { 527 return VERR_NOT_IMPLEMENTED; 528 } 529 530 525 531 RTDECL(bool) RTPathExists(const char *pszPath) 526 532 { -
trunk/src/VBox/Runtime/r3/posix/symlink-posix.cpp
r33426 r39612 92 92 93 93 94 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType )94 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType, uint32_t fCreate) 95 95 { 96 96 /* … … 125 125 } 126 126 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 132 RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete) 133 133 { 134 134 char const *pszNativeSymlink; … … 154 154 } 155 155 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 161 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead) 162 162 { 163 163 char *pszMyTarget; -
trunk/src/VBox/Runtime/r3/win/dir-win.cpp
r34507 r39612 48 48 49 49 50 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode )50 RTDECL(int) RTDirCreate(const char *pszPath, RTFMODE fMode, uint32_t fCreate) 51 51 { 52 52 /* -
trunk/src/VBox/Runtime/r3/win/path-win.cpp
r36879 r39612 579 579 580 580 581 RTR3DECL(int) RTPathUnlink(const char *pszPath, uint32_t fUnlink) 582 { 583 return VERR_NOT_IMPLEMENTED; 584 } 585 586 581 587 RTDECL(bool) RTPathExists(const char *pszPath) 582 588 { -
trunk/src/VBox/Runtime/r3/win/symlink-win.cpp
r33437 r39612 117 117 118 118 119 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType )119 RTDECL(int) RTSymlinkCreate(const char *pszSymlink, const char *pszTarget, RTSYMLINKTYPE enmType, uint32_t fCreate) 120 120 { 121 121 /* … … 145 145 if (!s_pfnCreateSymbolicLinkW) 146 146 { 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)); 149 149 return VERR_NOT_SUPPORTED; 150 150 } … … 216 216 } 217 217 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)); 219 219 return rc; 220 220 } 221 221 222 222 223 RTDECL(int) RTSymlinkDelete(const char *pszSymlink )223 RTDECL(int) RTSymlinkDelete(const char *pszSymlink, uint32_t fDelete) 224 224 { 225 225 /* … … 259 259 } 260 260 261 LogFlow(("RTSymlinkDelete(%p={%s} ): returns %Rrc\n", pszSymlink, pszSymlink, rc));261 LogFlow(("RTSymlinkDelete(%p={%s}, %#x): returns %Rrc\n", pszSymlink, pszSymlink, fDelete, rc)); 262 262 return rc; 263 263 } 264 264 265 265 266 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget )266 RTDECL(int) RTSymlinkRead(const char *pszSymlink, char *pszTarget, size_t cbTarget, uint32_t fRead) 267 267 { 268 268 char *pszMyTarget; -
trunk/src/VBox/Runtime/testcase/tstDir-2.cpp
r38733 r39612 42 42 /* open */ 43 43 PRTDIR pDir; 44 int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT );44 int rc = RTDirOpenFiltered(&pDir, argv[i], RTDIRFILTER_WINNT, 0); 45 45 if (RT_SUCCESS(rc)) 46 46 { -
trunk/src/VBox/Runtime/testcase/tstDir-3.cpp
r38636 r39612 37 37 unsigned cFilesMatch = 0; 38 38 PRTDIR pDir; 39 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT );39 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0); 40 40 if (RT_SUCCESS(rc)) 41 41 { -
trunk/src/VBox/Runtime/testcase/tstRTSymlink.cpp
r33806 r39612 51 51 /* Create it.*/ 52 52 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); 55 55 56 56 /* Check the predicate functions. */ … … 61 61 memset(szPath2, 0xff, sizeof(szPath2)); 62 62 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); 64 64 RTTESTI_CHECK_MSG(strcmp(szPath2, pszTarget) == 0, ("got=\"%s\" expected=\"%s\"", szPath2, pszTarget)); 65 65 66 66 memset(szPath2, 0xff, sizeof(szPath2)); 67 67 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); 69 69 RTTESTI_CHECK_MSG(strcmp(szPath2, pszTarget) == 0, ("got=\"%s\" expected=\"%s\"", szPath2, pszTarget)); 70 70 71 71 memset(szPath2, 0xff, sizeof(szPath2)); 72 72 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); 74 74 RTTESTI_CHECK_MSG( strncmp(szPath2, pszTarget, cchTarget - 1) == 0 75 75 && szPath2[cchTarget - 1] == '\0', … … 109 109 110 110 /* 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); 113 113 } 114 114 … … 144 144 RTTESTI_CHECK(!RTSymlinkIsDangling("/some/non-existing/directory/name/iprt/")); 145 145 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); 148 148 149 149 /* -
trunk/src/VBox/Storage/VD.cpp
r39519 r39612 3163 3163 size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX); 3164 3164 /* 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); 3166 3166 if (RT_FAILURE(rc)) 3167 3167 { … … 3287 3287 size_t cbPluginDirEntry = sizeof(RTDIRENTRYEX); 3288 3288 /* 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); 3290 3290 if (RT_FAILURE(rc)) 3291 3291 { -
trunk/src/VBox/Storage/testcase/tstVD.cpp
r38636 r39612 884 884 if (!RTDirExists("tmp")) 885 885 { 886 rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU );886 rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0); 887 887 if (RT_FAILURE(rc)) 888 888 { -
trunk/src/VBox/Storage/testcase/tstVDShareable.cpp
r38636 r39612 131 131 if (!RTDirExists("tmp")) 132 132 { 133 rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU );133 rc = RTDirCreate("tmp", RTFS_UNIX_IRWXU, 0); 134 134 if (RT_FAILURE(rc)) 135 135 { -
trunk/src/bldprogs/scm.cpp
r38636 r39612 3818 3818 */ 3819 3819 PRTDIR pDir; 3820 rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE );3820 rc = RTDirOpenFiltered(&pDir, pszBuf, RTDIRFILTER_NONE, 0); 3821 3821 if (RT_FAILURE(rc)) 3822 3822 { -
trunk/src/testcase/tstRunTestcases.cpp
r38636 r39612 171 171 */ 172 172 PRTDIR pDir; 173 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT );173 int rc = RTDirOpenFiltered(&pDir, pszFilter, RTDIRFILTER_WINNT, 0); 174 174 if (RT_SUCCESS(rc)) 175 175 {
Note:
See TracChangeset
for help on using the changeset viewer.

