an rm question

news software news at edm.UUCP
Sat Apr 30 15:47:42 AEST 1988


>From article <1080 at mcgill-vision.UUCP>, by mouse at mcgill-vision.UUCP (der Mouse):
> In article <142700029 at occrsh.ATT.COM>, rjd at occrsh.ATT.COM writes:
>> Does anyone have a program similar to "rm" that will remove a file
>> based on filessystem and inode number?  (AT&T System 5 release 2 or
>> above...)
> 
If you are the super-user (or at least have read access to the filesystem,
then use ncheck(1 or 8). 

if /dev/rdsk0 were mounted as /usr2 then something along the lines of:
  for i over `ncheck -i 4432 /dev/rdsk0 ` 
  do
    rm -f /usr2/$i
  done

would remove all copies of inode 4432 from /usr2 .
(I assume that there is a way to map file numbers to /dev names, but
I'm too tired to figure that out right now).

  This is much cleaner than killing the inode and doing an fsck..
among other things:
1) you don't need to unmount the drive and
2) you don't need su privledges (OTHER THAN READ ACCESS TO THE SLICE). 
 
  I consider having public read access to a disk slice a security hole,
since it implies that anybody who really wants to can read any file
on the slice. (just decode the file system)

-- 
-------------
 Stephen Samuel 
  {ihnp4,ubc-vision,vax135}!alberta!edm!steve
  or userzxcv at uqv-mts.bitnet



More information about the Comp.unix.wizards mailing list