From ee9c3f18c14a95e31b4714fd87cd73710b882722 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 2 Mar 2011 09:08:47 +0000 Subject: [PATCH] - configurable to understand CVE links Changed files: cveurl.patch -> 1.1 cvsweb.spec -> 1.49 --- cveurl.patch | 41 +++++++++++++++++++++++++++++++++++++++++ cvsweb.spec | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 cveurl.patch diff --git a/cveurl.patch b/cveurl.patch new file mode 100644 index 0000000..cd8d56c --- /dev/null +++ b/cveurl.patch @@ -0,0 +1,41 @@ +--- cvsweb-3.0.6/cvsweb.cgi 2011-03-02 11:04:52.956814108 +0200 +--- cvsweb-3.0.6/cvsweb.cgi 2011-03-02 11:04:47.426931825 +0200 +@@ -67,7 +67,7 @@ + %alltags %fileinfo %tags @branchnames %nameprinted + %symrev %revsym @allrevisions %date %author @revdisplayorder + @revisions %state %difflines %log %branchpoint @revorder $keywordsubstitution +- $prcgi @prcategories $re_prcategories $prkeyword $re_prkeyword $mancgi ++ $prcgi @prcategories $re_prcategories $prkeyword $re_prkeyword $mancgi $cveurl + $doCheckout $scriptname $scriptwhere + $where $Browser $nofilelinks $maycompress @stickyvars %funcline_regexp + $is_links $is_lynx $is_w3m $is_msie $is_mozilla3 $is_textbased +@@ -1569,6 +1584,17 @@ + }egx; + } $_; + } ++ ++ # CVE urls ++ if (defined($cveurl)) { ++ $_ = htmlify_sub { ++ s{ ++ (\bCVE-\d{4}-\d{4}\b) ++ }{ ++ &link($1, sprintf($cveurl, $1)) ++ }egox; ++ } $_; ++ } + } + + return $_; +--- cvsweb-3.0.6/cvsweb.conf~ 2011-03-02 11:06:29.000000000 +0200 ++++ cvsweb-3.0.6/cvsweb.conf 2011-03-02 11:08:14.986810727 +0200 +@@ -82,6 +82,9 @@ + # 'Yet another one' => 'http://192.168.0.2/cgi-bin/cvsweb.cgi/', + #); + ++# CVE Links ++#$cveurl = "https://cve.mitre.org/cgi-bin/cvename.cgi?name=%s"; ++ + # Bug tracking system linking options ("PR" means Problem Report, as in GNATS) + # This will be done only for views for which $allow_*_extra below is true. + # diff --git a/cvsweb.spec b/cvsweb.spec index 040ae1a..b3e1fef 100644 --- a/cvsweb.spec +++ b/cvsweb.spec @@ -13,6 +13,7 @@ Source1: %{name}-apache.conf URL: http://www.freebsd.org/projects/cvsweb.html Patch0: %{name}-config.patch Patch1: %{name}-emptyscript.patch +Patch2: cveurl.patch BuildRequires: rpmbuild(macros) >= 1.268 Requires: diffutils # for %{_prefix}/lib/cgi-bin @@ -70,6 +71,7 @@ Pliki języka Enscript dla CVSweba. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 cp -a cvsweb.conf* samples -- 2.43.0