Confused file name in directory

kww at cbosgd.UUCP kww at cbosgd.UUCP
Mon Mar 2 09:05:23 AEST 1987


In article <563 at aw.sei.cmu.edu.sei.cmu.edu> pdb at sei.cmu.edu (Patrick Barron) writes:
>
>As a last resort you could use 'clri' on the inode associated with that
>file (use 'ls -li' to find the inode numner).  fsck will certainly allow
>you to clear the directory entry once it realizes the inode's been zeroed.
>
>--Pat.


This was in response to renaming a directory that had an embbeded null
character in it, something like "D\0c" I believe.

What about using 'fsdb' (file system debugger) and run it on the raw
file system.  All you need to do is find the directory block of the
parent directory, and then find the "D\oc" entry and change it to "Doc".
With fsdb(1M) it is not too hard since it sorta understands UNIX file
systems.  If you don't have fsdb (e.g., like BSD systems maybe), adb(1)
will also do the trick when run on the raw device corresponding to the
file system, although with 'adb', you will have to compute disk offsets,
etc. yourself.

Oh yeah, to be on the safe side, run /etc/umount on the file system
BEFORE you start to ``play''.  (Especially if you have to use adb.)
Of course if its on root device, you can't do this, but then you ought
to do it in single user mode, after having sync(1M)'ed it a few times
to make sure everything has been flushed to the disk.  Its really not as
hard as you think it might be, especially if you have fsdb available.

Of course, all this discussion presumes that you have SU priviledges,
or writtable special files (E-gad!, talk about security holes!)

Good luck!



More information about the Comp.unix.xenix mailing list