From 2f562f4e49eeaf0188ed8fc41c785e3dcd9e46a5 Mon Sep 17 00:00:00 2001 From: Stelian Pop Date: Sun, 18 Aug 2002 20:52:04 +0000 Subject: [PATCH] Fixed 'undefined file type xxx' warnings in interactive 'ls' --- CHANGES | 7 ++++++- THANKS | 3 ++- dump/traverse.c | 28 +++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ccd47e0..8974512 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.192 2002/08/01 10:23:26 stelian Exp $ +$Id: CHANGES,v 1.193 2002/08/18 20:52:04 stelian Exp $ Changes between versions 0.4b31 and 0.4b32 (released ?????????????) =================================================================== @@ -12,6 +12,11 @@ Changes between versions 0.4b31 and 0.4b32 (released ?????????????) Thanks to Richard Johnson for reporting the bug (originally a bugtraq post). +2. Fixed interactive 'ls' which caused spurious errors warnings + about 'undefined filetypes' detected. Thanks to Jorgen Ostling + for reporting this + bug. + Changes between versions 0.4b30 and 0.4b31 (released July 30, 2002) =================================================================== diff --git a/THANKS b/THANKS index bf912f3..24883ac 100644 --- a/THANKS +++ b/THANKS @@ -1,4 +1,4 @@ -$Id: THANKS,v 1.65 2002/08/01 10:23:26 stelian Exp $ +$Id: THANKS,v 1.66 2002/08/18 20:52:04 stelian Exp $ Dump and restore were written by the people of the CSRG at the University of California, Berkeley. @@ -73,6 +73,7 @@ Dejan Muhamedagic dejan@quant-x.com Lukas Nellen L.Nellen@ThPhys.Uni-Heidelberg.DE Nuno Oliveira nuno@eq.uc.pt Brent Olson night@halcyon.com +Jorgen Ostling jorgen_ostling@users.sourceforge.net Jerry Peters gapeters@worldnet.att.net David B. Peterson dave@toppledwagon.com Dave Platt dplatt@snulbug.mtview.ca.us diff --git a/dump/traverse.c b/dump/traverse.c index 6d4f00b..116d4f3 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.49 2002/07/19 14:57:39 stelian Exp $"; + "$Id: traverse.c,v 1.50 2002/08/18 20:52:05 stelian Exp $"; #endif /* not lint */ #include @@ -983,6 +983,32 @@ convert_dir(struct ext2_dir_entry *dirent, UNUSED(int offset), dp->d_ino = dirent->inode; dp->d_reclen = reclen; dp->d_namlen = dirent->name_len & 0xFF; + switch ((dirent->name_len & 0xFF00) >> 8) { + default: + dp->d_type = DT_UNKNOWN; + break; + case EXT2_FT_REG_FILE: + dp->d_type = DT_REG; + break; + case EXT2_FT_DIR: + dp->d_type = DT_DIR; + break; + case EXT2_FT_CHRDEV: + dp->d_type = DT_CHR; + break; + case EXT2_FT_BLKDEV: + dp->d_type = DT_BLK; + break; + case EXT2_FT_FIFO: + dp->d_type = DT_FIFO; + break; + case EXT2_FT_SOCK: + dp->d_type = DT_SOCK; + break; + case EXT2_FT_SYMLINK: + dp->d_type = DT_LNK; + break; + } strncpy(dp->d_name, dirent->name, dp->d_namlen); dp->d_name[dp->d_namlen] = '\0'; p->prev_offset = p->offset; -- 2.39.5