
Code: Select all
find / \( -path /dev -o -path /tmp \) -prune -o ! -perm /7 -exec ls -ld {} \;
Code: Select all
find / \( -path /dev -o -path /tmp \) -prune -o -type d ! -perm /7 -exec chmod o+rx {} \;
Code: Select all
drwxr-xrwx 18 root root 4096 III 12 13:28 .
drwxr-xrwx 18 root root 4096 III 12 13:28 ..
drwxr-xrwx 2 root root 4096 II 24 20:33 bin
drwxr-xr-x 4 root root 1024 III 12 00:19 boot
drwxr-xr-x 17 root root 14060 III 13 08:20 dev
drwxr-xr-x 46 root root 4096 III 13 2008 etc
drwxr-xr-x 6 root root 4096 II 7 13:56 home
drwxr-xr-x 7 root root 4096 III 11 19:02 lib
drwx---rwx 2 root root 4096 II 10 16:45 lost+found
drwxr-xr-x 7 root root 4096 III 2 21:36 mnt
drwxr-xr-x 4 root root 4096 III 9 14:51 opt
-rw-r--r-- 1 gomul gomul 0 III 12 13:28 oy
dr-xr-xr-x 68 root root 0 III 13 2008 proc
drwx------ 12 root root 4096 III 12 13:22 root
drwxr-xr-x 2 root root 4096 II 20 19:52 sbin
drwxr-xr-x 12 root root 0 III 13 2008 sys
drwxrwxrwt 4 root root 4096 III 13 08:20 tmp
drwxr-xrwx 14 root root 4096 II 21 11:13 usr
drwxr-xr-x 12 root root 4096 II 3 14:18 var

Code: Select all
drwxr-xr-x 23 root root 648 Mar 10 04:24 ./
drwxr-xr-x 23 root root 648 Mar 10 04:24 ../
drwxr-xr-x 2 root root 2808 Mar 11 13:11 bin/
drwxr-xr-x 3 root root 240 Mar 10 14:01 boot/
drwxr-xr-x 8 root root 240 Mar 1 03:54 data/
drwxr-xr-x 17 root root 14140 Mar 13 07:28 dev/
drwxr-xr-x 3 root root 72 Jan 2 2007 emul/
drwxr-xr-x 77 root root 4768 Mar 13 07:28 etc/
drwxr-xr-x 5 root root 128 Feb 17 02:10 home/
lrwxrwxrwx 1 root root 5 Dec 5 20:50 lib -> lib64/
drwxr-xr-x 3 root root 3584 Mar 10 01:27 lib32/
drwxr-xr-x 8 root root 4968 Mar 10 04:24 lib64/
drwxr-xr-x 8 root root 224 Dec 7 12:16 mnt/
drwxr-xr-x 18 root root 560 Mar 11 14:56 opt/
dr-xr-xr-x 93 root root 0 Mar 10 15:02 proc/
drwx------ 46 root root 3600 Mar 13 02:23 root/
drwxr-xr-x 2 root root 3576 Mar 10 04:24 sbin/
drwxr-xr-x 11 root root 0 Mar 10 15:02 sys/
drwxrwxrwt 14 root root 776 Mar 13 09:12 tmp/
drwxr-xr-x 18 root root 536 Mar 10 13:14 usr/
drwxr-xr-x 14 root root 360 Jan 2 2007 var/
Code: Select all
find / \( -path /dev -o -path /tmp \) -prune -o -perm -7 -exec ls -ld {} \;
Code: Select all
tar xvfjp stage3-amd64-*.tar.bz2 bin/ usr/ -C /
Code: Select all
emerge -e system && emerge -e world

I wouldn't take if for granted. But you can find out that very easily with that find command I provided. Btw, I tried it and noticed that this command returns a lot of symbolic links, which is obvious since symbolic links always have all permissions bits set for all columns (i.e. 777 in octal representation).st22 wrote:Then it is possible that if /usr and /bin were marked then nothing else was affected
Code: Select all
find / \( -path /dev -o -path /tmp -o -type l \) -prune -o -perm -7 -exec ls -ld {} \;
Code: Select all
find / \( -path /dev -o -path /tmp -o -path /bin -o -path /usr -o -type l \) -prune -o -perm -7 -exec ls -ld {} \;

Yeah, as you can see they have the sticky bit set (the "t"). The sticky bit is used for temporary directories. These are writable for everybody, which means anyone can modify the directory's entry in the file system. Hence, while user BOB could not modify (i.e. write to) a file in this directory that belongs to EVE (if it is not writable), he could delete (unlink) or rename the file, and put another in place. This would be a serious security flaw, as any user could mess around with another user's temporary files in this directory. So, one sets the sticky bit for such directories, which means that in this directory, only root or the owner of a file can unlink or rename it.st22 wrote: drwxrwxrwt 2 root root 4096 II 19 16:31 /var/cache/fonts
drwxrwxrwt 4 root root 4096 III 15 10:27 /var/tmp
Those two last are ok to have such mod, aren't they?
Yes, as I said, you should REMOVE these directories first and THEN extract them from the tar archive. Then you're sure that no corrupt files are left, there'll only be a few missing. So then you can regenerate these files in /bin and /usr back by doing an 'emerge -e system && emerge -e world' which will reinstall all packages you have installed, hence regenerating all those files that were added during the usage of the system. Except for those in /usr/local/, this directory you should backup first and copy it back later, and fix it manually, if you ever installed something into it.So maybe it would be good idea to extract those dirs from stage. But that would not solve problem with files that were not in the stage (those added during a usage of the system).