summaryrefslogtreecommitdiff
path: root/app-text/info2html
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-07-14 21:03:06 +0100
commit8376ef56580626e9c0f796d5b85b53a0a1c7d5f5 (patch)
tree7681bbd4e8b05407772df40a4bf04cbbc8afc3fa /app-text/info2html
parent30a9caf154332f12ca60756e1b75d2f0e3e1822d (diff)
gentoo resync : 14.07.2018
Diffstat (limited to 'app-text/info2html')
-rw-r--r--app-text/info2html/Manifest4
-rw-r--r--app-text/info2html/files/info2html-2.0-xss.patch61
-rw-r--r--app-text/info2html/info2html-2.0.ebuild73
-rw-r--r--app-text/info2html/metadata.xml11
4 files changed, 149 insertions, 0 deletions
diff --git a/app-text/info2html/Manifest b/app-text/info2html/Manifest
new file mode 100644
index 000000000000..bc2b233e21ea
--- /dev/null
+++ b/app-text/info2html/Manifest
@@ -0,0 +1,4 @@
+AUX info2html-2.0-xss.patch 2206 BLAKE2B 12daf13818b6c6a32932185f543bdfdfbb318d91f80ede4fe2495f9fe5d0dfc3183ad10b8e66d529530ea853834be2f029d94a81e7eebde5e8cfa67c06508797 SHA512 9ffdd82d6cd0f53473fa8eedd5372c09b3a0a2f2b59bea229320fb77bf07d9f9a9f6892585250cd9fa5034213b2b08a346e739ae931c6a42bbdc73487348b947
+DIST info2html-2.0.tar 51200 BLAKE2B 0209e7792689f68c8f596dcb0771395014963240f2071aa970f50611f752e9b9cf524ba2083a72a9b0f4346f8e14e23aedfde4497b05c02dae90b223ebcf6311 SHA512 1b9ebc8bdd4101d24116fe22df9e5d3124300b2ac11585d8c7fff9652f7984983480442af9d9f86300f9684335d85b96f276a775c56c95e7fac85ebc46235e06
+EBUILD info2html-2.0.ebuild 1936 BLAKE2B 35ad17ff213a187eb6a9b91e85c4e6e4c4cc9428cabf004d071aa0af4a9f6517dcaa06b76860523552250a0cb682982d587764b00238d47de080f63d14fb92e3 SHA512 e6064454cea807c4bd187f00796231ca53dbf1290aa7bca05eb56a048e0cce9c86b9ca857d5e18ad4e1ab036029acddbd74ba7aaf0592d8b5da58d1cf5f8b700
+MISC metadata.xml 329 BLAKE2B 9d0be1049ee8b84a11cf0b216e1e05263409f28ec1169978454df89f9726bdcdf1b63ba824f534606bdcd2163dd7b8e1aa9bf9497dfcb6410c0eb3b63958311a SHA512 18e0083cb85393d3d92abda8016dcdebe9f84fcd176557cb433b858ed9b6087ce7e5b53022d689e3861526d10440a9fe7fd6a1d86782a76d8f0756c3046bae23
diff --git a/app-text/info2html/files/info2html-2.0-xss.patch b/app-text/info2html/files/info2html-2.0-xss.patch
new file mode 100644
index 000000000000..a2254bdbbe2b
--- /dev/null
+++ b/app-text/info2html/files/info2html-2.0-xss.patch
@@ -0,0 +1,61 @@
+diff -u info2html-2.0-orig/info2html info2html-2.0/info2html
+--- info2html-2.0-orig/info2html 2006-09-01 14:55:13.000000000 +0200
++++ info2html-2.0/info2html 2006-09-01 15:05:41.000000000 +0200
+@@ -42,7 +42,7 @@
+
+ use CGI;
+ $ENV{'REQUEST_METHOD'} or
+- print "Note: I'm really supposed to be run as a CGI!\n";
++ print "Note: I'm really supposed to be run as a CGI\!\n";
+
+ #-- patterns
+ $NODEBORDER = '\037\014?'; #-- delimiter of an info node
+@@ -62,7 +62,7 @@
+ #---------------------------------------------------------
+ # Don't reveal where we're looking... --jonh 5/20/97 (and reapplied 5/4/1998)
+ sub DieFileNotFound{
+- local($FileName) = @_;
++ local($FileName) = &XssEscape(@_);
+ #-- TEXT : error message if a file could not be opened
+ print <<"EOF";
+ <html><head><title>Info Files - Error Message</title>
+@@ -104,6 +104,28 @@
+ }
+
+ #----------------------------------------------------------
++# XssEscape
++#----------------------------------------------------------
++sub XssEscape {
++ local($Tag) = @_;
++ #-- output escaping is required to protect browser
++ # against `cross site' and `cross frame scripting'
++
++ $Tag =~ s/&/&amp;/gs; # ampersand
++ $Tag =~ s/#/&#35;/gs;
++ $Tag =~ s/;/&#59;/gs;
++ $Tag =~ s/[\000-\037\177-\237]/&iquest;/gs; # "ctrl" codes 0-31 and 127-159
++ $Tag =~ s/</&lt;/gs; # less-than symbol
++ $Tag =~ s/>/&gt;/gs; # greater-than symbol
++ $Tag =~ s/"/&quot;/gs; # double quote
++ $Tag =~ s/\240/&nbsp;/gs; # non-breaking space
++ $Tag =~ s/\255/&shy;/gs; # soft hyphen
++ # the rest is interpreted
++ # as ISO 8859-1
++ $Tag;
++}
++
++#----------------------------------------------------------
+ # ParsHeaderToken
+ #----------------------------------------------------------
+ # Parses the heaer line of an info node for a specific
+@@ -493,6 +515,8 @@
+ #----------------------------------------------------------
+ sub ReplyNotFoundMessage{
+ local($FileName,$Tag) = @_;
++ $FileName = &XssEscape($FileName);
++ $Tag = &XssEscape($Tag);
+ print <<"EOF";
+ <html><head><title>Info Files - Error Message</title>
+ $BOTS_STAY_AWAY
+Only in info2html-2.0: info2html.orig
+Only in info2html-2.0: info2html.rej
diff --git a/app-text/info2html/info2html-2.0.ebuild b/app-text/info2html/info2html-2.0.ebuild
new file mode 100644
index 000000000000..dde163431903
--- /dev/null
+++ b/app-text/info2html/info2html-2.0.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=0
+
+inherit eutils webapp
+
+DESCRIPTION="Converts GNU .info files to HTML"
+HOMEPAGE="http://info2html.sourceforge.net/"
+SRC_URI="mirror://sourceforge/info2html/${P}.tar"
+
+LICENSE="freedist"
+# webapp.eclass deals with SLOTting
+#SLOT="0"
+IUSE=""
+KEYWORDS="alpha amd64 hppa sparc x86"
+
+RDEPEND="dev-lang/perl"
+
+src_unpack() {
+ local infos state line i
+ unpack ${A}
+ cd ${S}
+
+ # filter user-provided data to prevent cross-frame/site scripting attacks
+ # bug #91354 (fix from Werner Fink)
+ epatch "${FILESDIR}"/info2html-2.0-xss.patch
+
+ # Fixup INFODIR for paths in /etc/profile.env INFOPATH
+ infos=$(grep "^export INFOPATH=" /etc/profile.env | tail -n 1 |\
+ sed -e "s:^export INFOPATH=:INFOPATH=:;s:'::g")
+ # Default path to /usr/share/info and /usr/local/share/info
+ [[ -z ${infos} ]] && export infos="/usr/share/info"
+ infos=( ${INFOPATH//:/ } )
+ mv ${S}/info2html.conf ${S}/info2html.conf.orig
+ touch ${S}/info2html.conf
+ state="copy"
+ inserted="no"
+ while read line; do
+ [[ ${line} == "@INFODIR = (" ]] && state="insert"
+ [[ ${line} == ");" ]] && state="copy"
+ case ${state} in
+ "copy")
+ echo ${line} >> ${S}/info2html.conf
+ ;;
+ "insert")
+ echo ${line} >> ${S}/info2html.conf
+ for info in "${infos[@]}"; do
+ echo " '${info}'," >> ${S}/info2html.conf
+ done
+ echo " '/usr/local/share/info'" >> ${S}/info2html.conf
+ state="skip"
+ inserted="yes"
+ ;;
+ "skip")
+ ;;
+ esac
+ done < ${S}/info2html.conf.orig
+ [[ ${state} == "copy" && ${inserted} == "yes" ]] ||
+ die "Setting up info2html.conf failed"
+}
+
+src_install() {
+ webapp_src_preinst
+
+ exeinto ${MY_CGIBINDIR}
+ cp info2html infocat info2html.css info2html.conf ${D}/${MY_CGIBINDIR}
+ # README zapped by info2html-gentoo.patch; it only listed
+ # the homepage so it doesn't add anything useful.
+ # dodoc README
+
+ webapp_src_install
+}
diff --git a/app-text/info2html/metadata.xml b/app-text/info2html/metadata.xml
new file mode 100644
index 000000000000..5020ed8cb0fc
--- /dev/null
+++ b/app-text/info2html/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>web-apps@gentoo.org</email>
+ <name>Gentoo Webapps</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="sourceforge">info2html</remote-id>
+ </upstream>
+</pkgmetadata>