Subject: Re: security/7060: find and rm
To: None <richard.earnshaw@arm.com>
From: Todd C. Miller <Todd.Miller@courtesan.com>
List: netbsd-bugs
Date: 03/01/1999 10:31:48
In message <199903011719.RAA06696@sun52.NIS.cambridge>
	so spake Richard Earnshaw (rearnsha):

> Chdirs should never be down more than one level.  It ought to be possible 
> to compare the inodes of parent after the chdir to ensure nothing unsafe 
> happened.
> 
> If this does work, then the idea could probably be extended to a "safe" 
> -exec which ran the exec'ed program in the chdir'ed directory containing 
> the named file -- this would then lead to a safe(er) way of doing the 
> chmod and other ideas.

I made changes to OpenBSD's find(1) (and fts(3)) to do this a few
years ago.  I called it '-execdir' for exec in the current dir.
For this to be safe fts(3) needs some minor modifications as well,
which NetBSD may or may not already have.

 - todd