[mutt] 02/02: Add patch dont-whine-if-getrandom-fails
Faidon Liambotis
paravoid at moszumanska.debian.org
Mon Aug 8 11:51:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
paravoid pushed a commit to branch master
in repository mutt.
commit 458e0e73718bb4c4dcbefbe0c1e6e62647df9c15
Author: Faidon Liambotis <paravoid at debian.org>
Date: Mon Aug 8 14:50:00 2016 +0300
Add patch dont-whine-if-getrandom-fails
Add a patch to avoid a warning message if getrandom() fails. This should
help not scare off users that are running a jessie kernel, among others.
Thanks to Adam Borowski for the fix. (Closes: #833593)
Patch forwarded to neomutt and already merged there.
---
debian/changelog | 5 ++-
.../dont-whine-if-getrandom-fails.patch | 44 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 28553d5..249f5aa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,8 +5,11 @@ mutt (1.6.2-2) UNRELEASED; urgency=medium
- Drop patch debian/patches/features/multiple-fcc.patch, merged upstream.
- Drop patch imap-sidebar-update-bug.patch, was an upstream backport.
- Refresh patch neomutt-devel/sensible-browser.patch.
+ * Add a patch to avoid a warning message if getrandom() fails. This should
+ help not scare off users that are running a jessie kernel, among others.
+ Thanks to Adam Borowski for the fix. (Closes: #833593)
- -- Faidon Liambotis <paravoid at debian.org> Mon, 08 Aug 2016 14:43:51 +0300
+ -- Faidon Liambotis <paravoid at debian.org> Mon, 08 Aug 2016 14:48:05 +0300
mutt (1.6.2-1) unstable; urgency=medium
diff --git a/debian/patches/neomutt-devel/dont-whine-if-getrandom-fails.patch b/debian/patches/neomutt-devel/dont-whine-if-getrandom-fails.patch
new file mode 100644
index 0000000..967dc03
--- /dev/null
+++ b/debian/patches/neomutt-devel/dont-whine-if-getrandom-fails.patch
@@ -0,0 +1,44 @@
+From 53a481f0071566740020e7b483625c9e028f098b Mon Sep 17 00:00:00 2001
+From: Adam Borowski <kilobyte at angband.pl>
+Date: Sun, 7 Aug 2016 05:48:14 +0200
+Subject: [PATCH] Don't whine if getrandom() fails.
+
+Debian for example supports kernels down to 3.2, and getrandom() appeared
+only on 3.16 on x86 or later on other archs. Current stable has only 3.16
+(ie, no getrandom() outside of x86), and ARM vendor kernels are for most
+machines even older.
+
+There is no security risk in falling back to /dev/urandom, as mutt quits
+if that fails instead of using unsecure randomness.
+---
+ muttlib.c | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/muttlib.c b/muttlib.c
+index 3e7a2c3..7812ecb 100644
+--- a/muttlib.c
++++ b/muttlib.c
+@@ -804,19 +804,13 @@ void mutt_randbuf(void *out, size_t len)
+ }
+ /* XXX switch to HAVE_GETRANDOM and getrandom() in about 2017 */
+ #if defined(SYS_getrandom) && defined(__linux__)
+- static int whined;
+ long ret;
+ do {
+ ret = syscall(SYS_getrandom, out, len, 0, 0, 0, 0);
+ } while ((ret == -1) && (errno == EINTR));
+ if (ret == len) return;
+- if (!whined) {
+- mutt_error (_("getrandom failed: %s"), strerror(errno));
+- mutt_sleep (1);
+- whined = 1;
+- }
+- /* let's try urandom in case user has configured selinux or something
+- * to not allow getrandom */
++ /* let's try urandom in case we're on an old kernel, or the user has
++ * configured selinux, seccomp or something to not allow getrandom */
+ #endif
+ if (frandom == NULL) {
+ frandom = fopen("/dev/urandom", "rb");
+--
+2.8.1
diff --git a/debian/patches/series b/debian/patches/series
index 6d85ab9..77be3a2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,6 @@
neomutt-20160808.patch
neomutt-devel/sensible-browser.patch
+neomutt-devel/dont-whine-if-getrandom-fails.patch
debian-specific/Muttrc.patch
debian-specific/Md.etc_mailname_gethostbyname.patch
debian-specific/use_usr_bin_editor.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mutt/mutt.git
More information about the pkg-mutt-commits
mailing list