summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-09-03 19:20:06 +0200
committerMarius Bakke <mbakke@fastmail.com>2018-09-03 19:20:06 +0200
commit70dc8db8e7a44e0357c6b0582a710a918bd2e353 (patch)
tree083102cf532c523068f018e2b113947ca6a3db02 /gnu/packages/patches
parent279ed3efee9c71116d368163f805fe9494518687 (diff)
parentc702749dfd47ea6983768cd5b8cf828898445af0 (diff)
downloadguix-70dc8db8e7a44e0357c6b0582a710a918bd2e353.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/dropbear-CVE-2018-15599.patch240
-rw-r--r--gnu/packages/patches/haskell-mode-make-check.patch35
-rw-r--r--gnu/packages/patches/haskell-mode-unused-variables.patch44
-rw-r--r--gnu/packages/patches/netsurf-message-timestamp.patch11
-rw-r--r--gnu/packages/patches/netsurf-system-utf8proc.patch25
-rw-r--r--gnu/packages/patches/openexr-missing-samples.patch23
-rw-r--r--gnu/packages/patches/rust-1.19-mrustc.patch28
7 files changed, 371 insertions, 35 deletions
diff --git a/gnu/packages/patches/dropbear-CVE-2018-15599.patch b/gnu/packages/patches/dropbear-CVE-2018-15599.patch
new file mode 100644
index 0000000000..a474552cd2
--- /dev/null
+++ b/gnu/packages/patches/dropbear-CVE-2018-15599.patch
@@ -0,0 +1,240 @@
+Fix CVE-2018-15599:
+
+http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/2018q3/002108.html
+https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-15599
+
+Patch copied from upstream source repository:
+
+https://github.com/mkj/dropbear/commit/52adbb34c32d3e2e1bcdb941e20a6f81138b8248
+
+From 52adbb34c32d3e2e1bcdb941e20a6f81138b8248 Mon Sep 17 00:00:00 2001
+From: Matt Johnston <matt@ucc.asn.au>
+Date: Thu, 23 Aug 2018 23:43:12 +0800
+Subject: [PATCH] Wait to fail invalid usernames
+
+---
+ auth.h           |  6 +++---
+ svr-auth.c       | 19 +++++--------------
+ svr-authpam.c    | 26 ++++++++++++++++++++++----
+ svr-authpasswd.c | 27 ++++++++++++++-------------
+ svr-authpubkey.c | 11 ++++++++++-
+ 5 files changed, 54 insertions(+), 35 deletions(-)
+
+diff --git a/auth.h b/auth.h
+index da498f5b..98f54683 100644
+--- a/auth.h
++++ b/auth.h
+@@ -37,9 +37,9 @@ void recv_msg_userauth_request(void);
+ void send_msg_userauth_failure(int partial, int incrfail);
+ void send_msg_userauth_success(void);
+ void send_msg_userauth_banner(const buffer *msg);
+-void svr_auth_password(void);
+-void svr_auth_pubkey(void);
+-void svr_auth_pam(void);
++void svr_auth_password(int valid_user);
++void svr_auth_pubkey(int valid_user);
++void svr_auth_pam(int valid_user);
+ 
+ #if DROPBEAR_SVR_PUBKEY_OPTIONS_BUILT
+ int svr_pubkey_allows_agentfwd(void);
+diff --git a/svr-auth.c b/svr-auth.c
+index c19c0901..edde86bc 100644
+--- a/svr-auth.c
++++ b/svr-auth.c
+@@ -149,10 +149,8 @@ void recv_msg_userauth_request() {
+ 		if (methodlen == AUTH_METHOD_PASSWORD_LEN &&
+ 				strncmp(methodname, AUTH_METHOD_PASSWORD,
+ 					AUTH_METHOD_PASSWORD_LEN) == 0) {
+-			if (valid_user) {
+-				svr_auth_password();
+-				goto out;
+-			}
++			svr_auth_password(valid_user);
++			goto out;
+ 		}
+ 	}
+ #endif
+@@ -164,10 +162,8 @@ void recv_msg_userauth_request() {
+ 		if (methodlen == AUTH_METHOD_PASSWORD_LEN &&
+ 				strncmp(methodname, AUTH_METHOD_PASSWORD,
+ 					AUTH_METHOD_PASSWORD_LEN) == 0) {
+-			if (valid_user) {
+-				svr_auth_pam();
+-				goto out;
+-			}
++			svr_auth_pam(valid_user);
++			goto out;
+ 		}
+ 	}
+ #endif
+@@ -177,12 +173,7 @@ void recv_msg_userauth_request() {
+ 	if (methodlen == AUTH_METHOD_PUBKEY_LEN &&
+ 			strncmp(methodname, AUTH_METHOD_PUBKEY,
+ 				AUTH_METHOD_PUBKEY_LEN) == 0) {
+-		if (valid_user) {
+-			svr_auth_pubkey();
+-		} else {
+-			/* pubkey has no failure delay */
+-			send_msg_userauth_failure(0, 0);
+-		}
++		svr_auth_pubkey(valid_user);
+ 		goto out;
+ 	}
+ #endif
+diff --git a/svr-authpam.c b/svr-authpam.c
+index 05e4f3e5..d201bc96 100644
+--- a/svr-authpam.c
++++ b/svr-authpam.c
+@@ -178,13 +178,14 @@ pamConvFunc(int num_msg,
+  * Keyboard interactive would be a lot nicer, but since PAM is synchronous, it
+  * gets very messy trying to send the interactive challenges, and read the
+  * interactive responses, over the network. */
+-void svr_auth_pam() {
++void svr_auth_pam(int valid_user) {
+ 
+ 	struct UserDataS userData = {NULL, NULL};
+ 	struct pam_conv pamConv = {
+ 		pamConvFunc,
+ 		&userData /* submitted to pamvConvFunc as appdata_ptr */ 
+ 	};
++	const char* printable_user = NULL;
+ 
+ 	pam_handle_t* pamHandlep = NULL;
+ 
+@@ -204,12 +205,23 @@ void svr_auth_pam() {
+ 
+ 	password = buf_getstring(ses.payload, &passwordlen);
+ 
++	/* We run the PAM conversation regardless of whether the username is valid
++	in case the conversation function has an inherent delay.
++	Use ses.authstate.username rather than ses.authstate.pw_name.
++	After PAM succeeds we then check the valid_user flag too */
++
+ 	/* used to pass data to the PAM conversation function - don't bother with
+ 	 * strdup() etc since these are touched only by our own conversation
+ 	 * function (above) which takes care of it */
+-	userData.user = ses.authstate.pw_name;
++	userData.user = ses.authstate.username;
+ 	userData.passwd = password;
+ 
++	if (ses.authstate.pw_name) {
++		printable_user = ses.authstate.pw_name;
++	} else {
++		printable_user = "<invalid username>";
++	}
++
+ 	/* Init pam */
+ 	if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ 		dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", 
+@@ -242,7 +254,7 @@ void svr_auth_pam() {
+ 				rc, pam_strerror(pamHandlep, rc));
+ 		dropbear_log(LOG_WARNING,
+ 				"Bad PAM password attempt for '%s' from %s",
+-				ses.authstate.pw_name,
++				printable_user,
+ 				svr_ses.addrstring);
+ 		send_msg_userauth_failure(0, 1);
+ 		goto cleanup;
+@@ -253,12 +265,18 @@ void svr_auth_pam() {
+ 				rc, pam_strerror(pamHandlep, rc));
+ 		dropbear_log(LOG_WARNING,
+ 				"Bad PAM password attempt for '%s' from %s",
+-				ses.authstate.pw_name,
++				printable_user,
+ 				svr_ses.addrstring);
+ 		send_msg_userauth_failure(0, 1);
+ 		goto cleanup;
+ 	}
+ 
++	if (!valid_user) {
++		/* PAM auth succeeded but the username isn't allowed in for another reason
++		(checkusername() failed) */
++		send_msg_userauth_failure(0, 1);
++	}
++
+ 	/* successful authentication */
+ 	dropbear_log(LOG_NOTICE, "PAM password auth succeeded for '%s' from %s",
+ 			ses.authstate.pw_name,
+diff --git a/svr-authpasswd.c b/svr-authpasswd.c
+index bdee2aa1..69c7d8af 100644
+--- a/svr-authpasswd.c
++++ b/svr-authpasswd.c
+@@ -48,22 +48,14 @@ static int constant_time_strcmp(const char* a, const char* b) {
+ 
+ /* Process a password auth request, sending success or failure messages as
+  * appropriate */
+-void svr_auth_password() {
++void svr_auth_password(int valid_user) {
+ 	
+ 	char * passwdcrypt = NULL; /* the crypt from /etc/passwd or /etc/shadow */
+ 	char * testcrypt = NULL; /* crypt generated from the user's password sent */
+-	char * password;
++	char * password = NULL;
+ 	unsigned int passwordlen;
+-
+ 	unsigned int changepw;
+ 
+-	passwdcrypt = ses.authstate.pw_passwd;
+-
+-#ifdef DEBUG_HACKCRYPT
+-	/* debugging crypt for non-root testing with shadows */
+-	passwdcrypt = DEBUG_HACKCRYPT;
+-#endif
+-
+ 	/* check if client wants to change password */
+ 	changepw = buf_getbool(ses.payload);
+ 	if (changepw) {
+@@ -73,12 +65,21 @@ void svr_auth_password() {
+ 	}
+ 
+ 	password = buf_getstring(ses.payload, &passwordlen);
+-
+-	/* the first bytes of passwdcrypt are the salt */
+-	testcrypt = crypt(password, passwdcrypt);
++	if (valid_user) {
++		/* the first bytes of passwdcrypt are the salt */
++		passwdcrypt = ses.authstate.pw_passwd;
++		testcrypt = crypt(password, passwdcrypt);
++	}
+ 	m_burn(password, passwordlen);
+ 	m_free(password);
+ 
++	/* After we have got the payload contents we can exit if the username
++	is invalid. Invalid users have already been logged. */
++	if (!valid_user) {
++		send_msg_userauth_failure(0, 1);
++		return;
++	}
++
+ 	if (testcrypt == NULL) {
+ 		/* crypt() with an invalid salt like "!!" */
+ 		dropbear_log(LOG_WARNING, "User account '%s' is locked",
+diff --git a/svr-authpubkey.c b/svr-authpubkey.c
+index aa6087c9..ff481c87 100644
+--- a/svr-authpubkey.c
++++ b/svr-authpubkey.c
+@@ -79,7 +79,7 @@ static int checkfileperm(char * filename);
+ 
+ /* process a pubkey auth request, sending success or failure message as
+  * appropriate */
+-void svr_auth_pubkey() {
++void svr_auth_pubkey(int valid_user) {
+ 
+ 	unsigned char testkey; /* whether we're just checking if a key is usable */
+ 	char* algo = NULL; /* pubkey algo */
+@@ -102,6 +102,15 @@ void svr_auth_pubkey() {
+ 	keybloblen = buf_getint(ses.payload);
+ 	keyblob = buf_getptr(ses.payload, keybloblen);
+ 
++	if (!valid_user) {
++		/* Return failure once we have read the contents of the packet
++		required to validate a public key. 
++		Avoids blind user enumeration though it isn't possible to prevent
++		testing for user existence if the public key is known */
++		send_msg_userauth_failure(0, 0);
++		goto out;
++	}
++
+ 	/* check if the key is valid */
+ 	if (checkpubkey(algo, algolen, keyblob, keybloblen) == DROPBEAR_FAILURE) {
+ 		send_msg_userauth_failure(0, 0);
diff --git a/gnu/packages/patches/haskell-mode-make-check.patch b/gnu/packages/patches/haskell-mode-make-check.patch
new file mode 100644
index 0000000000..a4d4d525f2
--- /dev/null
+++ b/gnu/packages/patches/haskell-mode-make-check.patch
@@ -0,0 +1,35 @@
+Copied from upstream repository.
+Hunk #2 is removed since it cannot be applied and it is not needed.
+
+From 7cead7137bf54851c1b7df5a3854351296d21276 Mon Sep 17 00:00:00 2001
+From: Vasantha Ganesh K <vasanthaganesh.k@tuta.io>
+Date: Thu, 22 Jun 2017 23:38:40 +0530
+Subject: [PATCH] removed `check-conventions' from make
+
+---
+ Makefile                          |   7 +-
+ tests/haskell-code-conventions.el | 165 ------------------------------
+ 2 files changed, 1 insertion(+), 171 deletions(-)
+ delete mode 100644 tests/haskell-code-conventions.el
+
+diff --git a/Makefile b/Makefile
+index b2c89d6..aa907c5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -79,12 +79,7 @@ build-$(EMACS_VERSION)/build-flag : build-$(EMACS_VERSION) $(patsubst %.el,build
+ check-%: tests/%-tests.el
+ 	$(BATCH) -l "$<" -f ert-run-tests-batch-and-exit;
+ 
+-check: compile $(AUTOLOADS) check-ert check-conventions
+-
+-check-conventions :
+-	$(BATCH) -l tests/haskell-code-conventions.el                                           \
+-                 -f haskell-check-conventions-batch-and-exit
+-	@echo "conventions are okay"
++check: compile $(AUTOLOADS) check-ert
+ 
+ check-ert: $(ELCHECKS)
+ 	$(BATCH) --eval "(when (= emacs-major-version 24)					\
+-- 
+2.18.0
+
diff --git a/gnu/packages/patches/haskell-mode-unused-variables.patch b/gnu/packages/patches/haskell-mode-unused-variables.patch
new file mode 100644
index 0000000000..b175fae28c
--- /dev/null
+++ b/gnu/packages/patches/haskell-mode-unused-variables.patch
@@ -0,0 +1,44 @@
+Copied verbatim from upstream repository.
+
+From cee22450ee30e79952f594796721dc6b17798ee6 Mon Sep 17 00:00:00 2001
+From: Sascha Wilde <wilde@sha-bang.de>
+Date: Fri, 23 Sep 2016 15:35:59 +0200
+Subject: [PATCH] Removed unused lexical variables.
+
+---
+ haskell-lexeme.el  | 3 +--
+ haskell-process.el | 4 +---
+ 2 files changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/haskell-lexeme.el b/haskell-lexeme.el
+index 4256a79..b832560 100644
+--- a/haskell-lexeme.el
++++ b/haskell-lexeme.el
+@@ -138,8 +138,7 @@ When match is successful, match-data will contain:
+   (match-text 2) - whole qualified identifier
+   (match-text 3) - unqualified part of identifier
+   (match-text 4) - closing backtick"
+-  (let ((begin (point))
+-        (match-data-old (match-data))
++  (let ((match-data-old (match-data))
+         first-backtick-start
+         last-backtick-start
+         qid-start
+diff --git a/haskell-process.el b/haskell-process.el
+index b4efba2..4f3f859 100644
+--- a/haskell-process.el
++++ b/haskell-process.el
+@@ -160,9 +160,7 @@ HPTYPE is the result of calling `'haskell-process-type`' function."
+ (defun haskell-process-log (msg)
+   "Effective append MSG to the process log (if enabled)."
+   (when haskell-process-log
+-    (let* ((append-to (get-buffer-create "*haskell-process-log*"))
+-           (windows (get-buffer-window-list append-to t t))
+-           move-point-in-windows)
++    (let* ((append-to (get-buffer-create "*haskell-process-log*")))
+       (with-current-buffer append-to
+         ;; point should follow insertion so that it stays at the end
+         ;; of the buffer
+-- 
+2.18.0
+
diff --git a/gnu/packages/patches/netsurf-message-timestamp.patch b/gnu/packages/patches/netsurf-message-timestamp.patch
new file mode 100644
index 0000000000..8df9dbf8f7
--- /dev/null
+++ b/gnu/packages/patches/netsurf-message-timestamp.patch
@@ -0,0 +1,11 @@
+--- netsurf-3.8/utils/split-messages.pl.orig	1969-12-31 18:00:00.000000000 -0600
++++ netsurf-3.8/utils/split-messages.pl	2018-08-30 00:18:58.158367530 -0500
+@@ -238,7 +238,7 @@
+ 
+     if( $opt{gzip} )
+     {
+-        $ofh = new IO::Compress::Gzip( $ofh, AutoClose => 1, -Level => 9 );
++        $ofh = new IO::Compress::Gzip( $ofh, AutoClose => 1, -Level => 9, Time => 0 );
+     }
+ 
+     return $ofh;
diff --git a/gnu/packages/patches/netsurf-system-utf8proc.patch b/gnu/packages/patches/netsurf-system-utf8proc.patch
index 654d45d017..a2ee52ca05 100644
--- a/gnu/packages/patches/netsurf-system-utf8proc.patch
+++ b/gnu/packages/patches/netsurf-system-utf8proc.patch
@@ -17,23 +17,23 @@ Work around upstream's lack of a pkg-config file and update API.
  
  # Optional libraries with pkgconfig
  
---- netsurf-3.6/utils/idna.c
-+++ netsurf-3.6/utils/idna.c
-@@ -26,7 +26,7 @@
- #include <stdint.h>
+--- netsurf-3.8/utils/idna.c
++++ netsurf-3.8/utils/idna.c
+@@ -27,7 +27,7 @@
  #include <stdlib.h>
  #include <string.h>
+ #include <sys/types.h>
 -#include <libutf8proc/utf8proc.h>
 +#include <utf8proc.h>
  
- #include "utils/errors.h"
- #include "utils/idna.h"
---- netsurf-3.7/test/Makefile	2017-10-15 08:39:24.000000000 -0500
-+++ netsurf-3.7/test/Makefile	2017-11-05 11:14:46.219013218 -0600
-@@ -139,14 +139,14 @@
- 	-D_XOPEN_SOURCE=600 \
+ #include "netsurf/inttypes.h"
+ 
+--- netsurf-3.8/test/Makefile
++++ netsurf-3.8/test/Makefile
+@@ -142,14 +142,15 @@
  	-Itest -Iinclude -Icontent/handlers -Ifrontends -I. -I.. \
  	-Dnsgtk \
+ 	$(SAN_FLAGS) \
 -	$(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc) \
 +	$(shell pkg-config --cflags libcurl libparserutils libwapcaplet libdom libnsutils) \
  	$(LIB_CFLAGS)
@@ -43,7 +43,8 @@ Work around upstream's lack of a pkg-config file and update API.
  
  TESTLDFLAGS := -L$(TESTROOT) \
 -	$(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils libutf8proc) -lz \
-+	$(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils) -lz -lutf8proc \
++	$(shell pkg-config --libs libcurl libparserutils libwapcaplet libdom libnsutils) \
++	$(LDFLAGS) \
+ 	$(SAN_FLAGS) \
  	$(LIB_LDFLAGS)\
  	$(COV_LDFLAGS)
- 
diff --git a/gnu/packages/patches/openexr-missing-samples.patch b/gnu/packages/patches/openexr-missing-samples.patch
deleted file mode 100644
index 16cc9bb625..0000000000
--- a/gnu/packages/patches/openexr-missing-samples.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-This patch comments out tests that rely on files that are missing
-from the source tarball.
-
---- openexr-2.2.0/IlmImfTest/testSampleImages.cpp	2015-02-25 16:19:21.565105625 +0100
-+++ openexr-2.2.0/IlmImfTest/testSampleImages.cpp	2015-02-25 16:21:46.394128206 +0100
-@@ -162,16 +162,6 @@ testSampleImages (const std::string&)
- 	compareImages (ILM_IMF_TEST_IMAGEDIR "comp_b44.exr",
- 		       ILM_IMF_TEST_IMAGEDIR "comp_b44_piz.exr");
- 
--	compareImages (ILM_IMF_TEST_IMAGEDIR "comp_dwaa_v1.exr",
--		       ILM_IMF_TEST_IMAGEDIR "comp_dwaa_piz.exr");
--	compareImages (ILM_IMF_TEST_IMAGEDIR "comp_dwaa_v2.exr",
--		       ILM_IMF_TEST_IMAGEDIR "comp_dwaa_piz.exr");
--
--	compareImages (ILM_IMF_TEST_IMAGEDIR "comp_dwab_v1.exr",
--		       ILM_IMF_TEST_IMAGEDIR "comp_dwab_piz.exr");
--	compareImages (ILM_IMF_TEST_IMAGEDIR "comp_dwab_v2.exr",
--		       ILM_IMF_TEST_IMAGEDIR "comp_dwab_piz.exr");
--
- 
- 	cout << "ok\n" << endl;
-     }
-
diff --git a/gnu/packages/patches/rust-1.19-mrustc.patch b/gnu/packages/patches/rust-1.19-mrustc.patch
new file mode 100644
index 0000000000..261162172e
--- /dev/null
+++ b/gnu/packages/patches/rust-1.19-mrustc.patch
@@ -0,0 +1,28 @@
+See https://github.com/thepowersgang/mrustc/archive/v0.8.0.tar.gz
+
+--- rustc-1.19.0-src-orig/src/libcore/intrinsics.rs
++++ rustc-1.19.0-src/src/libcore/intrinsics.rs
+@@ -678,5 +678,9 @@
+     pub fn min_align_of_val<T: ?Sized>(_: &T) -> usize;
+ 
++    /// Obtain the length of a slice pointer
++    #[cfg(rust_compiler="mrustc")]
++    pub fn mrustc_slice_len<T>(pointer: *const [T]) -> usize;
++
+     /// Gets a static string slice containing the name of a type.
+     pub fn type_name<T: ?Sized>() -> &'static str;
+
+--- rustc-1.19.0-src-orig/src/libcore/slice/mod.rs
++++ rustc-1.19.0-src/src/libcore/slice/mod.rs
+@@ -413,6 +413,8 @@
+     #[inline]
+     fn len(&self) -> usize {
+-        unsafe {
+-            mem::transmute::<&[T], Repr<T>>(self).len
+-        }
++        #[cfg(not(rust_compiler="mrustc"))]
++        let rv = unsafe { mem::transmute::<&[T], Repr<T>>(self).len };
++        #[cfg(rust_compiler="mrustc")]
++        let rv = unsafe { ::intrinsics::mrustc_slice_len(self) };
++        rv
+     }