Changeset 2543 for branches/libc-0.6
- Timestamp:
- Feb 7, 2006, 4:10:33 AM (20 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/ChangeLog.LIBC
r2539 r2543 5 5 2006-02-06: knut st. osmundsen <bird-gccos2-spam@anduin.net> 6 6 - libc: 7 o #52: Fixed two 'symlink/' problems in the path resolver. 8 o #51: Made unlink able to delete readonly files. 7 9 o #50: Inherit umask. 8 10 o #30: Committed forgotten header. -
branches/libc-0.6/src/emx/src/lib/sys/fs.c
r2538 r2543 499 499 } 500 500 501 502 /** 503 * Checks if the specified path is a symlink or not. 504 * @returns true / false. 505 * @param pszNativePath Path to the potential symlink. 506 */ 507 static int fsIsSymlink(const char *pszNativePath) 508 { 509 char sz[16]; 510 return __libc_back_fsNativeSymlinkRead(pszNativePath, sz, sizeof(sz)) >= 0; 511 } 512 513 501 514 #if 0 //just testing, not useful. 502 515 /** … … 622 635 /* 623 636 * Remove trailing slash if the path may be pointing to a directory. 637 * A symlink search is converted to a directory search if this is encountered. 624 638 */ 625 639 int cch = pszTrg - pszPath; 626 if ( (fFlags & BACKFS_FLAGS_RESOLVE_DIR)640 if ( (fFlags & (BACKFS_FLAGS_RESOLVE_DIR | BACKFS_FLAGS_RESOLVE_FULL_SYMLINK)) 627 641 && cch > 1 628 642 && pszTrg[-1] == '/' … … 632 646 pszPath[--cch] = '\0'; 633 647 if (pfFlags) 634 *pfFlags &= ~BACKFS_FLAGS_RESOLVE_DIR_MAYBE_; 648 { 649 *pfFlags &= ~(BACKFS_FLAGS_RESOLVE_DIR_MAYBE_ | BACKFS_FLAGS_RESOLVE_FULL_SYMLINK); 650 if (fFlags & BACKFS_FLAGS_RESOLVE_FULL_SYMLINK) 651 *pfFlags |= BACKFS_FLAGS_RESOLVE_DIR | BACKFS_FLAGS_RESOLVE_FULL; 652 } 635 653 } 636 654 … … 1086 1104 && ( (fFlags & BACKFS_FLAGS_RESOLVE_FULL) 1087 1105 || chSlash) 1088 && ! (pFindBuf4->attrFile & FILE_DIRECTORY))1106 && !fIsDirectory) 1089 1107 { 1090 1108 PEAOP2 pEaOp2 = (PEAOP2)pachBuffer; … … 1229 1247 rcRet = 0; 1230 1248 if ( (fFlags & (BACKFS_FLAGS_RESOLVE_DIR | BACKFS_FLAGS_RESOLVE_DIR_MAYBE_)) == BACKFS_FLAGS_RESOLVE_DIR 1231 && !fIsDirectory) 1249 && !fIsDirectory 1250 && ( !fUnixEAs 1251 || pFindBuf4->cbList <= sizeof(USHORT) * 2 + 1 1252 || !fsIsSymlink(pszNativePath))) 1232 1253 rcRet = -ENOTDIR; 1233 1254 break;
Note:
See TracChangeset
for help on using the changeset viewer.