Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 34971
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: wdr1 [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ExtUtils::MakeMaker Requires All Parent Directories to be Readable?
Why does ExtUtils::MakeMaker need read access to every parent directory? (I'm on a shared system where /home is executable, but not readable.) To reproduce: % pwd /home/me/tmp/foo/bar/baz/bang/Foo % chmod a-r `pwd`/../../.. % ls ../../.. ls: ../../..: Permission denied # okay, a random parent directory is not readable... % cat Makefile.PL use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'Foo', VERSION_FROM => 'lib/Foo.pm', # finds $VERSION ); % perl Makefile.PL Writing Makefile for Foo % make /bin/pwd: cannot open directory `../../..': Permission denied !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create 'blib/lib/auto' Do not have write permissions on '/' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1 make: *** [pm_to_blib] Error 2 Versions, etc. if helpful: % perl -v This is perl, v5.8.8 built for i386-linux-thread-multi Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. % perldoc -m ExtUtils::MakeMaker | grep VERSION | head -1 our $VERSION = '6.44'; % uname -a Linux ns2.amusive.com 2.6.18-53.el5PAE #1 SMP Mon Nov 12 02:55:09 EST 2007 i686 i686 i386 GNU/Linux Confused, -Bill
Subject: Re: [rt.cpan.org #34971] ExtUtils::MakeMaker Requires All Parent Directories to be Readable?
Date: Mon, 14 Apr 2008 12:14:00 +0100
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
William Reardon via RT wrote: Show quoted text
> Why does ExtUtils::MakeMaker need read access to every parent directory? > (I'm on a shared system where /home is executable, but not readable.)
Short version: Update Cwd.pm from CPAN to at least 3.26 and the problem should go away. Are you on Dreamhost? http://search.cpan.org/dist/PathTools/ Long, technical version: You have to understand how cwd works. In short, in order to figure out what the name of your current working directory is you need to note the inode (unique ID) of your current directory, go up to your parent, do a readdir, stat each one and see if it matches your inode. For an absolute path you repeat until you reach the root directory. If any parent directory is unreadable it doesn't work. MakeMaker prefers to use absolute paths for certain things where the user code might chdir around. Read the "rationale" section here in the getcwd() spec. http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html You're allowed to cheat (really, it's in the spec!) This basically means you have some special setuid root program or other function that bypasses the standard filesystem security and lets you get the job done. The updated Cwd.pm does this cheat (by borrowing updated code from BSD). -- Whip me, beat me, make my code compatible with VMS!
Subject: Re: [rt.cpan.org #34971] ExtUtils::MakeMaker Requires All Parent Directories to be Readable?
Date: Fri, 18 Apr 2008 22:51:18 -0700
To: bug-ExtUtils-MakeMaker [...] rt.cpan.org
From: William Reardon <wdr1 [...] pobox.com>
Michael G Schwern via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=34971 > > > William Reardon via RT wrote:
>> Why does ExtUtils::MakeMaker need read access to every parent directory? >> (I'm on a shared system where /home is executable, but not readable.)
> > Short version: Update Cwd.pm from CPAN to at least 3.26 and the problem > should go away. Are you on Dreamhost? > http://search.cpan.org/dist/PathTools/
Great answer, Michael. I appreciate that you gave me both a fix & an explanation. I'm actually not on Dreamhost -- a shared server owned by a friend. Upgrading Cwd.pm fixed it. Thanks, Michael! -Bill Show quoted text
> Long, technical version: > > You have to understand how cwd works. In short, in order to figure out what > the name of your current working directory is you need to note the inode > (unique ID) of your current directory, go up to your parent, do a readdir, > stat each one and see if it matches your inode. > > For an absolute path you repeat until you reach the root directory. If any > parent directory is unreadable it doesn't work. > > MakeMaker prefers to use absolute paths for certain things where the user code > might chdir around. > > Read the "rationale" section here in the getcwd() spec. > http://www.opengroup.org/onlinepubs/009695399/functions/getcwd.html > > You're allowed to cheat (really, it's in the spec!) This basically means you > have some special setuid root program or other function that bypasses the > standard filesystem security and lets you get the job done. The updated > Cwd.pm does this cheat (by borrowing updated code from BSD). > >