Correcting /var permissions to it's original state

Ok I just royally screwed up my /var folder's permissions.

I thought I was inside /var/www and did a chmod xxx ./* on the parent folder /var instead.

Now all the permissions inside /var are messed up. What can I do to correct it?


Solution 1:

My /var/ holds the folllowing files:

drwxr-xr-x  2 root root  4096 2012-04-05 04:51 backups
drwxr-xr-x 12 root root  4096 2012-04-03 07:06 cache
drwxrwsrwt 31 root whoopsie 4096 2012-04-03 07:06 crash
drwxr-xr-x 31 root root  4096 2012-04-03 07:06 lib
drwxrwsr-x  2 root staff 4096 2008-04-15 05:53 local
lrwxrwxrwt  3 root root     9 2012-04-03 07:09 lock -> /run/lock
drwxr-xr-x 14 root root  4096 2012-05-15 04:40 log
drwxrwsrwt  2 root mail  4096 2010-07-23 07:32 mail
drwxr-xr-x  2 root root  4096 2009-02-12 08:08 opt
lrwxr-xr-x 15 root root   520 2012-05-15 07:55 run -> /run
drwxr-xr-x  7 root root  4096 2010-07-23 07:20 spool
drwxrwxrwt  2 root root  4096 2012-05-14 14:20 tmp

From this you should be able to set permissions back to what they need to be.