lynn@Avct Linux-vserver:/root$ bash --version
GNU bash, version 3.2.39(1)-release (i686-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
===============================================================================
I appay 39 patches from http://ftp.gnu.org/gnu/bash/bash-3.2-patches
but the error message doesn't go
in many popular linux distributions,the problem disappear
thanks
--
OpenEmbedded,Linux vserver,Python
I got the same error and I corrected it by changing the shell in /etc/
passwd.
changed from /usr/bin/bash/ to /bin/sh ...
sum
--------
> 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 ch...@case.edu http://cnswww.cns.cwru.edu/~chet/
Sorry,would you give us more details about how to avoid the "error" message
Thanks very much
LynnOS
2008/7/13 Chet Ramey <chet....@case.edu>:
> sume...@gmail.com 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 ch...@case.edu
> http://cnswww.cns.cwru.edu/~chet/ <http://cnswww.cns.cwru.edu/%7Echet/>
>
>
>
--
OpenEmbedded,Linux vserver,Python
export PWD
Bash performs a check at startup in which it compares $PWD to `.' and skips
the call to getcwd if the two refer to the same device and inode. File
permissions may still keep you from being able to stat $PWD, but it's worth
a shot.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU ch...@case.edu http://tiswww.tis.case.edu/~chet/
root@Linux-vserver:~# export
declare -x EDITOR="/bin/vi"
declare -x HOME="/root"
declare -x LD_LIBRARY_PATH="/usr/lib:/lib"
declare -x LOGNAME="root"
declare -x MAIL="/var/mail/root"
declare -x OLDPWD
declare -x OPIEDIR
declare -x
PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:"
declare -x PS1="\\u@\\h:\\w\\\$ "
declare -x PWD="/root"
declare -x PYTHONHOME="/usr/lib/python2.5"
declare -x PYTHONPATH="/usr/lib/python2.5:/usr/lib/python2.5/lib-dynload"
declare -x QPEDIR
declare -x QTDIR
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_CLIENT="172.26.26.200 1593 22"
declare -x SSH_CONNECTION="172.26.26.200 1593 172.26.26.106 22"
declare -x SSH_TTY="/dev/pts/0"
declare -x TERM="vt100"
declare -x USER="root"
root@Linux-vserver:~# su lynn
shell-init: error retrieving current directory: getcwd: cannot access parent
directories: Permission denied
lynn@Linux-vserver:/root$
2008/7/17 Chet Ramey <chet....@case.edu>:
> http://tiswww.tis.case.edu/~chet/ <http://tiswww.tis.case.edu/%7Echet/>
>
--
OpenEmbedded,Linux vserver,Python
As I explained previously, this is not a bash problem. This is a
problem with file permissions in the current working directory.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
Chet Ramey, ITS, CWRU ch...@case.edu http://cnswww.cns.cwru.edu/~chet/