Gentoo Archives: gentoo-commits

From: "Patrick Lauer (patrick)" <patrick@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/parrot/files: perldoc-5.10.patch
Date: Sun, 01 Dec 2013 06:46:12
Message-Id: 20131201064607.4BFFA2004E@flycatcher.gentoo.org
1 patrick 13/12/01 06:46:07
2
3 Added: perldoc-5.10.patch
4 Log:
5 Bump for #492648
6
7 (Portage version: 2.2.7/cvs/Linux x86_64, unsigned Manifest commit)
8
9 Revision Changes Path
10 1.1 dev-lang/parrot/files/perldoc-5.10.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/parrot/files/perldoc-5.10.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/parrot/files/perldoc-5.10.patch?rev=1.1&content-type=text/plain
14
15 Index: perldoc-5.10.patch
16 ===================================================================
17 diff --git a/config/auto/perldoc.pm b/config/auto/perldoc.pm
18 index 4d87aca..7e54156 100644
19 --- a/config/auto/perldoc.pm
20 +++ b/config/auto/perldoc.pm
21 @@ -66,24 +66,12 @@ E_NOTE
22 foreach my $ops (@ops) {
23 my $pod = $ops;
24 $pod =~ s/\.ops$/.pod/;
25 - if ( $new_perldoc ) {
26 - $TEMP_pod_build .= <<"END";
27 + $TEMP_pod_build .= <<"END";
28 ops/$pod: ../src/ops/$ops
29 -\t\$(PERLDOC) -ud ops/$pod ../src/ops/$ops
30 +\t\$(PODEXTRACT) ../src/ops/$ops ops/$pod
31 \t\$(CHMOD) 0644 ops/$pod
32 \t\$(ADDGENERATED) "docs/\$\@" "[doc]"
33 -
34 -END
35 - }
36 - else {
37 - $TEMP_pod_build .= <<"END";
38 -ops/$pod: ../src/ops/$ops
39 -\t\$(PERLDOC) -u ../ops/$ops > ops/$pod
40 -\t\$(CHMOD) 0644 ../ops/$pod
41 -\t\$(ADDGENERATED) "docs/\$\@" "[doc]"
42 -
43 END
44 - }
45 }
46
47 $conf->data->set(
48 diff --git a/config/gen/makefiles/docs.in b/config/gen/makefiles/docs.in
49 index 3e8c74b..4e8f35d 100644
50 --- a/config/gen/makefiles/docs.in
51 +++ b/config/gen/makefiles/docs.in
52 @@ -11,6 +11,7 @@ RM_RF = @rm_rf@
53 PERLDOC = @perldoc@
54 POD2MAN = @pod2man@
55 VERSION = @VERSION@@DEVEL@
56 +PODEXTRACT = $(PERL) ../tools/build/podextract.pl
57 ADDGENERATED = $(PERL) ../tools/build/addgenerated.pl
58 OPS_SUMMARY = ../tools/docs/ops_summary.pl
59
60 @@ -63,8 +64,7 @@ doc-prep:
61 $(TOUCH) doc-prep
62
63 packfile-c.pod: ../src/packfile/api.c
64 -#IF(new_perldoc): $(PERLDOC) -ud packfile-c.pod ../src/packfile/api.c
65 -#ELSE: $(PERLDOC) -u ../src/packfile/api.c > packfile-c.pod
66 + $(PODEXTRACT) ../src/packfile/api.c packfile-c.pod
67 $(ADDGENERATED) "docs/$@" "[doc]"
68
69 .pod.1 : # suffix rule (limited support)
70 diff --git a/config/gen/makefiles/root.in b/config/gen/makefiles/root.in
71 index c1f0c19..36e853a 100644
72 --- a/config/gen/makefiles/root.in
73 +++ b/config/gen/makefiles/root.in
74 @@ -115,6 +115,7 @@ LDFLAGS = @ldflags@ @ld_debug@
75 INNO_SETUP = iscc
76 TEMPDIR = @tempdir@
77 RPATH_BLIB = @rpath_blib@
78 +PODEXTRACT = $(PERL) $(BUILD_TOOLS_DIR)/podextract.pl
79 ADDGENERATED = $(PERL) $(BUILD_TOOLS_DIR)/addgenerated.pl
80 #IF(darwin):export MACOSX_DEPLOYMENT_TARGET = @osx_version@
81
82 diff --git a/tools/build/podextract.pl b/tools/build/podextract.pl
83 new file mode 100644
84 index 0000000..0979b6b
85 --- /dev/null
86 +++ b/tools/build/podextract.pl
87 @@ -0,0 +1,75 @@
88 +#! perl
89 +
90 +=head1 NAME
91 +
92 +tools/build/podextract.pl
93 +
94 +=head1 DESCRIPTION
95 +
96 +Simple POD Extraction
97 +
98 +=head1 SYNOPSIS
99 +
100 +Previously:
101 +
102 + perldoc -ud $target $source
103 +
104 +or
105 +
106 + perldoc -u $source > $target
107 +
108 +Now:
109 +
110 + perl podextract.pl $source $target
111 +
112 +=head1 RATIONALE
113 +
114 +C<perldoc> does many things, and is somewhat complex.
115 +
116 +For instance, normally,
117 +
118 + perldoc perldoc
119 +
120 +Inspects various paths, and paths that are controlled by C<%ENV> to find relevant documentation for "perldoc".
121 +
122 +And because of this, it is a little security concious, and pre-emptively drops root to UID=nobody
123 +
124 +But Parrot is not using this feature of C<perldoc>
125 +
126 +Parrot is simply using C<perldoc> as a content filter to extract C<POD> from source files.
127 +
128 +And as such, it only needs the alternative function
129 +
130 + perldoc $PATH
131 +
132 +To work, which doesn't require C<%ENV>, and additionally, dropping root to C<UID=nobody> makes it impossible
133 +for some parrot to invoke C<perldoc -ud $target $source> on some systems, because it drops privelages and can then no longer read C<$source>, and can no longer write C<$target>.
134 +
135 +However, some means vendor tooling that B<MUST> execute C<make install> as root, by proxy, C<MUST> invoke C<perldoc> as root, and as such, invokes the security problem, which is impossible to work around.
136 +
137 +Given a simple C<chmod> is not enough, because parent directories also are not readable or writeable by C<UID=nobody>, and additionally, vendor tooling causes fatal access violations when a process running as C<UID=nobody> even attempts to do directory lookaround ( which C<perldoc> does much of as part of C<%ENV> handling )
138 +
139 +So this tool is simple:
140 +
141 +It takes the very core utility in C<PerlDoc> that parrot needed to utilize, and calls it directly.
142 +
143 +And this avoids the misguided attempts of increasing security, which simply does nothing useful.
144 +
145 +=cut
146 +
147 +use strict;
148 +use warnings;
149 +
150 +if ( not $ARGV[1] ) {
151 + die "pod_extract <src> <target>";
152 +}
153 +if ( not -e $ARGV[0] ) {
154 + die "<src> $ARGV[0] does not exist";
155 +}
156 +require Pod::Perldoc::ToPod;
157 +my $parser = Pod::Perldoc::ToPod->new();
158 +open my $output, '>', $ARGV[1] or die "Cant write to $ARGV[1] $! $?";
159 +$parser->parse_from_file( $ARGV[0], $output );
160 +
161 +1
162 +