Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Set *.pod permissions in installperl. #12052

Closed
p5pRT opened this issue Apr 12, 2012 · 5 comments
Closed

[PATCH] Set *.pod permissions in installperl. #12052

p5pRT opened this issue Apr 12, 2012 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 12, 2012

Migrated from rt.perl.org#112424 (status was 'resolved')

Searchable as RT112424$

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2012

From @craigberry

installperl takes responsibility for explicitly setting the permissions on most of the files it installs, but had not been doing so on pods for some reason. The attached patch makes it do so.

Not having world/other read access could not only defeat attempts to read documentation, but also cause C<use diagnostics;> to fail when it attempted to open perldiag.pod.

On Unixy systems, the default behavior of File​::Copy and the default permission settings on the source tree normally prevent any trouble here. On VMS, File​::Copy does not preserve permissions, and moreover, the pods created on the fly during the build will inherit default permissions, which normally do not include world readability. And on any platform, vicissitudes of archive unpacking could leave permissions mangled on the source tree and cause similar problems. It seems safest to make the target permissions what we want them to be, just like we do for all the other types of files we install.

I would like permission to get this in for 5.16. It can't be smoked because installperl presupposes the test suite has been run and therefore can't be tested in the test suite. It works for me on VMS and OS X. On the latter, the permissions of the installed pods were the same before and after the patch.

________________________________________
Craig A. Berry
mailto​:craigberry@​mac.com

"... getting out of a sonnet is much more
difficult than getting in."
  Brad Leithauser

@p5pRT
Copy link
Author

p5pRT commented Apr 12, 2012

From @craigberry

0001-Set-.pod-permissions-in-installperl.patch
From 157cd6bc80c2ef2137b56648574b75319b263287 Mon Sep 17 00:00:00 2001
From: "Craig A. Berry" <craigberry@mac.com>
Date: Thu, 12 Apr 2012 16:27:08 -0500
Subject: [PATCH] Set *.pod permissions in installperl.

installperl takes responsibility for explicitly setting the
permissions on most of the files it installs, but had not been
doing so on pods for some reason.  This commit makes it do so.

Not having world/other read access could not only defeat attempts
to read documentation, but also cause C<use diagnostics;> to fail
when it attempted to open perldiag.pod.
---
 installperl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/installperl b/installperl
index 10a3781..8b22d72 100755
--- a/installperl
+++ b/installperl
@@ -558,6 +558,7 @@ if (!$nopods && (!$versiononly || ($installprivlib =~ m/\Q$vershort/))) {
 	# $_ is a name like  pod/perl.pod
 	(my $base = $_) =~ s#.*/##;
 	copy_if_diff($_, "${installprivlib}/$pod/${base}");
+	chmod(0644, "${installprivlib}/$pod/${base}");
     }
 
 }
-- 
1.7.7.GIT

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

From @cpansprout

On Thu Apr 12 15​:23​:11 2012, craigberry wrote​:

installperl takes responsibility for explicitly setting the
permissions on most of the files it installs, but had not been
doing so on pods for some reason. The attached patch makes it do
so.

Not having world/other read access could not only defeat attempts to
read documentation, but also cause C<use diagnostics;> to fail when
it attempted to open perldiag.pod.

On Unixy systems, the default behavior of File​::Copy and the default
permission settings on the source tree normally prevent any trouble
here. On VMS, File​::Copy does not preserve permissions, and
moreover, the pods created on the fly during the build will inherit
default permissions, which normally do not include world
readability. And on any platform, vicissitudes of archive
unpacking could leave permissions mangled on the source tree and
cause similar problems. It seems safest to make the target
permissions what we want them to be, just like we do for all the
other types of files we install.

I would like permission to get this in for 5.16. It can't be smoked
because installperl presupposes the test suite has been run and
therefore can't be tested in the test suite. It works for me on
VMS and OS X. On the latter, the permissions of the installed pods
were the same before and after the patch.

________________________________________
Craig A. Berry
mailto​:craigberry@​mac.com

"... getting out of a sonnet is much more
difficult than getting in."
Brad Leithauser

Ricardo Signes applied this as ed5958d.

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

@cpansprout - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant