Two identical filenames in one directory!

John F. Haugh II jfh at rpp386.Dallas.TX.US
Sat Sep 30 01:15:25 AEST 1989


In article <22 at minya.UUCP> jc at minya.UUCP (John Chambers) writes:
>Now we see what happened.  Some gremlin (I almost said daemon ;-) has changed
>the last byte of one entry from 0x00 to 0x1F.  When ls scans the directory, 
>it sees a file called "active", properly null-terminated.  It then tries to
>stat("active",&status), and this fails, because the kernel's namei() routine
>fills it with 8 null bytes, compares all 14 bytes, and they don't match.  This
>also explains why the duplicate active files have all the data but the inode
>numbers the same; they are both listings for the second file.

Crank up fsdb and go find the directory you're interested in.

Begin on the partition containing directory.  fsdb has commands to
print an inode and associated directory blocks in directory format
with inode first and directory name next.  List out the directory
to find the slot you are interested in.

Change the name of the funky "active" entry to something with a 14
character file name.

Exit fsdb and voila.  Instant fixed directory.
-- 
John F. Haugh II                        +-Things you didn't want to know:------
VoiceNet: (512) 832-8832   Data: -8835  | The real meaning of MACH is ...
InterNet: jfh at rpp386.cactus.org         |    ... Messages Are Crufty Hacks.
UUCPNet:  {texbell|bigtex}!rpp386!jfh   +--------------------------------------



More information about the Comp.unix.wizards mailing list