unlink(inode)? or how to remove file with '/' in its name

Bernd Felsche bernie at DIALix.oz.au
Sat Nov 17 17:32:37 AEST 1990


In <1990Oct21.112102.1478 at hq.demos.su>
	avg at hq.demos.su (Vadim G. Antonov) writes:

>Hm. What are you talkin' about? The fastest and simpliest way to
>get rid of this weird file is to open your FM at the page describing
>file systems structure and enter:

>	adb -w /dev/dskNNN
	^^^^^^^
Who's still got adb?  I used fsdb for much the same thing.

>Find the directory entry on the disk, write something valid instead of /,
>mount disk and remove it with vanilla rm. Of course it is not a task for
>Pascal programmers. ;-)

Heck, I could write a setuid program to do it!

(Very sleazy indeed, as it would fetch the inode and filesystem 
info for the directory to fsdb via a pipe: because I'm too lazy 
to write a subset of fsdb myself.)

You _don't_ even have to umount the filesystem, because the only 
change you are making is to the filename, which can't be de-referenced 
anyway (almost said "unlinked" :-)), until you rewrite the 
directory block.

On second thought, Pascal programmers should stick to paper... :-)
-- 
 ________Bernd_Felsche__________bernie at DIALix.oz.au_____________
[ Phone: +61 9 419 2297		19 Coleman Road			]
[ TZ:	 UTC-8			Calista, Western Australia 6167	]



More information about the Comp.unix.questions mailing list