Subject: Re: strange directory after 1.4 upgrade
To: None <netbsd-help@netbsd.org>
From: Geoff Wing <mason@primenet.com.au>
List: netbsd-help
Date: 05/31/1999 02:38:42
Frederick Bruckman <fb@enteract.com> typed:
:On Mon, 31 May 1999, Guy Santiglia wrote:
:> After upgrading from 1.3.3 to 1.4,  I noticed a strange file:
:> B?S? ??m?t?qIB\B-]4L#d ?b
:> in my root directory.  It appears to be a directory:  # ls -l /
:> drwxr-xr-x   2 root  wheel      512 May 23 10:07 B?S? ??m?t?qIB\B-]4L#d ?
:> I can't seem to remove it.  "rm -rf " doesn't work.  The characters that
:> I pasted into this email are not the same as the ones shown for the strange file
:> in the root directory.  
:>   How can I remove a file like this?  And where do you think it came from?
:It's appears to be a completely bogus and random entry in the
:directory. The reason you can't delete it is probably because the file
:flags are set. Some of the flags will not even allow the super-user to
:delete the file. The file flags are viewable as the fourth column of
:`ls -lo'. You can only clear them, with "chflgs", from single-user
:mode unless you have "options INSECURE" in your kernel config. Once
:you clear all the (relevant) flags, you'll be able to delete the file.

And if it's not due to flags (e.g. uchg or schg), then you remove it in
the normal fashion.  Either use a shell which can handle that sort of
filename as filename completion (usually TAB), or with
	% rm -rf *S*m*t* 
or whatever is appropriate that won't also match other files/directories
or do a 
	% ls -li /
and take a note of the appropriate inode number in the left column then do
	% find / -inum ..... -exec rm -rf {} \;
	               ^^^^^ inode number
And if it is due to file flags then you can use one of those methods to
remove the flags first, unless you want to be excessive and do a
	% chflags nouchg *
or noschg when single user.

Regards,
-- 
Geoff Wing   <gcw@pobox.com>            Mobile : (Australia) 0413 431 874
Work URL: http://www.primenet.com.au/   Ego URL: http://pobox.com/~gcw/