bug-bash
[Top][All Lists]
Advanced

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

Re: shell-init: error retrieving current directory: getcwd: cannot acces


From: Chet Ramey
Subject: Re: shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
Date: Sat, 12 Jul 2008 15:45:15 -0400
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

address@hidden wrote:

LynnOS wrote:
address@hidden Linux-vserver:~# pwd
/root
address@hidden Linux-vserver:~# ls -ld /root
drwx------    3 root     root         4096 Jul  3 14:52 /root
address@hidden Linux-vserver:~# su lynn
*shell-init: error retrieving current directory: getcwd: cannot access
parent directories: Permission denied*
address@hidden Linux-vserver:/root$

This is not a bash problem.  You're in a directory which can be read and
searched only by root, and you're su'ing to another user.  That user
does not have permission to search the current directory, even to find
`..', so getcwd is going to fail.

You might be able to avoid the need for the getcwd call at startup by
exporting PWD, so the child shell can read it, but there aren't any
guarantees.

Chet

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]