ok - here's the scenario...

I stupidly managed to change all the files in my /etc/ directory to 
755 permissions (directories too) and now things are complaining and 
I also think that this is not a very secure way for my /etc/ 
directory to be...

I have a backup of this directory with all the correct permissions 
set on another drive - but the files are a bit out of date.

I have kinda kludgily patched things up a bit by doing:

find -maxdepth 10 -type d | xargs chmod 755
find -maxdepth 10 -type f | xargs chmod 644

but this is still not a perfect solution as files such as shadow, and 
others should be set to custom permissions ....

-r--------   1 root     root         1292 Dec  8 09:30 shadow

what I was wondering is is someone able to help me string together a 
command or script (shell is good - perl is more fun as I'm trying to 
learn) that says this:

foreach <file in wrong permissions directory (recursive & don't 
follow symlinks>

        check what the permissions should be (filename in backup directory)
        chmod <file in live etc dir> <permissions backup file is set to>

/foreach

I hope the above illustrates what I'm trying to achieve... I want to 
change the permissions of all files and directories, recursively, in 
my actual /etc directory to those that their equivalents in the 
backup directory are set to.

Thanks in advance for any pointers.

- dan.
-----
        Nitro - 3D Visualisation, Graphics & Animation
                Ph (+61 2) 9810 5177 - Fx (+61 2) 9810 0199
                        http://www.nitro.com.au/


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to