From 7cbe6176ad1c9895c7acc89e8602f48842d021e8 Mon Sep 17 00:00:00 2001 From: Brian Palmer Date: Thu, 8 Aug 2002 04:46:46 +0000 Subject: [PATCH] Defined FAST_SYMLINK_MAX_NAME_SIZE svn path=/trunk/; revision=3322 --- freeldr/freeldr/fs/ext2.c | 6 +++--- freeldr/freeldr/fs/ext2.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/freeldr/freeldr/fs/ext2.c b/freeldr/freeldr/fs/ext2.c index d7e81682f27..f32fef6ed40 100644 --- a/freeldr/freeldr/fs/ext2.c +++ b/freeldr/freeldr/fs/ext2.c @@ -267,7 +267,7 @@ BOOL Ext2LookupFile(PUCHAR FileName, PEXT2_FILE_INFO Ext2FileInfoPointer) // then get the block pointer list otherwise it must // be a fast symbolic link which doesn't have a block list if (((InodeData.i_mode & EXT2_S_IFMT) == EXT2_S_IFREG) || - ((InodeData.i_mode & EXT2_S_IFMT) == EXT2_S_IFLNK && InodeData.i_size > 60)) + ((InodeData.i_mode & EXT2_S_IFMT) == EXT2_S_IFLNK && InodeData.i_size > FAST_SYMLINK_MAX_NAME_SIZE)) { Ext2FileInfoPointer->FileBlockList = Ext2ReadBlockPointerList(&InodeData); @@ -366,7 +366,7 @@ BOOL Ext2ReadFile(FILE *FileHandle, U64 BytesToRead, U64* BytesRead, PVOID Buffe // Block pointer list is NULL // so this better be a fast symbolic link or else if (((Ext2FileInfo->Inode.i_mode & EXT2_S_IFMT) != EXT2_S_IFLNK) || - (Ext2FileInfo->FileSize > 60)) + (Ext2FileInfo->FileSize > FAST_SYMLINK_MAX_NAME_SIZE)) { FileSystemError("Block pointer list is NULL and file is not a fast symbolic link."); return FALSE; @@ -395,7 +395,7 @@ BOOL Ext2ReadFile(FILE *FileHandle, U64 BytesToRead, U64* BytesRead, PVOID Buffe // Check if this is a fast symbolic link // if so then the read is easy if (((Ext2FileInfo->Inode.i_mode & EXT2_S_IFMT) == EXT2_S_IFLNK) && - (Ext2FileInfo->FileSize <= 60)) + (Ext2FileInfo->FileSize <= FAST_SYMLINK_MAX_NAME_SIZE)) { DbgPrint((DPRINT_FILESYSTEM, "Reading fast symbolic link data\n")); diff --git a/freeldr/freeldr/fs/ext2.h b/freeldr/freeldr/fs/ext2.h index c4064159ce9..936958a1445 100644 --- a/freeldr/freeldr/fs/ext2.h +++ b/freeldr/freeldr/fs/ext2.h @@ -653,6 +653,8 @@ typedef struct ext3_dir_entry_2 EXT2_DIR_ENTRY, *PEXT2_DIR_ENTRY; #define EXT2_S_IFLNK 0xA000 // Symbolic link #define EXT2_S_IFSOCK 0xC000 // Socket +#define FAST_SYMLINK_MAX_NAME_SIZE 60 + typedef struct { U64 FileSize; // File size