gnu.bash.bug
[Top] [All Lists]

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

Subject: Re: shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
From: LynnOS <lynnos@xxxxxxxxxxx>
Date: Thu, 17 Jul 2008 10:15:47 +0800
Newsgroups: gnu.bash.bug

*"You might be able to avoid the need for the getcwd call at startup by
exporting PWD*"

Sorry,would you give us more details about how to avoid the "error" message

Thanks very much

LynnOS

2008/7/13 Chet Ramey <chet.ramey@xxxxxxxx>:

> sumeshps1@xxxxxxxxx wrote:
>
>  LynnOS wrote:
>>
>>> root@Avct Linux-vserver:~# pwd
>>> /root
>>> root@Avct Linux-vserver:~# ls -ld /root
>>> drwx------    3 root     root         4096 Jul  3 14:52 /root
>>> root@Avct Linux-vserver:~# su lynn
>>> *shell-init: error retrieving current directory: getcwd: cannot access
>>> parent directories: Permission denied*
>>> lynn@Avct 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    chet@xxxxxxxx
> http://cnswww.cns.cwru.edu/~chet/ <http://cnswww.cns.cwru.edu/%7Echet/>
>
>
>


-- 
OpenEmbedded,Linux vserver,Python

<Prev in Thread] Current Thread [Next in Thread>