shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

2008-07-03 Thread LynnOS
[EMAIL PROTECTED] Linux-vserver:~# pwd
/root
[EMAIL PROTECTED] Linux-vserver:~# ls -ld /root
drwx--3 root root 4096 Jul  3 14:52 /root
[EMAIL PROTECTED] Linux-vserver:~# su lynn
*shell-init: error retrieving current directory: getcwd: cannot access
parent directories: Permission denied*
[EMAIL PROTECTED] Linux-vserver:/root$

[EMAIL PROTECTED] 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


Re: shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

2008-07-16 Thread LynnOS
*"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 <[EMAIL PROTECTED]>:

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


-- 
OpenEmbedded,Linux vserver,Python


Re: shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied

2008-07-17 Thread LynnOS
Thanks ,but after I export PWD,the problem doesn't go
the following is my step:


[EMAIL PROTECTED]:~# 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="[EMAIL PROTECTED]:\\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"
[EMAIL PROTECTED]:~# su lynn
shell-init: error retrieving current directory: getcwd: cannot access parent
directories: Permission denied
[EMAIL PROTECTED]:/root$




2008/7/17 Chet Ramey <[EMAIL PROTECTED]>:

> > *"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
>
> 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[EMAIL PROTECTED]
> http://tiswww.tis.case.edu/~chet/ 
>



-- 
OpenEmbedded,Linux vserver,Python