On Thu, Jul 14, 2005 at 07:11:41AM -0400, Joshua Kronengold wrote:
> On Thu, 14 Jul 2005 6:37 am, Michael G Schwern wrote:
> >One of the things Cwd tries is `pwd`.  It doesn't work because it 
> >doesn't
> >have any more information to go on than Perl does.
> 
> Wow.
> Um -- what are the perms on the directory in question?  I'd expect this 
> behavior for perms set to, say, 000 -- the bug as originally reported 
> was for directories set to things that pwd normally can deal with, like 
> 001.

Oh, I was using an unreadable and unexecutable parent directory.

If I try it with 0711...

0 ~/tmp/foo/bar$ sudo chmod 711 ../../foo
0 ~/tmp/foo/bar$ ls -ld ../../foo
drwx--x--x    6 root     wheel         204 Jul 13 16:02 ../../foo
0 ~/tmp/foo/bar$ whoami
schwern
0 ~/tmp/foo/bar$ groups
schwern staff appserverusr admin appserveradm perl
0 ~/tmp/foo/bar$ bleadperl -MFindBin -wle 'print $FindBin::Bin'
pwd: : Permission denied

0 ~/tmp/foo/bar$ perl -MFindBin -wle 'print $FindBin::Bin'
Use of uninitialized value in print at -e line 1.

0 ~/tmp/foo/bar$ perl -wle 'print `pwd`'
pwd: : Permission denied

0 ~/tmp/foo/bar$ pwd
/Users/schwern/tmp/foo/bar


That last one works because its the shell's internal pwd using $PWD.


-- 
Michael G Schwern     [EMAIL PROTECTED]     http://www.pobox.com/~schwern
Ahh email, my old friend.  Do you know that revenge is a dish that is best 
served cold?  And it is very cold on the Internet!

Reply via email to