Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 09 Apr 2004 08:47:07 +0200
From:      Uwe Doering <gemini@geminix.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: changing directory permissions recursively
Message-ID:  <407646EB.7020708@geminix.org>
In-Reply-To: <20040409055515.GA50737@alexis.mi.celestial.com>
References:  <000501c41df5$519419f0$0200a8c0@satellite> <20040409055515.GA50737@alexis.mi.celestial.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Bill Campbell wrote:
> On Fri, Apr 09, 2004, dave wrote:
> 
>>Hello,
>>   I've got a problem, a directory area has the wrong permissions, occurred
> 
>>from a dump restore. Now my user's can't get to the files within the area. I
> 
>>could go around and do chmod permissions directoryname, but i was wondering
>>if there was a perl or shell script that would do this?
> 
> cd $topdir
> find . -type d | xargs chmod 755

In case (potentially) untrusted users have had write permission in this 
directory tree in the past, a safer alternative would be

   find /path/to/tree/root -type d -print0 | xargs -0 chmod 755

Better safe than sorry.

    Uwe
-- 
Uwe Doering         |  EscapeBox - Managed On-Demand UNIX Servers
gemini@geminix.org  |  http://www.escapebox.net



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?407646EB.7020708>