From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kei Kebreau Subject: Re: [PATCH] gnu: w3m: Switch to Debian's actively maintained fork of w3m. Date: Fri, 04 Nov 2016 13:05:02 -0400 Message-ID: <874m3nqipt.fsf@openmailbox.org> References: <87mvhgw4w0.fsf@openmailbox.org> <20161103221718.123dc755@centurylink.net> <20161104040309.GA5474@jasmine> <8760o31il3.fsf@gnu.org> <87d1ibwb3s.fsf@openmailbox.org> <20161104154856.GD14769@jasmine> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2hvn-00056P-RY for guix-devel@gnu.org; Fri, 04 Nov 2016 13:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2hvk-0003lh-AV for guix-devel@gnu.org; Fri, 04 Nov 2016 13:05:31 -0400 Received: from smtp29.openmailbox.org ([62.4.1.63]:49818 helo=smtp14.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c2hvj-0003jq-Uu for guix-devel@gnu.org; Fri, 04 Nov 2016 13:05:28 -0400 In-Reply-To: <20161104154856.GD14769@jasmine> (Leo Famulari's message of "Fri, 4 Nov 2016 11:48:56 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Leo Famulari Cc: guix-devel@gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=0001-gnu-w3m-Switch-to-Debian-s-actively-maintained-fork-.patch Content-Transfer-Encoding: quoted-printable From=201eede14194c83b70725b6de062b9d3e0acce6340 Mon Sep 17 00:00:00 2001 From: Kei Kebreau Date: Fri, 4 Nov 2016 12:43:28 -0400 Subject: [PATCH] gnu: w3m: Switch to Debian's actively maintained fork of w= 3m. Fixes some security issues seen here: * gnu/packages/w3m.scm (w3m): Switch it. [source]: Use Debian's git tree. Remove obsolete patches. [arguments]: Remove unnecessary modification of %standard-phases. * gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch, gnu/packages/patches/w3m-disable-weak-ciphers.patch, gnu/packages/patches/w3m-force-ssl_verify_server-on.patch, gnu/packages/patches/w3m-libgc.patch: Delete files. * gnu/local.mk (dist_patch_DATA): Remove them. =2D-- gnu/local.mk | 4 - .../patches/w3m-disable-sslv2-and-sslv3.patch | 24 ------ .../patches/w3m-disable-weak-ciphers.patch | 24 ------ .../patches/w3m-force-ssl_verify_server-on.patch | 24 ------ gnu/packages/patches/w3m-libgc.patch | 28 ------- gnu/packages/w3m.scm | 89 ++++++++++--------= ---- 6 files changed, 42 insertions(+), 151 deletions(-) delete mode 100644 gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch delete mode 100644 gnu/packages/patches/w3m-disable-weak-ciphers.patch delete mode 100644 gnu/packages/patches/w3m-force-ssl_verify_server-on.pat= ch delete mode 100644 gnu/packages/patches/w3m-libgc.patch diff --git a/gnu/local.mk b/gnu/local.mk index a23d536..a34d8ae 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -891,10 +891,6 @@ dist_patch_DATA =3D \ %D%/packages/patches/vte-CVE-2012-2738-pt1.patch \ %D%/packages/patches/vte-CVE-2012-2738-pt2.patch \ %D%/packages/patches/vtk-mesa-10.patch \ =2D %D%/packages/patches/w3m-libgc.patch \ =2D %D%/packages/patches/w3m-force-ssl_verify_server-on.patch \ =2D %D%/packages/patches/w3m-disable-sslv2-and-sslv3.patch \ =2D %D%/packages/patches/w3m-disable-weak-ciphers.patch \ %D%/packages/patches/weechat-python.patch \ %D%/packages/patches/weex-vacopy.patch \ %D%/packages/patches/wicd-bitrate-none-fix.patch \ diff --git a/gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch b/gnu/p= ackages/patches/w3m-disable-sslv2-and-sslv3.patch deleted file mode 100644 index 5b78f2d..0000000 =2D-- a/gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch +++ /dev/null @@ -1,24 +0,0 @@ =2DSubject: Disable SSLv2 and SSLv3. =2D =2DThe only remaining methods are TLSv1.* (the code never distinguishes =2Dbetween TLSv1.0, TLSv1.1, and TLSv1.2). =2D--- =2D fm.h | 2 +- =2D 1 file changed, 1 insertion(+), 1 deletion(-) =2D =2Ddiff --git a/fm.h b/fm.h =2Dindex 320906c..ddcd4fc 100644 =2D--- a/fm.h =2D+++ b/fm.h =2D@@ -1144,7 +1144,7 @@ global int ssl_path_modified init(FALSE); =2D #endif /* defined(USE_SSL) && =2D * defined(USE_SSL_VERIFY) */ =2D #ifdef USE_SSL =2D-global char *ssl_forbid_method init(NULL); =2D+global char *ssl_forbid_method init("2, 3"); =2D #endif =2D=20 =2D global int is_redisplay init(FALSE); =2D--=20 =2D2.6.4 =2D diff --git a/gnu/packages/patches/w3m-disable-weak-ciphers.patch b/gnu/pack= ages/patches/w3m-disable-weak-ciphers.patch deleted file mode 100644 index 4780d54..0000000 =2D-- a/gnu/packages/patches/w3m-disable-weak-ciphers.patch +++ /dev/null @@ -1,24 +0,0 @@ =2DSubject: Disable weak ciphers =2D =2DDisable RC4, "export ciphers", and all keys < 128 bits. =2D =2DBug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/w3m/+bug/1325674 =2D--- =2D url.c | 1 + =2D 1 file changed, 1 insertion(+) =2D =2Ddiff --git a/url.c b/url.c =2Dindex ed6062e..e86b1f3 100644 =2D--- a/url.c =2D+++ b/url.c =2D@@ -326,6 +326,7 @@ openSSLHandle(int sock, char *hostname, char **p_cer= t) =2D SSL_load_error_strings(); =2D if (!(ssl_ctx =3D SSL_CTX_new(SSLv23_client_method()))) =2D goto eend; =2D+ SSL_CTX_set_cipher_list(ssl_ctx, "DEFAULT:!LOW:!RC4:!EXP"); =2D option =3D SSL_OP_ALL; =2D if (ssl_forbid_method) { =2D if (strchr(ssl_forbid_method, '2')) =2D--=20 =2D2.6.4 =2D diff --git a/gnu/packages/patches/w3m-force-ssl_verify_server-on.patch b/gn= u/packages/patches/w3m-force-ssl_verify_server-on.patch deleted file mode 100644 index dc9f117..0000000 =2D-- a/gnu/packages/patches/w3m-force-ssl_verify_server-on.patch +++ /dev/null @@ -1,24 +0,0 @@ =2DSubject: Force ssl_verify_server on. =2D =2DBy default, SSL/TLS certificates are not verified. This enables the =2Dverification. =2D--- =2D fm.h | 2 +- =2D 1 file changed, 1 insertion(+), 1 deletion(-) =2D =2Ddiff --git a/fm.h b/fm.h =2Dindex 8378939..320906c 100644 =2D--- a/fm.h =2D+++ b/fm.h =2D@@ -1135,7 +1135,7 @@ global int view_unseenobject init(TRUE); =2D #endif =2D=20 =2D #if defined(USE_SSL) && defined(USE_SSL_VERIFY) =2D-global int ssl_verify_server init(FALSE); =2D+global int ssl_verify_server init(TRUE); =2D global char *ssl_cert_file init(NULL); =2D global char *ssl_key_file init(NULL); =2D global char *ssl_ca_path init(NULL); =2D--=20 =2D2.6.4 =2D diff --git a/gnu/packages/patches/w3m-libgc.patch b/gnu/packages/patches/w3= m-libgc.patch deleted file mode 100644 index 0dc6a40..0000000 =2D-- a/gnu/packages/patches/w3m-libgc.patch +++ /dev/null @@ -1,28 +0,0 @@ =2DThis patch fixes w3m compilation with libgc > 7.2. =2D =2DReported: =2Dhttps://bugs.archlinux.org/task/33397 =2D =2DPatch with explanation: =2Dhttp://anonscm.debian.org/cgit/collab-maint/w3m.git/commit/?id=3D770eec8= 304bdbe458 =2D--- =2D main.c | 3 ++- =2D 1 file changed, 2 insertions(+), 1 deletion(-) =2D =2Ddiff --git a/main.c b/main.c =2Dindex b421943..249eb1a 100644 =2D--- a/main.c =2D+++ b/main.c =2D@@ -833,7 +833,8 @@ main(int argc, char **argv, char **envp) =2D mySignal(SIGPIPE, SigPipe); =2D #endif =2D=20 =2D- orig_GC_warn_proc =3D GC_set_warn_proc(wrap_GC_warn_proc); =2D+ orig_GC_warn_proc =3D GC_get_warn_proc(); =2D+ GC_set_warn_proc(wrap_GC_warn_proc); =2D err_msg =3D Strnew(); =2D if (load_argc =3D=3D 0) { =2D /* no URL specified */ =2D--=20 =2D2.6.4 =2D diff --git a/gnu/packages/w3m.scm b/gnu/packages/w3m.scm index e7dd583..8b8a33a 100644 =2D-- a/gnu/packages/w3m.scm +++ b/gnu/packages/w3m.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2013 Nikita Karetnikov ;;; Copyright =C2=A9 2016 Leo Famulari +;;; Copyright =C2=A9 2016 Kei Kebreau ;;; ;;; This file is part of GNU Guix. ;;; @@ -28,56 +29,50 @@ #:use-module (gnu packages tls) #:use-module (gnu packages) #:use-module (guix packages) =2D #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix build-system gnu)) =20 (define-public w3m =2D (package =2D (name "w3m") =2D (version "0.5.3") =2D (source (origin =2D (method url-fetch) =2D (uri (string-append "mirror://sourceforge/" name "/" name "= /" =2D name "-" version "/" =2D name "-" version ".tar.gz")) =2D (sha256 =2D (base32 =2D "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579")) =2D =2D ;; cf. https://bugs.archlinux.org/task/33397 =2D (patches (search-patches "w3m-libgc.patch" =2D "w3m-force-ssl_verify_server-on.pa= tch" =2D "w3m-disable-sslv2-and-sslv3.patch" =2D "w3m-disable-weak-ciphers.patch"))= )) =2D (build-system gnu-build-system) =2D (arguments `(#:tests? #f ; no check target =2D #:phases (alist-cons-before =2D 'configure 'fix-perl =2D (lambda _ =2D ;; https://launchpad.net/bugs/935540 =2D ;; 'struct file_handle' is used by 'glibc' =2D (substitute* '("istream.c" "istream.h") =2D (("struct[[:blank:]]+file_handle") =2D "struct w3m_file_handle")) =2D (substitute* '("scripts/w3mmail.cgi.in" =2D "scripts/dirlist.cgi.in") =2D (("@PERL@") (which "perl")))) =2D %standard-phases))) =2D (inputs =2D `(("libgc" ,libgc) =2D ("ncurses" ,ncurses) =2D ("openssl" ,openssl) =2D ("zlib" ,zlib))) =2D (native-inputs =2D `(("gettext" ,gnu-gettext) =2D ("perl" ,perl) =2D ("pkg-config" ,pkg-config))) =2D (home-page "http://w3m.sourceforge.net/") =2D (synopsis "Text-mode web browser") =2D (description =2D "w3m is a text-based web browser as well as a pager like 'more' or + (let ((commit "5cf75248f5833db00d53a33c30a525bb40f5512b") + (revision "1")) ; Guix package revision + (package + (name "w3m") + (version (string-append "0.5.3-" revision "." (string-take commit 7)= )) + (source (origin + (method git-fetch) + ;; Debian's fork of w3m is the only one that is still + ;; maintained. + (uri (git-reference + (url "https://anonscm.debian.org/cgit/collab-maint/w= 3m.git") + (commit commit))) + (file-name (string-append "w3m-" version "-checkout")) + (sha256 + (base32 + "142vkkmsk76wj9w6r4y2pa1hmy1kkzmc73an9zchx0ikm2z92x6s"))= )) + (build-system gnu-build-system) + (arguments `(#:tests? #f ; no check target + #:phases (alist-cons-before + 'configure 'fix-perl + (lambda _ + (substitute* '("scripts/w3mmail.cgi.in" + "scripts/dirlist.cgi.in") + (("@PERL@") (which "perl")))) + %standard-phases))) + (inputs + `(("libgc" ,libgc) + ("ncurses" ,ncurses) + ("openssl" ,openssl) + ("zlib" ,zlib))) + (native-inputs + `(("gettext" ,gnu-gettext) + ("perl" ,perl) + ("pkg-config" ,pkg-config))) + (home-page "http://w3m.sourceforge.net/") + (synopsis "Text-mode web browser") + (description + "w3m is a text-based web browser as well as a pager like 'more' or 'less'. With w3m you can browse web pages through a terminal emulator window. Moreover, w3m can be used as a text formatting tool which typesets HTML into plain text.") =2D (license (x11-style "file://doc/README" =2D "See 'doc/README' in the distribution.")))) + (license (x11-style "file://doc/README" + "See 'doc/README' in the distribution."))))) =2D-=20 2.10.2 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Updated patch attached! Leo Famulari writes: > On Fri, Nov 04, 2016 at 10:52:55AM -0400, Kei Kebreau wrote: > > Thanks! > >> From cc7a61d61160817ceb395b648b18c885175441e8 Mon Sep 17 00:00:00 2001 >> From: Kei Kebreau >> Date: Fri, 4 Nov 2016 10:48:53 -0400 >> Subject: [PATCH] gnu: w3m: Switch to Debian's actively maintained fork o= f w3m. >>=20 >> Fixes some security issues seen here: >> >>=20 >> * gnu/packages/w3m.scm (w3m): Switch to Debian's actively maintained >> fork of w3m. > > No need to rewrite the commit title here :) > Got it. :) >> [source]: Use Debian's git tree. Remove obsolete patches. >> [arguments]: Remove unnecessary modification of %standard-phases. >> * gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch: Delete file. >> * gnu/packages/patches/w3m-disable-weak-ciphers.patch: Delete file. >> * gnu/packages/patches/w3m-force-ssl_verify_server-on.patch: Delete file. >> * gnu/packages/patches/w3m-libgc.patch: Delete file. > > Or: > * gnu/packages/patches/w3m-disable-sslv2-and-sslv3.patch, > gnu/packages/patches/w3m-disable-weak-ciphers.patch, > gnu/packages/patches/w3m-force-ssl_verify_server-on.patch, > gnu/packages/patches/w3m-libgc.patch: Delete files. > Fixed. > By the way, I double-checked that all these patches are indeed > integrated into the release tag used by this package definition. > I checked, too! Nice to know that we're doubly safe. >> (define-public w3m >> @@ -36,33 +37,16 @@ >> (name "w3m") >> (version "0.5.3") > > This should reflect the tag used in (commit). > I adjusted this according to what some other packages have done. Please tell me if I did it correctly. >> (source (origin >> - (method url-fetch) >> - (uri (string-append "mirror://sourceforge/" name "/" name = "/" >> - name "-" version "/" >> - name "-" version ".tar.gz")) >> - (sha256 >> - (base32 >> - "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579")) >> - >> - ;; cf. https://bugs.archlinux.org/task/33397 >> - (patches (search-patches "w3m-libgc.patch" >> - "w3m-force-ssl_verify_server-on.p= atch" >> - "w3m-disable-sslv2-and-sslv3.patc= h" >> - "w3m-disable-weak-ciphers.patch")= ))) >> + (method git-fetch) >> + ;; Debian's fork of w3m is the only one that is still mai= ntained. >> + (uri (git-reference >> + (url "https://anonscm.debian.org/cgit/collab-maint/= w3m.git") >> + (commit "v0.5.3+git20161031"))) > >> - (substitute* '("scripts/w3mmail.cgi.in" >> - "scripts/dirlist.cgi.in") >> - (("@PERL@") (which "perl")))) > > Does this @PERL@ get patched correctly? > No, it does not! I added the substitution back in. The other substitution appears to be handled by Debian upstream. > Thanks for taking this on! You're welcome! It frees up other developers' time to handle larger hacking targets than I can muster. --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYHL++AAoJEOal7jwZRnoNoUgP/3jYKC3aCS7uvOCuttEFQJR1 nzZcafKtN1pZjtuKEqRiab5O2FstXae2ymeHLQSKo5YkBsmLwFtUSzMLhcdo1kDN XI4g0u0vbVYioouaLNz3nBJI3N2KT4zpnJU1LmejtI+4bCRog35b7/rHR51XNrbW wcVcUwvoI+UElocp+hcAtwRY7TOVbrWCFYUAbAYCVyl3XIkcvptpYiqliXBJtOMj pLI21zi+0Cxe0SEcHM6ldsHoIbOY4Dlgzu8nJwW/g9CC91LMkcc7S8cbjkpiU0JP 5cRUHEOSmwO+4A0u0uhEgCvYKyneAxLgIWXkdEkF8Y54iVmgjj64YXV83XY69HKA bucuHrDeEUfyxWY/DrYvg5j5Ja11VjB7cbOucImfSC/63ddZGExO/SF6rjX+Y0Vq O8MOoxOuzp7iBT5qOsni/Rla/5FD9+gayOMbqLwLpQShr3BIwWkkOqaTmDPGumce 8NP3pkNgkO5782jAzBQR7kid3sk8k++F60drjRdbLg8q213FwGDO+0JGaw98UJpI H/Y7yibPLbAz1y/iHCtq9ID02zqWzGYsTApPEvXb0CBd71axLSEx8LhJn3DuMDx7 why9BZAOO0S+GVhV5xioCWNCCEO7DrTSN5b9rilHTXh27UlLbemVbowM4CkWot+x E8/ArzaJail+RaWFd1lZ =E/J2 -----END PGP SIGNATURE----- --==-=-=--