[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cannot su.

On Fri, 21 May 1999, Andrei Ivanov wrote:

> > shell-init: could not get current directory: getcwd: cannot access parent 
> > directories.
> Check your permissions on . and .. directories. They should be 
> chmod'd and chown'd as below. 
> drwxr-xr-x   2 root     root         1024 May  2 19:21 .
> drwxr-xr-x   5 root     root         1024 May  2 22:23 ..

No, they shouldn't. '.' should be whatever the permissions on the current
directory are, while '..' should be the permissions on the directory you
reach by 'cd ..'. If you go around changing the permissions on every
dot-directory as you suggest, Bad Things will result.

i've tested this, suing to a normal user from root in a directory the
normal user has absolutely no access to (. and .. both mode 700, owner
root), and it doesn't give those errors.

The only time i can recall seeing those errors is when the cwd is moved or
removed. Just now, i created a dir 'test', cd-ed to it as root, removed it
from another tty, and su-ed to a normal user. Sure enough, there's the
error. Even if it's removed and remade from the other tty before su-ing,
it still gives the error.

Reply to: