[prev in list] [next in list] [prev in thread] [next in thread]
List: perl5-porters
Subject: [PATCH] don't write along symlinks into a read only source tree (was Re: [ID 20010129.006] OK: perl
From: Nicholas Clark <nick () ccl4 ! org>
Date: 2001-02-28 23:28:49
[Download RAW message or body]
On Fri, Feb 09, 2001 at 10:03:33AM -0600, Jarkko Hietaniemi wrote:
> On Mon, Jan 29, 2001 at 07:18:08PM +0000, Nicholas Clark wrote:
> > On Mon, Jan 29, 2001 at 07:09:24PM +0000, nick@babyhippo.com wrote:
> > > config_args='-Dmksymlinks -Dusedevel -Ubincompat5005 -Uinstallusrbinperl \
> > > -Dcf_email=nick@talking.bollo.cx -Dperladmin=nick@talking.bollo.cx \
> > > -Dinc_version_list= -Dinc_version_list_init=0 -e'
> >
> > Either mksymlinks wants to copy rather than link to the autogenerated headers,
> > or the actions of make regen_headers (certainly embed.pl) ought to delete
> > their targets before re-opening them.
> > As I'm finding that if I try to make ok in a built directory, make is
> > trying to rebuild everything because some other build directory has
> > just touched the timestamps on files in the source tree.
> > (if not re-written them in a nasty way)
> >
> > Maybe development tarballs and the rsync server should ship without the
> > autogenerated headers.
>
> That would be hard to arrange since we need to list the headers in the
> MANIFEST. Could you experiment with the 'delete the files before
> rebuilding them' approach in embed.pl?
on linux chattr +i * and then I get to see what's trying to write along
the symlinks:
Can't open proto.h: Permission denied at embed.pl line 32.
and
Can't create warnings.h: Permission denied
The following seems to make regen_headers happy with a really read only
source tree:
--- embed.pl.orig Thu Feb 22 12:31:48 2001
+++ embed.pl Wed Feb 28 23:14:01 2001
@@ -29,6 +29,7 @@
$F = $filename;
}
else {
+ unlink $filename;
open F, ">$filename" or die "Can't open $filename: $!";
$F = \*F;
}
--- warnings.pl.orig Fri Dec 8 00:25:51 2000
+++ warnings.pl Wed Feb 28 23:15:45 2001
@@ -172,8 +172,8 @@
exit ;
}
-#unlink "warnings.h";
-#unlink "lib/warnings.pm";
+unlink "warnings.h";
+unlink "lib/warnings.pm";
open(WARN, ">warnings.h") || die "Can't create warnings.h: $!\n";
open(PM, ">lib/warnings.pm") || die "Can't create lib/warnings.pm: $!\n";
I'm not totally happy with patching in commented out unlink commands.
I note that embed.pl tries to unlink most things it opens, and all the
other scripts do unlink all the files before they try to open them for
writing.
Nicholas Clark
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic