Re: HELP! can't become root



On Wednesday 10 October 2007 13:04, Andrew Sackville-West wrote:
On Tue, Oct 09, 2007 at 05:25:17PM -0700, tom arnall wrote:
Well, I got a list of perm's for stuff in /dev (from a sarge system. I'm
on etch). There were only two diff's: two sound devices. But there are
lots of insane permissions throughout the rest of the system. Is this
because when I did 'chmod -R 777 /dev' I also in effect did 'chmod -R 777
/dev/hda1'? But when I do 'ls -R /dev/hda1' I get only '/dev/hda1'. Why
the diff' in the scope of the commands? And where do you read about this
kind of thing?

well, ls and chmod are different utilities, so the -R could easily have
different effects despite having apparently the same function.

I seem to recall once I did a chown -R something and it followed the
/. and /.. links in the directory so that it started walking up the
directory tree. luckily I stopped it. Perhaps chmod -R is doing a
similar thing?

A

That does /not/ happen with any utility's -R. They don't walk up the tree
with ../ , it would be way too dangerous to have any utility work that way.
Think about it. Below are some exampoles using * and even .* to prove it
(it's a little hard to read with line wrapping):

amethyst:/tmp# mkdir -p test/1/2/3/4/5/6/7/8/9/0/1/2/3/4
amethyst:/tmp# ls -l test
total 0
drwxr-xr-x 3 root root 72 2007-10-11 12:56 1
amethyst:/tmp# ls -l test
total 0
drwxr-xr-x 3 root root 72 2007-10-11 12:56 1
amethyst:/tmp# ls -ld test
drwxr-xr-x 3 root root 72 2007-10-11 12:57 test
amethyst:/tmp# ls -ld test/
drwxr-xr-x 3 root root 72 2007-10-11 12:57 test/
amethyst:/tmp# ls -ld test/1/
drwxr-xr-x 3 root root 72 2007-10-11 12:56 test/1/
amethyst:/tmp# cd test/1/2/3/4/
amethyst:/tmp/test/1/2/3/4# ls -l
total 0
drwxr-xr-x 3 root root 72 2007-10-11 12:56 5
amethyst:/tmp/test/1/2/3/4# chown -R jw *
amethyst:/tmp/test/1/2/3/4# ls -l
total 0
drwxr-xr-x 3 jw root 72 2007-10-11 12:56 5
amethyst:/tmp/test/1/2/3/4# ls -ld .
drwxr-xr-x 3 root root 72 2007-10-11 12:56 .
amethyst:/tmp/test/1/2/3/4# ls -lA
total 0
drwxr-xr-x 3 jw root 72 2007-10-11 12:56 5
amethyst:/tmp/test/1/2/3/4# ls -la
total 0
drwxr-xr-x 3 root root 72 2007-10-11 12:56 .
drwxr-xr-x 3 root root 72 2007-10-11 12:56 ..
drwxr-xr-x 3 jw root 72 2007-10-11 12:56 5

amethyst:/tmp/test/1/2/3/4# chown -R fred .*
amethyst:/tmp/test/1/2/3/4# ls -l
total 0
drwxr-xr-x 3 fred root 72 2007-10-11 12:56 5
amethyst:/tmp/test/1/2/3/4# ls -ld .
drwxr-xr-x 3 fred root 72 2007-10-11 12:56 .

The only way for a recursive run to get back up higher in the tree is
following a symlink (which is certainly a realistic possibility).

JW



--

----------------------
System Administrator - Cedar Creek Software http://www.cedarcreeksoftware.com
http://jwadmin.blogspot.com/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx
with a subject of "unsubscribe". Trouble? Contact listmaster@xxxxxxxxxxxxxxxx



Relevant Pages

  • Re: HELP! cant become root
    ... directory tree. ... They don't walk up the tree ... it would be way too dangerous to have any utility work that way. ... chowning a bunch of stuff I didn't want to with ensuing chaos. ...
    (Debian-User)
  • Re: Directory Tree Listing
    ... > want to have an overview of my Linux System's directory tree. ... it's called 'tree' and it's in the package named 'tree'. ... To unsubscribe: http://www.redhat.com/mailman/listinfo/fedora-list ...
    (Fedora)
  • Re: Crypto test removal request from Theo de Raadt
    ... It has now been deleted from the NetBSD tree as well. ... > Please delete it from the FreeBSD tree as well. ... > Content-Type: text/plain; ... > To unsubscribe, ...
    (freebsd-current)
  • Re: Help needed configuring teTeX
    ... additions in parallel with the standard texmf trees already existing. ... I've got a large extant TeX directory tree full of my personal additions ... MacTeX installs teTeX for you, but puts it in a hidden directory ...
    (comp.text.tex)
  • Re: installing new packages under mactex and texshop
    ... to be sure of that is to define a new texmf tree - one that MacTeX ... additions directory tree, and I'm far from unique in having problems due ...
    (comp.text.tex)