about summary refs log tree commit diff
path: root/pkgs/tools/security/super
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2020-08-10 21:48:12 +0200
committerMaximilian Bosch <maximilian@mbosch.me>2020-09-12 23:04:44 +0200
commit5f5ff556234c0ec57636272fe81d950550316e7c (patch)
treeb30da8f1e27bbc38e19bd3313055793bb57ed1c0 /pkgs/tools/security/super
parent08bc71284367bf3490b0d97792dc0bc27a059ef2 (diff)
super: fix build w/glibc-2.32
Diffstat (limited to 'pkgs/tools/security/super')
-rw-r--r--pkgs/tools/security/super/0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch51
-rw-r--r--pkgs/tools/security/super/default.nix1
2 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/tools/security/super/0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch b/pkgs/tools/security/super/0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch
new file mode 100644
index 0000000000000..048486caafd78
--- /dev/null
+++ b/pkgs/tools/security/super/0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch
@@ -0,0 +1,51 @@
+From 86e37c1c09c23924c4e055a3d4b8c79f19cd0599 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Mon, 10 Aug 2020 21:33:39 +0200
+Subject: [PATCH] Remove references to dropped `sys_nerr` & `sys_errlist` for
+ `glibc-2.32` compat
+
+According to the release-notes[1], `strerror(3)` should be used. This is
+already the case, however the source tries to be backwards-compatible by
+supporting `sys_nerr` & `sys_errlist` which breaks compilation
+unfortunately.
+
+Simply using `strerror` fixes the problems.
+
+[1] https://sourceware.org/pipermail/libc-announce/2020/000029.html
+---
+ utils.c | 12 +-----------
+ 1 file changed, 1 insertion(+), 11 deletions(-)
+
+diff --git a/utils.c b/utils.c
+index 3ec70b6..430f027 100644
+--- a/utils.c
++++ b/utils.c
+@@ -2003,7 +2003,6 @@ int n;
+ 
+ #ifdef HAVE_SYS_ERRLIST
+     extern char *sys_errlist[];
+-    extern int sys_nerr;
+ #endif
+ 
+ /*
+@@ -2019,16 +2018,7 @@ int errnum;
+     sprintf(buf, "Error %d", errnum);
+     return buf;
+ #else
+-    if (errnum < 0 || errnum > sys_nerr) {
+-	sprintf(buf, "Error %d (!)", errnum);
+-	return buf;
+-    } else {
+-#ifdef HAVE_STRERROR
+-	return strerror(errnum);
+-#else
+-	return sys_errlist[errnum];
+-#endif
+-    }
++    return strerror(errnum);
+ #endif
+ }
+ 
+-- 
+2.25.4
+
diff --git a/pkgs/tools/security/super/default.nix b/pkgs/tools/security/super/default.nix
index 0705173106961..79a7cd839e5b4 100644
--- a/pkgs/tools/security/super/default.nix
+++ b/pkgs/tools/security/super/default.nix
@@ -17,6 +17,7 @@ stdenv.mkDerivation rec {
   '';
 
   patches = [
+    ./0001-Remove-references-to-dropped-sys_nerr-sys_errlist-fo.patch
     (fetchpatch {
       name = "CVE-2014-0470.patch";
       url = "https://salsa.debian.org/debian/super/raw/debian/3.30.0-7/debian/patches/14-Fix-unchecked-setuid-call.patch";