code:
Work around this GCC ICE: <https://bugs.gnu.org/31708>.  It shows up
only when doing native compiles on armhf-linux.

Yes it's a terrible patch, but it does the job.

--- doxygen-1.8.13/qtools/qutfcodec.cpp	1970-01-01 01:00:00.000000000 +0100
+++ doxygen-1.8.13/qtools/qutfcodec.cpp	2018-06-08 14:14:29.614009929 +0200
@@ -189,7 +189,7 @@ int QUtf16Codec::heuristicContentMatch(c
 }

-
+volatile const void *bomPointer = &QChar::byteOrderMark;

 class QUtf16Encoder : public QTextEncoder {
     bool headerdone;
@@ -209,7 +209,7 @@ public:
 	    headerdone = TRUE;
 	    len_in_out = (1+uc.length())*(int)sizeof(QChar);
 	    QCString d(len_in_out);
-	    memcpy(d.rawData(),&QChar::byteOrderMark,sizeof(QChar));
+	    memcpy(d.rawData(),(void *)bomPointer,sizeof(QChar));
 	    memcpy(d.rawData()+sizeof(QChar),uc.unicode(),uc.length()*sizeof(QChar));
 	    return d;
 	}


code:
Modify the expected outcome of test 012 so that it passes when bibtex is
not in the path, as we do not wish to add texlive as an input just for this
test.

diff -u -r doxygen-1.8.7.orig/testing/012/citelist.xml doxygen-1.8.7/testing/012/citelist.xml
--- doxygen-1.8.7.orig/testing/012/citelist.xml	2014-04-24 23:43:34.000000000 +0200
+++ doxygen-1.8.7/testing/012/citelist.xml	2014-04-24 23:49:43.000000000 +0200
@@ -4,17 +4,6 @@
     <compoundname>citelist</compoundname>
     <title>Bibliography</title>
     <detaileddescription>
-      <para>
-        <variablelist>
-          <varlistentry>
-            <term><anchor id="_1CITEREF_knuth79"/>[1]</term>
-          </varlistentry>
-          <listitem>
-            <para>Donald<nonbreakablespace/>E. Knuth. <emphasis>Tex and Metafont, New Directions in Typesetting</emphasis>. American Mathematical Society and Digital Press, Stanford, 1979.</para>
-            <para/>
-          </listitem>
-        </variablelist>
-      </para>
     </detaileddescription>
   </compounddef>
 </doxygen>
diff -u -r doxygen-1.8.7.orig/testing/012/indexpage.xml doxygen-1.8.7/testing/012/indexpage.xml
--- doxygen-1.8.7.orig/testing/012/indexpage.xml	2014-04-24 23:43:34.000000000 +0200
+++ doxygen-1.8.7/testing/012/indexpage.xml	2014-04-24 23:44:05.000000000 +0200
@@ -4,7 +4,7 @@
     <compoundname>index</compoundname>
     <title>My Project</title>
     <detaileddescription>
-      <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[1]</ref> for more info. </para>
+      <para>See knuth79 for more info. </para>
     </detaileddescription>
   </compounddef>
 </doxygen>

license: mit


code:
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);


code:
Without <limits.h>, INT_MAX is not defined.

diff --git a/transport.hxx b/transport.hxx
index 35a57a7..838add6 100644
--- a/transport.hxx
+++ b/transport.hxx
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
+#include <limits.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>


code:
These patches are required to build with a modern GCC; most of them
are taken from the Debian package. Upstream has disappeared.

diff -r -u einstein-2.0.orig/convert.h einstein-2.0/convert.h
--- einstein-2.0.orig/convert.h	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/convert.h	2016-03-05 18:25:08.488917021 +0100
@@ -5,6 +5,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
+#include <typeinfo>

 #include "exceptions.h"
 #include "unicode.h"
diff -r -u einstein-2.0.orig/descr.cpp einstein-2.0/descr.cpp
--- einstein-2.0.orig/descr.cpp	2005-08-17 15:42:29.000000000 +0200
+++ einstein-2.0/descr.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -139,9 +139,9 @@
 {
     currentPage = 0;
     //area.add(parentArea, false);
-    titleFont = new Font(L"nova.ttf", 26);
-    buttonFont = new Font(L"laudcn2.ttf", 14);
-    textFont = new Font(L"laudcn2.ttf", 16);
+    titleFont = new Font(L"DejaVuSans.ttf", 26);
+    buttonFont = new Font(L"DejaVuSans.ttf", 14);
+    textFont = new Font(L"DejaVuSans.ttf", 16);
     textHeight = (int)(textFont->getHeight(L"A") * 1.0);
     text = new TextParser(msg(L"rulesText"), *textFont, START_X, START_Y,
                 CLIENT_WIDTH, CLIENT_HEIGHT);
diff -r -u einstein-2.0.orig/font.h einstein-2.0/font.h
--- einstein-2.0.orig/font.h	2005-08-16 00:33:17.000000000 +0200
+++ einstein-2.0/font.h	2016-03-05 18:22:05.563794039 +0100
@@ -3,7 +3,7 @@

 #include <string>
-#include <SDL_ttf.h>
+#include <SDL/SDL_ttf.h>

 class Font
diff -r -u einstein-2.0.orig/formatter.cpp einstein-2.0/formatter.cpp
--- einstein-2.0.orig/formatter.cpp	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/formatter.cpp	2016-03-05 18:18:41.146882565 +0100
@@ -58,7 +58,7 @@
             if ((c.type == INT_ARG) || (c.type == STRING_ARG) ||
                     (c.type == FLOAT_ARG) || (c.type == DOUBLE_ARG))
             {
-                int no = (int)c.data;
+                long no = (long)c.data;
                 args[no - 1] = c.type;
             }
         }
@@ -123,7 +123,7 @@
 std::wstring Formatter::format(std::vector<ArgValue*> &argValues) const
 {
     std::wstring s;
-    int no;
+    long no;

     for (int i = 0; i < commandsCnt; i++) {
         Command *cmd = &commands[i];
@@ -135,8 +135,8 @@

             case STRING_ARG:
             case INT_ARG:
-                no = (int)cmd->data - 1;
-                if (no < (int)argValues.size())
+                no = (long)cmd->data - 1;
+                if (no < (long)argValues.size())
                     s += argValues[no]->format(cmd);
                 break;

diff -r -u einstein-2.0.orig/game.cpp einstein-2.0/game.cpp
--- einstein-2.0.orig/game.cpp	2005-08-23 00:44:54.000000000 +0200
+++ einstein-2.0/game.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -33,7 +33,7 @@
     screen.draw(8, 10, tile);
     SDL_FreeSurface(tile);

-    Font titleFont(L"nova.ttf", 28);
+    Font titleFont(L"DejaVuSans.ttf", 28);
     titleFont.draw(screen.getSurface(), 20, 20, 255,255,0, true,
             msg(L"einsteinPuzzle"));

@@ -89,7 +89,7 @@
 {
     lastRun = elapsed = lastUpdate = 0;
     stop();
-    font = new Font(L"luximb.ttf", 16);
+    font = new Font(L"DejaVuSans.ttf", 16);
 }

 Watch::Watch(std::istream &stream)
@@ -97,7 +97,7 @@
     elapsed = readInt(stream);
     lastUpdate = 0;
     stop();
-    font = new Font(L"luximb.ttf", 16);
+    font = new Font(L"DejaVuSans.ttf", 16);
 }

 Watch::~Watch()
@@ -178,7 +178,7 @@
             watch->stop();
             Area area;
             area.add(background, false);
-            Font font(L"laudcn2.ttf", 16);
+            Font font(L"DejaVuSans.ttf", 16);
             area.add(new Window(280, 275, 240, 50, L"greenpattern.bmp", 6));
             area.add(new Label(&font, 280, 275, 240, 50, Label::ALIGN_CENTER,
                 Label::ALIGN_MIDDLE, 255,255,0, msg(L"paused")));
@@ -209,7 +209,7 @@
         virtual void doAction() {
             sound->play(L"applause.wav");
             watch->stop();
-            Font font(L"laudcn2.ttf", 20);
+            Font font(L"DejaVuSans.ttf", 20);
             showMessageWindow(gameArea, L"marble1.bmp",
                     500, 70, &font, 255,0,0, msg(L"won"));
             gameArea->draw();
@@ -257,8 +257,8 @@
             sound->play(L"glasbk2.wav");
             bool restart = false;
             bool newGame = false;
-            Font font(L"laudcn2.ttf", 24);
-            Font btnFont(L"laudcn2.ttf", 14);
+            Font font(L"DejaVuSans.ttf", 24);
+            Font btnFont(L"DejaVuSans.ttf", 14);
             Area area;
             area.add(gameArea);
             area.add(new Window(220, 240, 360, 140, L"redpattern.bmp", 6));
@@ -329,7 +329,7 @@
         CheatCommand(Area *a) { gameArea = a; };

         virtual void doAction() {
-            Font font(L"nova.ttf", 30);
+            Font font(L"DejaVuSans.ttf", 30);
             showMessageWindow(gameArea, L"darkpattern.bmp",
                     500, 100, &font, 255,255,255,
                     msg(L"iddqd"));
@@ -475,7 +475,7 @@
     drawWallpaper(L"rain.bmp");
     Window window(230, 260, 340, 80, L"greenpattern.bmp", 6);
     window.draw();
-    Font font(L"laudcn2.ttf", 16);
+    Font font(L"DejaVuSans.ttf", 16);
     Label label(&font, 280, 275, 240, 50, Label::ALIGN_CENTER,
                 Label::ALIGN_MIDDLE, 255,255,0, msg(L"loading"));
     label.draw();
@@ -533,7 +533,7 @@
 void Game::run()
 {
     Area area;
-    Font btnFont(L"laudcn2.ttf", 14);
+    Font btnFont(L"DejaVuSans.ttf", 14);

     area.setTimer(300, watch);

diff -r -u einstein-2.0.orig/main.cpp einstein-2.0/main.cpp
--- einstein-2.0.orig/main.cpp	2005-09-26 12:32:54.000000000 +0200
+++ einstein-2.0/main.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -2,7 +2,7 @@
 #include <iostream>
 #include <SDL.h>
 #include <SDL_main.h>
-#include <SDL_ttf.h>
+#include <SDL/SDL_ttf.h>
 #include "main.h"
 #include "utils.h"
 #include "storage.h"
@@ -78,7 +78,7 @@
 /*static void checkBetaExpire()
 {
     if (1124832535L + 60L*60L*24L*40L < time(NULL)) {
-        Font font(L"laudcn2.ttf", 16);
+        Font font(L"DejaVuSans.ttf", 16);
         Area area;
         showMessageWindow(&area, L"darkpattern.bmp",
                 700, 100, &font, 255,255,255,
diff -r -u einstein-2.0.orig/Makefile einstein-2.0/Makefile
--- einstein-2.0.orig/Makefile	2005-09-25 23:20:30.000000000 +0200
+++ einstein-2.0/Makefile	2016-03-05 18:14:22.365450608 +0100
@@ -49,10 +49,14 @@

 $(TARGET): $(OBJECTS)
+	cd mkres && make
+	cd res && ../mkres/mkres --source resources.descr --output ../einstein.res
 	$(CXX) $(LNFLAGS) $(OBJECTS) -o $(TARGET)

 clean:
 	rm -f $(OBJECTS) core* *core $(TARGET) *~
+	cd res && rm -f einstein.res
+	cd mkres && make clean

 depend:
 	@makedepend $(SOURCES) 2> /dev/null
diff -r -u einstein-2.0.orig/menu.cpp einstein-2.0/menu.cpp
--- einstein-2.0.orig/menu.cpp	2005-09-25 22:51:00.000000000 +0200
+++ einstein-2.0/menu.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -23,11 +23,11 @@
     SDL_Surface *title = loadImage(L"nova.bmp");
     screen.draw(0, 0, title);
     SDL_FreeSurface(title);
-    Font font(L"nova.ttf", 28);
+    Font font(L"DejaVuSans.ttf", 28);
     std::wstring s(msg(L"einsteinFlowix"));
     int width = font.getWidth(s);
     font.draw((screen.getWidth() - width) / 2, 30, 255,255,255, true, s);
-    Font urlFont(L"luximb.ttf", 16);
+    Font urlFont(L"DejaVuSans.ttf", 16);
     s = L"http://games.flowix.com";
     width = urlFont.getWidth(s);
     urlFont.draw((screen.getWidth() - width) / 2, 60, 255,255,0, true, s);
@@ -133,9 +133,9 @@

         virtual void doAction() {
             Area area;
-            Font titleFont(L"nova.ttf", 26);
-            Font font(L"laudcn2.ttf", 14);
-            Font urlFont(L"luximb.ttf", 16);
+            Font titleFont(L"DejaVuSans.ttf", 26);
+            Font font(L"DejaVuSans.ttf", 14);
+            Font urlFont(L"DejaVuSans.ttf", 16);

 #define LABEL(pos, c, f, text) area.add(new Label(&f, 220, pos, 360, 20, \
             Label::ALIGN_CENTER, Label::ALIGN_MIDDLE, 255,255,c, text));
@@ -171,7 +171,7 @@
 void menu()
 {
     Area area;
-    Font font(L"laudcn2.ttf", 20);
+    Font font(L"DejaVuSans.ttf", 20);

     area.add(new MenuBackground());
     area.draw();
diff -r -u einstein-2.0.orig/mkres/compressor.cpp einstein-2.0/mkres/compressor.cpp
--- einstein-2.0.orig/mkres/compressor.cpp	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/mkres/compressor.cpp	2016-03-05 18:26:13.194264129 +0100
@@ -2,6 +2,7 @@
 #include <zlib.h>
 #include "convert.h"
 #include "exceptions.h"
+#include "string.h"

 ResourceCompressor::ResourceCompressor()
diff -r -u einstein-2.0.orig/mkres/convert.h einstein-2.0/mkres/convert.h
--- einstein-2.0.orig/mkres/convert.h	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/mkres/convert.h	2016-03-05 18:25:21.479990669 +0100
@@ -5,6 +5,7 @@
 #include <iostream>
 #include <sstream>
 #include <string>
+#include <typeinfo>

 #include "exceptions.h"
 #include "unicode.h"
diff -r -u einstein-2.0.orig/mkres/main.cpp einstein-2.0/mkres/main.cpp
--- einstein-2.0.orig/mkres/main.cpp	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/mkres/main.cpp	2016-03-05 18:25:55.062765900 +0100
@@ -1,5 +1,6 @@
 #include "compressor.h"
 #include "exceptions.h"
+#include "string.h"
 #include "unicode.h"
 #include "table.h"

diff -r -u einstein-2.0.orig/mkres/unicode.cpp einstein-2.0/mkres/unicode.cpp
--- einstein-2.0.orig/mkres/unicode.cpp	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/mkres/unicode.cpp	2016-03-05 18:26:28.065492890 +0100
@@ -5,6 +5,7 @@
 #endif
 #include "unicode.h"
 #include "exceptions.h"
+#include "string.h"

 /// Returns length of wide character in utf-8
diff -r -u einstein-2.0.orig/opensave.cpp einstein-2.0/opensave.cpp
--- einstein-2.0.orig/opensave.cpp	2005-08-14 23:33:36.000000000 +0200
+++ einstein-2.0/opensave.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -160,7 +160,7 @@
 static void showListWindow(SavesList &list, Command **commands,
         const std::wstring &title, Area &area, Font *font)
 {
-    Font titleFont(L"nova.ttf", 26);
+    Font titleFont(L"DejaVuSans.ttf", 26);

     area.add(new Window(250, 90, 300, 420, L"blue.bmp"));
     area.add(new Label(&titleFont, 250, 95, 300, 40, Label::ALIGN_CENTER,
@@ -189,7 +189,7 @@

     Area area;
     area.add(parentArea, false);
-    Font font(L"laudcn2.ttf", 14);
+    Font font(L"DejaVuSans.ttf", 14);
     bool saved = false;

     SavesList list;
@@ -258,7 +258,7 @@

     Area area;
     area.add(parentArea, false);
-    Font font(L"laudcn2.ttf", 14);
+    Font font(L"DejaVuSans.ttf", 14);

     Game *newGame = NULL;

diff -r -u einstein-2.0.orig/options.cpp einstein-2.0/options.cpp
--- einstein-2.0.orig/options.cpp	2005-09-26 12:33:18.000000000 +0200
+++ einstein-2.0/options.cpp	2016-03-05 18:29:27.960352230 +0100
@@ -53,8 +53,8 @@

 void showOptionsWindow(Area *parentArea)
 {
-    Font titleFont(L"nova.ttf", 26);
-    Font font(L"laudcn2.ttf", 14);
+    Font titleFont(L"DejaVuSans.ttf", 26);
+    Font font(L"DejaVuSans.ttf", 14);

     bool fullscreen = (getStorage()->get(L"fullscreen", 1) != 0);
     bool niceCursor = (getStorage()->get(L"niceCursor", 1) != 0);
diff -r -u einstein-2.0.orig/res/resources.descr einstein-2.0/res/resources.descr
--- einstein-2.0.orig/res/resources.descr	2005-09-25 22:51:14.000000000 +0200
+++ einstein-2.0/res/resources.descr	2016-03-05 18:30:08.563704873 +0100
@@ -89,13 +89,11 @@
     { name = "title.bmp" }
     { name = "marble1.bmp" }
     { name = "blue.bmp" }
-    { name = "luximb.ttf" }
     { name = "redpattern.bmp" }
     { name = "greenpattern.bmp" }
     { name = "darkpattern.bmp" }
     { name = "nova.bmp" }
-    { name = "nova.ttf" }
-    { name = "laudcn2.ttf" }
+    { name = "DejaVuSans.ttf" }
     { name = "btn.bmp" }
     { name = "rules.txt", format = "messages" group = "messages" }
     { name = "rules_ru.txt", format = "messages" group = "messages" }
Only in einstein-2.0/res: resources.descr.orig
diff -r -u einstein-2.0.orig/sound.h einstein-2.0/sound.h
--- einstein-2.0.orig/sound.h	2005-09-24 08:24:20.000000000 +0200
+++ einstein-2.0/sound.h	2016-03-05 18:22:19.314931225 +0100
@@ -4,7 +4,7 @@

 #include <string>
 #include <map>
-#include <SDL_mixer.h>
+#include <SDL/SDL_mixer.h>

 class Sound
diff -r -u einstein-2.0.orig/topscores.cpp einstein-2.0/topscores.cpp
--- einstein-2.0.orig/topscores.cpp	2005-08-14 23:08:43.000000000 +0200
+++ einstein-2.0/topscores.cpp	2016-03-05 18:29:27.970353055 +0100
@@ -103,9 +103,9 @@
 ScoresWindow::ScoresWindow(int x, int y, TopScores *scores, int highlight):
                 Window(x, y, 320, 350, L"blue.bmp")
 {
-    Font titleFont(L"nova.ttf", 26);
-    Font entryFont(L"laudcn2.ttf", 14);
-    Font timeFont(L"luximb.ttf", 14);
+    Font titleFont(L"DejaVuSans.ttf", 26);
+    Font entryFont(L"DejaVuSans.ttf", 14);
+    Font timeFont(L"DejaVuSans.ttf", 14);

     std::wstring txt = msg(L"topScores");
     int w = titleFont.getWidth(txt);
@@ -139,7 +139,7 @@
 {
     Area area;

-    Font font(L"laudcn2.ttf", 16);
+    Font font(L"DejaVuSans.ttf", 16);
     area.add(parentArea);
     area.add(new ScoresWindow(240, 125, scores, highlight));
     ExitCommand exitCmd(area);
@@ -154,7 +154,7 @@
 {
     Area area;

-    Font font(L"laudcn2.ttf", 16);
+    Font font(L"DejaVuSans.ttf", 16);
     area.add(parentArea);
     area.add(new Window(170, 280, 460, 100, L"blue.bmp"));
     Storage *storage = getStorage();
diff -r -u einstein-2.0.orig/unicode.cpp einstein-2.0/unicode.cpp
--- einstein-2.0.orig/unicode.cpp	2005-08-14 04:40:58.000000000 +0200
+++ einstein-2.0/unicode.cpp	2016-03-05 18:26:55.747780024 +0100
@@ -5,6 +5,7 @@
 #endif
 #include "unicode.h"
 #include "exceptions.h"
+#include "string.h"

 /// Returns length of wide character in utf-8


code:
This patch allows us to skip tests that require PTRACE_ATTACH in situations
where PTRACE_ATTACH is only allowed when CAP_SYS_PTRACE is held (i.e., for
root, by default.)

Reported at <https://bugzilla.redhat.com/show_bug.cgi?id=1210966>.

--- elfutils-0.161/tests/run-deleted.sh	2015-04-11 16:38:33.028556235 +0200
+++ elfutils-0.161/tests/run-deleted.sh	2015-04-11 16:46:15.012442185 +0200
@@ -17,6 +17,15 @@

 . $srcdir/backtrace-subr.sh

+# Check whether the Yama policy allows us to use PTRACE_ATTACH.
+if [ -f /proc/sys/kernel/yama/ptrace_scope ]
+then
+    if [ `cat /proc/sys/kernel/yama/ptrace_scope` -ne 0 ]
+    then
+	exit 77
+    fi
+fi
+
 tempfiles deleted deleted-lib.so
 cp -p ${abs_builddir}/deleted ${abs_builddir}/deleted-lib.so .

--- elfutils-0.161/tests/vdsosyms.c	2015-04-11 16:40:20.633461110 +0200
+++ elfutils-0.161/tests/vdsosyms.c	2015-04-11 16:45:06.611866677 +0200
@@ -23,6 +23,8 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include ELFUTILS_HEADER(dwfl)

@@ -68,6 +70,7 @@ module_callback (Dwfl_Module *mod, void
 int
 main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused)))
 {
+  static const char ptrace_scope_file[] = "/proc/sys/kernel/yama/ptrace_scope";
   static char *debuginfo_path;
   static const Dwfl_Callbacks proc_callbacks =
     {
@@ -76,6 +79,20 @@ main (int argc __attribute__ ((unused)),

       .find_elf = dwfl_linux_proc_find_elf,
     };
+
+  /* Check whether the Yama policy allows us to use PTRACE_ATTACH.  */
+  int ptrace_scope = open (ptrace_scope_file, O_RDONLY);
+  if (ptrace_scope >= 0)
+    {
+      char buf[10];
+      int count = read (ptrace_scope, buf, sizeof buf);
+      assert (count > 0);
+      if (buf[0] != '0')
+	/* We're not allowed, so skip this test.  */
+	return 77;
+      close (ptrace_scope);
+    }
+
   Dwfl *dwfl = dwfl_begin (&proc_callbacks);
   if (dwfl == NULL)
     error (2, 0, "dwfl_begin: %s", dwfl_errmsg (-1));


code:
Look for memfd_create in sys/mman.h instead of linux/memfd.h.
Needed to build with glibc-2.27.

--- a/configure.ac	1969-12-31 19:00:00.000000000 -0500
+++ b/configure.ac	2018-03-27 23:54:15.414589005 -0400
@@ -360,7 +360,7 @@
 # ------------------------------------------------------------------------------

 AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])])
-AC_CHECK_HEADERS([linux/memfd.h], [], [])
+AC_CHECK_HEADERS([sys/mman.h], [], [])

 AC_CHECK_HEADERS([printf.h], [have_printf_h=yes], [have_printf_h=no])
 AS_IF([test x$have_printf_h = xyes], [
@@ -395,6 +395,7 @@
                 [], [], [[
 #include <sys/types.h>
 #include <unistd.h>
+#include <sys/mman.h>
 #include <sys/mount.h>
 #include <fcntl.h>
 #include <sched.h>


code:
Do not capture the build-time value of $PATH in the 'emacs' executable
since this can noticeably increase the size of the closure of Emacs
with things like GCC being referenced.

--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -64,6 +64,11 @@
 			    (expand-file-name "textmodes" dir)
 			    (expand-file-name "vc" dir)))))

+;; Reset 'exec-path' so we don't capture the build-time $PATH in the
+;; 'emacs' executable.
+(setq-default exec-path nil)
+(setq exec-path nil)
+
 (if (eq t purify-flag)
     ;; Hash consing saved around 11% of pure space in my tests.
     (setq purify-flag (make-hash-table :test 'equal :size 70000)))


code:
From 13a14579cc1bb772735f895dd5b4b90c6812f3ee Mon Sep 17 00:00:00 2001
From: Chris Feng <chris.w.feng@gmail.com>
Date: Sun, 29 Jul 2018 00:00:00 +0000
Subject: [PATCH] Fix issues with destroying full screen X windows

* exwm-manage.el (exwm-manage--unmanage-window): Set the Emacs window
of an full screen X window as non-dedicated before killing its buffer
so as not to cause other side effects.
---
 exwm-manage.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/exwm-manage.el b/exwm-manage.el
index a0a9e05..349157f 100644
--- a/exwm-manage.el
+++ b/exwm-manage.el
@@ -392,6 +392,10 @@ manager is shutting down."
                                :window window :parent exwm--root :x 0 :y 0))
             (xcb:+request exwm--connection
                 (make-instance 'xcb:DestroyWindow :window container))))
+        (when (exwm-layout--fullscreen-p)
+          (let ((window (get-buffer-window)))
+            (when window
+              (set-window-dedicated-p window nil))))
         (exwm-manage--set-client-list)
         (xcb:flush exwm--connection))
       (let ((kill-buffer-func


code:
Fix 'scheme-indent-function' to indent s-expressions starting with a keyword
properly, like this:

(#:foo 1
 #:bar 2)

instead of like this:

(#:foo 1
       #:bar 2)

The fix is made by Mark H Weaver <mhw@netris.org>:
<http://www.netris.org/~mhw/scheme-indent-function.el>

--- a/lisp/progmodes/scheme.el
+++ b/lisp/progmodes/scheme.el
@@ -494,6 +494,12 @@ indentation."
                         (> (length function) 3)
                         (string-match "\\`def" function)))
                (lisp-indent-defform state indent-point))
+              ((and (null method)
+                    (> (length function) 1)
+                    ;; The '#' in '#:' seems to get lost, not sure why
+                    (string-match "\\`:" function))
+               (let ((lisp-body-indent 1))
+                 (lisp-indent-defform state indent-point)))
               ((integerp method)
                (lisp-indent-specform method state
                                      indent-point normal-indent))


code:
Copyright © 2017 Oleg Pykhalov <go.wigust@gmail.com>
Copyright © 2017 Ludovic Courtès <ludo@gnu.org>

This patch adds highlighting for (guix) G-Expressions.

diff --git a/highlight-stages.el b/highlight-stages.el
index 3094c3c..e11260e 100644
--- a/highlight-stages.el
+++ b/highlight-stages.el
@@ -237,14 +237,14 @@ non-nil, (match-string 0) must be the expression matched."

 (defun highlight-stages-lisp-quote-matcher (&optional limit)
   (when (highlight-stages--search-forward-regexp
-         "\\(?:`\\|\\(#?'\\)\\)\\|([\s\t\n]*\\(?:backquote\\|\\(quote\\)\\)[\s\t\n]+" limit)
+         "\\(?:`\\|\\(#?'\\)\\)\\|([\s\t\n]*\\(?:backquote\\|\\(quote\\)\\)[\s\t\n]+\\|\\(?:#~\\)\\|([\s\t\n]*\\(?:gexp\\)[\s\t\n]+" limit)
     (prog1 (if (or (match-beginning 1) (match-beginning 2)) 'real t)
       (set-match-data
        (list (point)
              (progn (ignore-errors (forward-sexp 1)) (point)))))))

 (defun highlight-stages-lisp-escape-matcher (&optional limit)
-  (when (highlight-stages--search-forward-regexp ",@?\\|([\s\t\n]*\\\\,@?+[\s\t\n]+" limit)
+  (when (highlight-stages--search-forward-regexp ",@?\\|([\s\t\n]*\\\\,@?+[\s\t\n]+\\|\\(unquote\\)\\|\\(unquote-splicing\\)\\|\\(ungexp-native\\)\\|\\(ungexp-splicing\\)\\|\\(ungexp-native-splicing\\)\\|\\(ungexp\\)\\|#\\$" limit)
     (set-match-data
      (list (point)
            (progn (ignore-errors (forward-sexp 1)) (point))))


code:
Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>

This patch fixes tests for Emacs 25.

Upstream bug URL:

https://github.com/gongo/json-reformat/issues/33

diff --git a/test/json-reformat-test.el b/test/json-reformat-test.el
index 7de3be1..b4a4dde 100644
--- a/test/json-reformat-test.el
+++ b/test/json-reformat-test.el
@@ -58,7 +58,7 @@
 (ert-deftest json-reformat-test:string-to-string ()
   (should (string= "\"foobar\"" (json-reformat:string-to-string "foobar")))
   (should (string= "\"fo\\\"o\\nbar\"" (json-reformat:string-to-string "fo\"o\nbar")))
-  (should (string= "\"\\u2661\"" (json-reformat:string-to-string "\u2661")))
+  (should (string= "\"♡\"" (json-reformat:string-to-string "\u2661")))

   (should (string= "\"^(amq\\\\.gen.*|amq\\\\.default)$\"" (json-reformat:string-to-string "^(amq\\.gen.*|amq\\.default)$")))
   )
@@ -148,6 +148,6 @@ bar\"" (json-reformat:string-to-string "fo\"o\nbar")))
 [{ foo : \"bar\" }, { \"foo\" : \"baz\" }]") ;; At 3 (line)
         (json-reformat-region (point-min) (point-max)))
       (should (string=
-               "JSON parse error [Reason] Bad string format: \"doesn't start with '\\\"'!\" [Position] In buffer, line 3 (char 6)"
+               "JSON parse error [Reason] Bad string format: \"doesn't start with \`\\\"'!\" [Position] In buffer, line 3 (char 6)"
                message-string))
       )))
--
2.15.1


code:
Fix completion for R5RS Scheme.
See https://github.com/ashinn/scheme-complete/issues/1

--- scheme-complete-master/scheme-complete.el.orig	2015-12-25 21:59:09.896909029 +0100
+++ scheme-complete-master/scheme-complete.el	2015-12-25 21:59:17.924993998 +0100
@@ -591,7 +591,7 @@
            '((exact->inexact (lambda (z) z))
              (inexact->exact (lambda (z) z)))
            (mapcar #'(lambda (x)
-                       (list x (scheme-env-lookup *scheme-r7rs-info* x)))
+                       (scheme-env-lookup *scheme-r7rs-info* x))
                    *scheme-r5rs-bindings*))))
   *scheme-r5rs-info*)


code:
Honor SOURCE_DATE_EPOCH variable to avoid non-determinism in generated
"autoloads" files.

--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -378,8 +378,12 @@
   "Insert the section-header line,
 which lists the file name and which functions are in it, etc."
   (insert generate-autoload-section-header)
-  (prin1 `(autoloads ,autoloads ,load-name ,file ,time)
-	 outbuf)
+  (let* ((env  (getenv "SOURCE_DATE_EPOCH"))
+         (time (if env
+                   (seconds-to-time (string-to-number env))
+                 time)))
+    (prin1 `(autoloads ,autoloads ,load-name ,file ,time)
+           outbuf))
   (terpri outbuf)
   ;; Break that line at spaces, to avoid very long lines.
   ;; Make each sub-line into a comment.


code:
diff --git a/src/bin/e_auth.c b/src/bin/e_auth.c
index 00b0e5d84..98ab4518f 100644
--- a/src/bin/e_auth.c
+++ b/src/bin/e_auth.c
@@ -9,8 +9,7 @@ e_auth_begin(char *passwd)

    if (strlen(passwd) == 0) goto out;

-   snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_ckpasswd",
-            e_prefix_lib_get());
+   snprintf(buf, sizeof(buf), "/run/setuid-programs/enlightenment_ckpasswd");

    exe = ecore_exe_pipe_run(buf, ECORE_EXE_PIPE_WRITE, NULL);
    if (ecore_exe_send(exe, passwd, strlen(passwd)) != EINA_TRUE) goto out;
diff --git a/src/bin/e_backlight.c b/src/bin/e_backlight.c
index 2bced6766..208e583ba 100644
--- a/src/bin/e_backlight.c
+++ b/src/bin/e_backlight.c
@@ -521,8 +521,8 @@ _bl_sys_level_set(double val)
      }
 //   fprintf(stderr, "SET: %1.3f\n", val);
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_backlight %i %s",
-            e_prefix_lib_get(), (int)(val * 1000.0), bl_sysval);
+            "/run/setuid-programs/enlightenment_backlight %i %s",
+            (int)(val * 1000.0), bl_sysval);
    bl_sys_set_exe = ecore_exe_run(buf, NULL);
 }
 #endif  // HAVE_EEZE || __FreeBSD_kernel__
diff --git a/src/bin/e_fm/e_fm_main_eeze.c b/src/bin/e_fm/e_fm_main_eeze.c
index b7d9e3eba..d8a9eb82c 100644
--- a/src/bin/e_fm/e_fm_main_eeze.c
+++ b/src/bin/e_fm/e_fm_main_eeze.c
@@ -318,7 +318,7 @@ _e_fm_main_eeze_volume_eject(E_Volume *v)
      {
         char buf[PATH_MAX];

-        snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+        snprintf(buf, sizeof(buf), "/run/setuid-programs/enlightenment_sys");
         eeze_disk_mount_wrapper_set(v->disk, buf);
      }
    v->guard = ecore_timer_loop_add(E_FM_EJECT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_eject_timeout, v);
@@ -512,7 +512,7 @@ _e_fm_main_eeze_volume_unmount(E_Volume *v)
      {
         char buf[PATH_MAX];

-        snprintf(buf, sizeof(buf), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+        snprintf(buf, sizeof(buf), "/run/setuid-programs/enlightenment_sys");
         eeze_disk_mount_wrapper_set(v->disk, buf);
      }
    v->guard = ecore_timer_loop_add(E_FM_UNMOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_unmount_timeout, v);
@@ -548,7 +548,7 @@ _e_fm_main_eeze_volume_mount(E_Volume *v)
      {
         char buf2[PATH_MAX];

-        snprintf(buf2, sizeof(buf2), "%s/enlightenment/utils/enlightenment_sys", eina_prefix_lib_get(pfx));
+        snprintf(buf2, sizeof(buf2), "/run/setuid-programs/enlightenment_sys");
         eeze_disk_mount_wrapper_set(v->disk, buf2);
      }
    v->guard = ecore_timer_loop_add(E_FM_MOUNT_TIMEOUT, (Ecore_Task_Cb)_e_fm_main_eeze_vol_mount_timeout, v);
diff --git a/src/bin/e_sys.c b/src/bin/e_sys.c
index 6781a9b5a..8cd140f1b 100644
--- a/src/bin/e_sys.c
+++ b/src/bin/e_sys.c
@@ -653,20 +653,16 @@ _e_sys_cb_timer(void *data EINA_UNUSED)

    e_init_status_set(_("Checking System Permissions"));
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_sys -t halt",
-            e_prefix_lib_get());
+            "/run/setuid-programs/enlightenment_sys -t halt");
    _e_sys_halt_check_exe = ecore_exe_run(buf, NULL);
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_sys -t reboot",
-            e_prefix_lib_get());
+            "/run/setuid-programs/enlightenment_sys -t reboot");
    _e_sys_reboot_check_exe = ecore_exe_run(buf, NULL);
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_sys -t suspend",
-            e_prefix_lib_get());
+            "/run/setuid-programs/enlightenment_sys -t suspend");
    _e_sys_suspend_check_exe = ecore_exe_run(buf, NULL);
    snprintf(buf, sizeof(buf),
-            "%s/enlightenment/utils/enlightenment_sys -t hibernate",
-            e_prefix_lib_get());
+            "/run/setuid-programs/enlightenment_sys -t hibernate");
    _e_sys_hibernate_check_exe = ecore_exe_run(buf, NULL);
    return ECORE_CALLBACK_CANCEL;
 }
@@ -1079,8 +1075,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
         /* shutdown -h now */
         if (e_util_immortal_check()) return 0;
         snprintf(buf, sizeof(buf),
-                 "%s/enlightenment/utils/enlightenment_sys halt",
-                 e_prefix_lib_get());
+                 "/run/setuid-programs/enlightenment_sys halt");
         if (_e_sys_exe)
           {
              if ((ecore_time_get() - _e_sys_begin_time) > 2.0)
@@ -1114,8 +1109,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
         /* shutdown -r now */
         if (e_util_immortal_check()) return 0;
         snprintf(buf, sizeof(buf),
-                 "%s/enlightenment/utils/enlightenment_sys reboot",
-                 e_prefix_lib_get());
+                 "/run/setuid-programs/enlightenment_sys reboot");
         if (_e_sys_exe)
           {
              if ((ecore_time_get() - _e_sys_begin_time) > 2.0)
@@ -1148,8 +1142,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
       case E_SYS_SUSPEND:
         /* /etc/acpi/sleep.sh force */
         snprintf(buf, sizeof(buf),
-                 "%s/enlightenment/utils/enlightenment_sys suspend",
-                 e_prefix_lib_get());
+                 "/run/setuid-programs/enlightenment_sys suspend");
         if (_e_sys_exe)
           {
              if ((ecore_time_get() - _e_sys_begin_time) > 2.0)
@@ -1208,8 +1201,7 @@ _e_sys_action_do(E_Sys_Action a, char *param EINA_UNUSED, Eina_Bool raw)
       case E_SYS_HIBERNATE:
         /* /etc/acpi/hibernate.sh force */
         snprintf(buf, sizeof(buf),
-                 "%s/enlightenment/utils/enlightenment_sys hibernate",
-                 e_prefix_lib_get());
+                 "/run/setuid-programs/enlightenment_sys hibernate");
         if (_e_sys_exe)
           {
              if ((ecore_time_get() - _e_sys_begin_time) > 2.0)
diff --git a/src/modules/bluez4/e_mod_main.c b/src/modules/bluez4/e_mod_main.c
index 4b5148634..47d34b07f 100644
--- a/src/modules/bluez4/e_mod_main.c
+++ b/src/modules/bluez4/e_mod_main.c
@@ -49,8 +49,8 @@ _ebluez_l2ping_poller(void *data EINA_UNUSED)

    if (tmp)
      {
-        eina_strbuf_append_printf(buf, "%s/enlightenment/utils/enlightenment_sys l2ping %s",
-				  e_prefix_lib_get(), tmp);
+        eina_strbuf_append_printf(buf, "/run/setuid-programs/enlightenment_sys l2ping %s",
+				  tmp);
 	autolock_exe = ecore_exe_run(eina_strbuf_string_get(buf), NULL);
      }

@@ -692,8 +692,7 @@ e_modapi_init(E_Module *m)
    autolock_desklock = ecore_event_handler_add(E_EVENT_DESKLOCK, _ebluez_desklock, NULL);

    buf = eina_strbuf_new();
-   eina_strbuf_append_printf(buf, "%s/enlightenment/utils/enlightenment_sys -t l2ping",
-			     e_prefix_lib_get());
+   eina_strbuf_append_printf(buf, "/run/setuid-programs/enlightenment_sys -t l2ping");
    autolock_exe = ecore_exe_run(eina_strbuf_string_get(buf), NULL);
    eina_strbuf_free(buf);

diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c
index f4ba259b6..ae228bae3 100644
--- a/src/modules/cpufreq/e_mod_main.c
+++ b/src/modules/cpufreq/e_mod_main.c
@@ -1450,8 +1450,7 @@ e_modapi_init(E_Module *m)
      }
    E_CONFIG_LIMIT(cpufreq_config->poll_interval, 1, 1024);

-   snprintf(buf, sizeof(buf), "%s/%s/freqset",
-            e_module_dir_get(m), MODULE_ARCH);
+   snprintf(buf, sizeof(buf), "/run/setuid-programs/freqset");
    cpufreq_config->set_exe_path = strdup(buf);

    if (stat(buf, &st) < 0)


code:
Patch originally from https://sources.debian.net/patches/erlang/1:20.0.1%2Bdfsg-2/man.patch/
by Francois-Denis Gonthier <neumann@lostwebsite.net>.

Patch description rewritten for Guix.

This patch allows access to the man page with the 'erl -man' command
(Erlang manual pages are placed to /gnu/store/..erlang../share/man/ hierarchy
as other man pages.)

--- a/erts/etc/common/erlexec.c
+++ b/erts/etc/common/erlexec.c
@@ -709,8 +709,10 @@
 			error("-man not supported on Windows");
 #else
 			argv[i] = "man";
-			erts_snprintf(tmpStr, sizeof(tmpStr), "%s/man", rootdir);
-			set_env("MANPATH", tmpStr);
+			/*
+			* Conform to erlang-manpages content.
+			*/
+			putenv(strsave("MANSECT=1:3:5:7"));
 			execvp("man", argv+i);
 			error("Could not execute the 'man' command.");
 #endif


code:
Add $EUDEV_RULES_DIRECTORY to the list of rules directories.

The old udev 182 supported $UDEV_CONFIG_FILE, which in turn allowed
the search path to be customized, but eudev no longer has this, hence
this hack.

--- eudev-3.1.5/src/udev/udev-rules.c	2015-10-13 06:22:14.000000000 +0800
+++ eudev-3.1.5/src/udev/udev-rules.c	2015-10-16 20:45:38.491934336 +0800
@@ -47,15 +47,11 @@
         };
 };

-static const char* const rules_dirs[] = {
+static const char* rules_dirs[] = {
         UDEV_CONF_DIR "/rules.d",
         UDEV_RULES_DIR,
-        UDEV_ROOT_RUN "/udev/rules.d",
         UDEV_LIBEXEC_DIR "/rules.d",
-#ifdef HAVE_SPLIT_USR
-        "/lib/udev/rules.d",
-        "/usr/lib/udev/rules.d",
-#endif
+        NULL,			/* placeholder for $EUDEV_RULES_DIRECTORY */
         NULL};

 struct udev_rules {
@@ -1704,6 +1700,9 @@

         udev_rules_check_timestamp(rules);

+        /* Allow the user to specify an additional rules directory.  */
+        rules_dirs[3] = getenv("EUDEV_RULES_DIRECTORY");
+
         r = conf_files_list_strv(&files, ".rules", NULL, rules_dirs);
         if (r < 0) {
                 log_error_errno(r, "failed to enumerate rules files: %m");


code:
evilwm may sometimes lose focus after closing a window.  This means that
evilwm stops responding to keyboard shortcuts, and if no other window is open
which the mouse can be moved over to regain focus evilwm becomes unusable and
has to be restarted.

Patch derived from discussion at
https://wiki.archlinux.org/index.php/Evilwm#Lost_focus_bug_fix

--- evilwm-1.1.1/client.c
+++ evilwm-1.1.1/client.c
@@ -172,6 +172,7 @@
 	 *  _NET_WM_STATE) */
 	if (c->remove) {
 		LOG_DEBUG("setting WithdrawnState\n");
+		XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
 		set_wm_state(c, WithdrawnState);
 		ewmh_withdraw_client(c);
 	} else {


code:
Fix CVE-2017-14859, CVE-2017-14862 and CVE-2017-14864.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14859
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14862
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14864

Copied from upstream:

https://github.com/Exiv2/exiv2/commit/8a586c74bbe3fbca64e86e42a42282c73f427607

From 8a586c74bbe3fbca64e86e42a42282c73f427607 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <dan.cermak@cgc-instruments.com>
Date: Sat, 7 Oct 2017 23:08:36 +0200
Subject: [PATCH] Fix for CVE-2017-14864, CVE-2017-14862 and CVE-2017-14859

The invalid memory dereference in
Exiv2::getULong()/Exiv2::StringValueBase::read()/Exiv2::DataValue::read()
is caused further up the call-stack, by
v->read(pData, size, byteOrder) in TiffReader::readTiffEntry()
passing an invalid pData pointer (pData points outside of the Tiff
file). pData can be set out of bounds in the (size > 4) branch where
baseOffset() and offset are added to pData_ without checking whether
the result is still in the file. As offset comes from an untrusted
source, an attacker can craft an arbitrarily large offset into the
file.

This commit adds a check into the problematic branch, whether the
result of the addition would be out of bounds of the Tiff
file. Furthermore the whole operation is checked for possible
overflows.
---
 src/tiffvisitor.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp
index 4ab733d4..ef13542e 100644
--- a/src/tiffvisitor.cpp
+++ b/src/tiffvisitor.cpp
@@ -47,6 +47,7 @@ EXIV2_RCSID("@(#) $Id$")
 #include <iostream>
 #include <iomanip>
 #include <cassert>
+#include <limits>

 // *****************************************************************************
 namespace {
@@ -1517,7 +1518,19 @@ namespace Exiv2 {
                 size = 0;
         }
         if (size > 4) {
+            // setting pData to pData_ + baseOffset() + offset can result in pData pointing to invalid memory,
+            // as offset can be arbitrarily large
+            if ((static_cast<uintptr_t>(baseOffset()) > std::numeric_limits<uintptr_t>::max() - static_cast<uintptr_t>(offset))
+             || (static_cast<uintptr_t>(baseOffset() + offset) > std::numeric_limits<uintptr_t>::max() - reinterpret_cast<uintptr_t>(pData_)))
+            {
+                throw Error(59);
+            }
+            if (pData_ + static_cast<uintptr_t>(baseOffset()) + static_cast<uintptr_t>(offset) > pLast_) {
+                throw Error(58);
+            }
             pData = const_cast<byte*>(pData_) + baseOffset() + offset;
+
+	    // check for size being invalid
             if (size > static_cast<uint32_t>(pLast_ - pData)) {
 #ifndef SUPPRESS_WARNINGS
                 EXV_ERROR << "Upper boundary of data for "


code:
Fix CVE-2017-14860.

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14860
https://nvd.nist.gov/vuln/detail/CVE-2017-14860

Copied from upstream:

https://github.com/Exiv2/exiv2/commit/ff18fec24b119579df26fd2ebb8bb012cde102ce

From ff18fec24b119579df26fd2ebb8bb012cde102ce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= <dan.cermak@cgc-instruments.com>
Date: Fri, 6 Oct 2017 23:09:08 +0200
Subject: [PATCH] Fix for CVE-2017-14860

A heap buffer overflow could occur in memcpy when icc.size_ is larger
than data.size_ - pad, as then memcpy would read out of bounds of data.

This commit adds a sanity check to iccLength (= icc.size_): if it is
larger than data.size_ - pad (i.e. an overflow would be caused) an
exception is thrown.

This fixes #71.
---
 src/jp2image.cpp | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/jp2image.cpp b/src/jp2image.cpp
index 747145cf..748d39b5 100644
--- a/src/jp2image.cpp
+++ b/src/jp2image.cpp
@@ -269,10 +269,15 @@ namespace Exiv2
                             std::cout << "Exiv2::Jp2Image::readMetadata: "
                                      << "Color data found" << std::endl;
 #endif
-                            long pad = 3 ; // 3 padding bytes 2 0 0
+                            const long pad = 3 ; // 3 padding bytes 2 0 0
                             DataBuf data(subBox.length+8);
                             io_->read(data.pData_,data.size_);
-                            long    iccLength = getULong(data.pData_+pad, bigEndian);
+                            const long    iccLength = getULong(data.pData_+pad, bigEndian);
+                            // subtracting pad from data.size_ is safe:
+                            // size_ is at least 8 and pad = 3
+                            if (iccLength > data.size_ - pad) {
+                                throw Error(58);
+			    }
                             DataBuf icc(iccLength);
                             ::memcpy(icc.pData_,data.pData_+pad,icc.size_);
 #ifdef DEBUG


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Thu, 16 Aug 2018 21:12:30 +0200
Subject: extundelete: Fix build with e2fsprogs 1.44.

The ‘inode.i_file_acl’ field was replaced with ‘inode.i_size_high’. I'm
not sure the field name is still accurate or useful, so don't print it
at all.

Based on this[0] patch by ‘conikost’[1].

[0]: https://sourceforge.net/p/extundelete/tickets/5/
[1]: https://sourceforge.net/u/conikost

--- a/src/insertionops.cc	2012-12-30 18:23:32.000000000 +0100
+++ b/src/insertionops.cc	2018-05-07 22:58:13.065868723 +0200
@@ -33,7 +33,6 @@
   os << "File flags: " << inode.i_flags << std::endl;
   os << "File version (for NFS): " << inode.i_generation << std::endl;
   os << "File ACL: " << inode.i_file_acl << std::endl;
-  os << "Directory ACL: " << inode.i_dir_acl << std::endl;
   os << "Fragment address: " << inode.i_faddr << std::endl;
   os << "Direct blocks: ";
   for (int n = 0; n < EXT2_NDIR_BLOCKS; n++)


code:
Don't use timing as there is a type conflict.

--- nix-build-fastcap-2.0-18Sep92.drv-1/src/mulGlobal.h.orig	2015-07-21 15:58:49.199101566 +0200
+++ nix-build-fastcap-2.0-18Sep92.drv-1/src/mulGlobal.h	2015-07-21 16:18:39.456751313 +0200
@@ -57,7 +57,7 @@
 /* time variables/structs */
 #ifndef _TIME_                  /* if not on a Sun4 */
 #ifndef NEWS                    /* if not on a NWS-38XX */
-#include <time.h>
+//#include <time.h>
 #endif
 #endif


code:
Add forward declarations.

--- fastcap/src/mulSetup.c.orig	2015-07-22 13:55:21.592119775 +0200
+++ fastcap/src/mulSetup.c	2015-07-22 14:08:50.157688209 +0200
@@ -35,6 +35,14 @@

 #include "mulGlobal.h"

+static getnbrs(ssystem*);
+static linkcubes(ssystem*);
+static setMaxq(ssystem*);
+static getAllInter(ssystem*);
+static set_vector_masks(ssystem*);
+static indexkid(ssystem*, cube*, int*, int*);
+static int placeq(int, ssystem*, charge*);
+
 cube *cstack[1024];		/* Stack used in several routines. */

 /*


code:
Add forward declarations.

--- fasthenry-3.0/src/fasthenry/sparse/spAllocate.c.orig	2015-07-22 09:45:28.864758891 +0200
+++ fasthenry-3.0/src/fasthenry/sparse/spAllocate.c	2015-07-22 13:04:17.579742206 +0200
@@ -107,7 +107,9 @@
 #include "spDefs.h"

-
+static InitializeElementBlocks( MatrixPtr, int, int );
+static RecordAllocation( MatrixPtr, char* );
+static AllocateBlockOfAllocationList( MatrixPtr );


code:
Add forward declarations.

--- fasthenry-3.0/src/fasthenry/sparse/spBuild.c.orig	2015-07-22 10:13:30.884638176 +0200
+++ fasthenry-3.0/src/fasthenry/sparse/spBuild.c	2015-07-22 13:08:48.862973419 +0200
@@ -106,6 +106,8 @@
 #include "spDefs.h"

+static void Translate( MatrixPtr, int*, int* );
+static ExpandTranslationArrays( MatrixPtr, register int );


code:
Add forward declarations.

--- fasthenry-3.0/src/fasthenry/sparse/spFactor.c.orig	2015-07-22 10:37:04.934043468 +0200
+++ fasthenry-3.0/src/fasthenry/sparse/spFactor.c	2015-07-22 12:52:55.515636802 +0200
@@ -105,7 +105,29 @@
 #include "spDefs.h"

-
+static int FactorComplexMatrix( MatrixPtr );
+static CreateInternalVectors( MatrixPtr );
+static CountMarkowitz( MatrixPtr, register RealVector, int );
+static MarkowitzProducts( MatrixPtr, int );
+static ElementPtr SearchForPivot( MatrixPtr, int, int );
+static ElementPtr SearchForSingleton( MatrixPtr, int );
+static ElementPtr QuicklySearchDiagonal( MatrixPtr, int );
+static ElementPtr SearchDiagonal( MatrixPtr, register int );
+static ElementPtr SearchEntireMatrix( MatrixPtr, int );
+static RealNumber FindLargestInCol( register  ElementPtr );
+static RealNumber FindBiggestInColExclude( MatrixPtr, register  ElementPtr,
+                                           register  int );
+static ExchangeRowsAndCols( MatrixPtr, ElementPtr, register int );
+static ExchangeColElements( MatrixPtr, int, register  ElementPtr,
+                            int, register  ElementPtr, int );
+static ExchangeRowElements( MatrixPtr, int, register ElementPtr,
+                            int, register ElementPtr, int );
+static RealRowColElimination( MatrixPtr, register  ElementPtr );
+static ComplexRowColElimination( MatrixPtr, register  ElementPtr );
+static UpdateMarkowitzNumbers( MatrixPtr, ElementPtr );
+static ElementPtr CreateFillin( MatrixPtr, register int, int );
+static int MatrixIsSingular( MatrixPtr, int );
+static int ZeroPivot( MatrixPtr, int );


code:
Add forward declarations.

--- fasthenry-3.0/src/fasthenry/sparse/spSolve.c.orig	2015-07-22 12:06:20.502771958 +0200
+++ fasthenry-3.0/src/fasthenry/sparse/spSolve.c	2015-07-22 12:12:03.822798513 +0200
@@ -95,6 +95,7 @@
 #include "spDefs.h"

+static void SolveComplexMatrix( MatrixPtr, RealVector, RealVector );


code:
Add forward declarations.

--- fasthenry-3.0/src/fasthenry/sparse/spUtils.c.orig	2015-07-22 12:12:52.579370846 +0200
+++ fasthenry-3.0/src/fasthenry/sparse/spUtils.c	2015-07-22 12:14:09.636275633 +0200
@@ -107,6 +107,7 @@
 #include "spDefs.h"

+static RealNumber ComplexCondition( MatrixPtr, RealNumber, int* );


code:
Taken from http://pkgs.fedoraproject.org/cgit/rpms/fcgi.git/plain/fcgi-2.4.0-gcc44_fixes.patch.
Fixes compilation with GCC 4.4 and later.

diff -up fcgi-2.4.0/libfcgi/fcgio.cpp.gcc44_fixes fcgi-2.4.0/libfcgi/fcgio.cpp
--- fcgi-2.4.0/libfcgi/fcgio.cpp.gcc44_fixes	2002-02-24 21:12:22.000000000 +0100
+++ fcgi-2.4.0/libfcgi/fcgio.cpp	2009-02-15 11:35:18.000000000 +0100
@@ -23,6 +23,7 @@
 #endif

 #include <limits.h>
+#include <cstdio>
 #include "fcgio.h"

 using std::streambuf;


code:
Taken from http://pkgs.fedoraproject.org/cgit/rpms/fcgi.git/plain/fcgi-2.4.0-poll.patch
Fixes CVE-2012-6687.

Author: Anton Kortunov <toshic.toshic@gmail.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libfcgi/+bug/933417
Description: use poll in os_unix.c instead of select to avoid problem with > 1024 connections
Forwarded: yes, fastcgi-developers@mailman.fastcgi.com

diff --git a/libfcgi/os_unix.c b/libfcgi/os_unix.c
index 73e6a7f..af35aee 100755
--- a/libfcgi/os_unix.c
+++ b/libfcgi/os_unix.c
@@ -42,6 +42,7 @@ static const char rcsid[] = "$Id: os_unix.c,v 1.37 2002/03/05 19:14:49 robs Exp
 #include <sys/time.h>
 #include <sys/un.h>
 #include <signal.h>
+#include <poll.h>

 #ifdef HAVE_NETDB_H
 #include <netdb.h>
@@ -103,6 +104,9 @@ static int volatile maxFd = -1;
 static int shutdownPending = FALSE;
 static int shutdownNow = FALSE;

+static int libfcgiOsClosePollTimeout = 2000;
+static int libfcgiIsAfUnixKeeperPollTimeout = 2000;
+
 void OS_ShutdownPending()
 {
     shutdownPending = TRUE;
@@ -168,6 +172,16 @@ int OS_LibInit(int stdioFds[3])
     if(libInitialized)
         return 0;

+    char *libfcgiOsClosePollTimeoutStr = getenv( "LIBFCGI_OS_CLOSE_POLL_TIMEOUT" );
+    if(libfcgiOsClosePollTimeoutStr) {
+        libfcgiOsClosePollTimeout = atoi(libfcgiOsClosePollTimeoutStr);
+    }
+
+    char *libfcgiIsAfUnixKeeperPollTimeoutStr = getenv( "LIBFCGI_IS_AF_UNIX_KEEPER_POLL_TIMEOUT" );
+    if(libfcgiIsAfUnixKeeperPollTimeoutStr) {
+        libfcgiIsAfUnixKeeperPollTimeout = atoi(libfcgiIsAfUnixKeeperPollTimeoutStr);
+    }
+
     asyncIoTable = (AioInfo *)malloc(asyncIoTableSize * sizeof(AioInfo));
     if(asyncIoTable == NULL) {
         errno = ENOMEM;
@@ -755,19 +769,16 @@ int OS_Close(int fd)

     if (shutdown(fd, 1) == 0)
     {
-        struct timeval tv;
-        fd_set rfds;
+        struct pollfd pfd;
         int rv;
         char trash[1024];

-        FD_ZERO(&rfds);
+        pfd.fd = fd;
+        pfd.events = POLLIN;

         do
         {
-            FD_SET(fd, &rfds);
-            tv.tv_sec = 2;
-            tv.tv_usec = 0;
-            rv = select(fd + 1, &rfds, NULL, NULL, &tv);
+            rv = poll(&pfd, 1, libfcgiOsClosePollTimeout);
         }
         while (rv > 0 && read(fd, trash, sizeof(trash)) > 0);
     }
@@ -1116,13 +1127,11 @@ static int is_reasonable_accept_errno (const int error)
  */
 static int is_af_unix_keeper(const int fd)
 {
-    struct timeval tval = { READABLE_UNIX_FD_DROP_DEAD_TIMEVAL };
-    fd_set read_fds;
-
-    FD_ZERO(&read_fds);
-    FD_SET(fd, &read_fds);
+    struct pollfd pfd;
+    pfd.fd = fd;
+    pfd.events = POLLIN;

-    return select(fd + 1, &read_fds, NULL, NULL, &tval) >= 0 && FD_ISSET(fd, &read_fds);
+    return poll(&pfd, 1, libfcgiIsAfUnixKeeperPollTimeout) >= 0 && (pfd.revents & POLLIN);
 }

 /*


code:
From 0871db30bd73d112a434f54572d34cca28de61c5 Mon Sep 17 00:00:00 2001
From: fis <ybbs.daans@hotmail.com>
Date: Sat, 26 May 2018 22:58:37 +0800
Subject: [PATCH 2/2] * CMakeLists.txt: Fix flags for gcc.

---
 CMakeLists.txt | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index eba147b..d60dcef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,20 +6,6 @@ add_executable(unit src/fifo_map.hpp test/unit.cpp)

 target_include_directories(unit PRIVATE "test" "src")

-if(MSVC)
-    set(CMAKE_CXX_FLAGS
-        "/EHsc"
-    )
+set(CMAKE_CXX_FLAGS "-std=c++11 -fpermissive")

-    STRING(REPLACE "/O2" "/Od" CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
-
-    add_definitions(-D_SCL_SECURE_NO_WARNINGS)
-else(MSVC)
-    set(CMAKE_CXX_FLAGS
-        "-std=c++11 -stdlib=libc++"
-    )
-endif(MSVC)
-
-include_directories(
-    src test
-)
+include_directories(src test)
--
2.14.3


code:
From 20dcf90fd02511f8d78ea7cc8ac82c121fd2f6cf Mon Sep 17 00:00:00 2001
From: fis <ybbs.daans@hotmail.com>
Date: Sat, 26 May 2018 22:56:29 +0800
Subject: [PATCH 1/2] * CMakeLists.txt: Remove catch.hpp.

---
 CMakeLists.txt | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6603c7f..eba147b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 2.8)

 project(fifo_map LANGUAGES CXX)

-add_executable(unit
-    src/fifo_map.hpp test/thirdparty/catch/catch.hpp test/unit.cpp
-)
+add_executable(unit src/fifo_map.hpp test/unit.cpp)

-target_include_directories(unit PRIVATE "test" "src" "test/thirdparty")
+target_include_directories(unit PRIVATE "test" "src")

 if(MSVC)
     set(CMAKE_CXX_FLAGS
--
2.14.3


code:
Do not try to create $localstatedir (aka. /var) since we don't have
write access.

--- findutils-4.4.2/locate/Makefile.in	2015-06-04 12:40:52.690935795 +0200
+++ findutils-4.4.2/locate/Makefile.in	2015-06-04 12:41:32.087286685 +0200
@@ -1212,7 +1212,7 @@ updatedb: updatedb.sh Makefile
 	chmod +x $@

 install-data-hook:
-	$(top_srcdir)/build-aux/mkinstalldirs $(DESTDIR)$(localstatedir)
+	true

 dblocation.texi: Makefile
 	echo '@set LOCATE_DB $(LOCATE_DB)' > $@


code:
This test relies on 'xargs' being available in $PATH, which is not
the case when we build the initial Findutils doing bootstrapping.
Reported at <https://savannah.gnu.org/bugs/index.php?46786>.

--- findutils-4.6.0/find/testsuite/sv-34976-execdir-fd-leak.sh	2015-12-31 19:37:59.401526288 +0100
+++ findutils-4.6.0/find/testsuite/sv-34976-execdir-fd-leak.sh	2015-12-31 19:38:36.061770693 +0100
@@ -50,13 +50,14 @@ die() {
 # Create test files, each 98 in the directories ".", "one" and "two".
 make_test_data() {
   d="$1"
+  xargs="`cd ../../xargs; pwd -P`/xargs"
   (
     cd "$1" || exit 1
     mkdir one two || exit 1
     for i in ${three_to_hundred} ; do
       printf "./%03d one/%03d two/%03d " $i $i $i
     done \
-      | xargs touch || exit 1
+      | "$xargs" touch || exit 1
   ) \
   || die "failed to set up the test in ${outdir}"
 }


code:
Fixes this issue:
 <https://github.com/mariusmuja/flann/issues/369>.
Patch from Buildroot:
 <https://github.com/buildroot/buildroot/commit/45a39b3e2ba42b72d19bfcef30db1b8da9ead51a>.

From fa5ec96a94646492a3f908e12905b3e48a8e800b Mon Sep 17 00:00:00 2001
From: Romain Naour <romain.naour@gmail.com>
Date: Wed, 18 Apr 2018 20:24:13 +0200
Subject: [PATCH] src/cpp: fix cmake >= 3.11 build

CMake < 3.11 doesn't support add_library() without any source file
(i.e add_library(foo SHARED)). But flann CMake use a trick that use
an empty string "" as source list (i.e add_library(foo SHARED "")).
This look like a bug in CMake < 3.11.

With CMake >= 3.11, the new behaviour of add_library() break the
existing flann CMake code.

From CMake Changelog [1]:
"add_library() and add_executable() commands can now be called without
 any sources and will not complain as long as sources are added later
 via the target_sources() command."

Note: flann CMake code doesn't use target_sources() since no source file
are provided intentionally since the flann shared library is created by
linking with the flann_cpp_s static library with this line:

target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)

If you try to use "add_library(flann_cpp SHARED ${CPP_SOURCES})" (as it should
be normally done), the link fail due to already defined symbol.

They are building the shared version using the static library "to speedup the
build time" [3]

This issue is already reported upstream [2] with a proposed solution.

Upstream status: Pending

Fixes:
http://autobuild.buildroot.net/results/b2f/b2febfaf8c44ce477b3e4a5b9b976fd25e8d7454

[1] https://cmake.org/cmake/help/v3.11/release/3.11.html
[2] https://github.com/mariusmuja/flann/issues/369
[3] https://github.com/mariusmuja/flann/commit/0fd62b43be2fbb0b8d791ee36290791224dc030c

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
 src/cpp/CMakeLists.txt | 4 ++--
 src/cpp/empty.cpp      | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)
 create mode 100644 src/cpp/empty.cpp

diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
index b44a735..a816863 100644
--- a/src/cpp/CMakeLists.txt
+++ b/src/cpp/CMakeLists.txt
@@ -29,7 +29,7 @@ if (BUILD_CUDA_LIB)
 endif()

 if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-    add_library(flann_cpp SHARED "")
+    add_library(flann_cpp SHARED "empty.cpp")
     set_target_properties(flann_cpp PROPERTIES LINKER_LANGUAGE CXX)
     target_link_libraries(flann_cpp -Wl,-whole-archive flann_cpp_s -Wl,-no-whole-archive)

@@ -85,7 +85,7 @@ if (BUILD_C_BINDINGS)
     set_property(TARGET flann_s PROPERTY COMPILE_DEFINITIONS FLANN_STATIC)

     if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_COMPILER_IS_GNUCC)
-        add_library(flann SHARED "")
+        add_library(flann SHARED "empty.cpp")
         set_target_properties(flann PROPERTIES LINKER_LANGUAGE CXX)
         target_link_libraries(flann -Wl,-whole-archive flann_s -Wl,-no-whole-archive)
     else()
diff --git a/src/cpp/empty.cpp b/src/cpp/empty.cpp
new file mode 100644
index 0000000..40a8c17
--- /dev/null
+++ b/src/cpp/empty.cpp
@@ -0,0 +1 @@
+/* empty */
--
2.14.3


code:
Patch by Andreas Enge <andreas@enge.fr>.
Remedy the absence of ldconfig and explicitly create an additional symbolic
link to the flint library, as discussed privately with upstream.

diff -r -u flint-2.5.2.orig/configure flint-2.5.2/configure
--- flint-2.5.2.orig/configure	2015-08-13 18:16:22.000000000 +0200
+++ flint-2.5.2/configure	2015-08-14 17:38:14.316284437 +0200
@@ -714,6 +714,7 @@
 echo "FLINT_SHARED=$SHARED" >> Makefile
 echo "FLINT_LIB=$FLINT_LIB" >> Makefile
 echo "FLINT_LIBNAME=$FLINT_LIBNAME" >> Makefile
+echo "FLINT_MAJOR=$FLINT_MAJOR" >> Makefile
 echo "FLINT_SOLIB=$FLINT_SOLIB" >> Makefile
 echo "EXEEXT=$EXEEXT" >> Makefile
 echo "PREFIX=$PREFIX" >> Makefile
diff -r -u flint-2.5.2.orig/Makefile.in flint-2.5.2/Makefile.in
--- flint-2.5.2.orig/Makefile.in	2015-08-13 18:16:22.000000000 +0200
+++ flint-2.5.2/Makefile.in	2015-08-14 17:38:50.584774817 +0200
@@ -118,6 +118,7 @@
 		$(LDCONFIG) -n "$(CURDIR)"; \
 	fi
 	ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME)"; \
+	ln -sf "$(FLINT_LIB)" "$(FLINT_LIBNAME).$(FLINT_MAJOR)"; \

 libflint.a: $(OBJS) $(LIB_SOURCES) $(EXT_SOURCES) $(HEADERS) $(EXT_HEADERS) | build build/interfaces
 	$(AT)$(foreach ext, $(EXTENSIONS), $(foreach dir, $(filter-out %templates, $(patsubst $(ext)/%.h, %, $(wildcard $(ext)/*.h))), mkdir -p build/$(dir); BUILD_DIR=$(CURDIR)/build/$(dir); export BUILD_DIR; MOD_DIR=$(dir); export MOD_DIR; $(MAKE) -f $(CURDIR)/Makefile.subdirs -C $(ext)/$(dir) static || exit $$?;))


code:
Copied from Debian.

Description: fix integer overflow
Origin: upstream
 http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?view=patch&r1=1.17&r2=1.18&pathrev=MAIN
 http://freeimage.cvs.sourceforge.net/viewvc/freeimage/FreeImage/Source/FreeImage/PluginPCX.cpp?view=patch&r1=1.18&r2=1.19&pathrev=MAIN
Bug-Debian: https://bugs.debian.org/797165
Last-Update: 2015-09-14
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: freeimage/Source/FreeImage/PluginPCX.cpp
===================================================================
--- freeimage.orig/Source/FreeImage/PluginPCX.cpp
+++ freeimage/Source/FreeImage/PluginPCX.cpp
@@ -347,12 +347,14 @@ Load(FreeImageIO *io, fi_handle handle,

 	try {
 		// check PCX identifier
-
-		long start_pos = io->tell_proc(handle);
-		BOOL validated = pcx_validate(io, handle);
-		io->seek_proc(handle, start_pos, SEEK_SET);
-		if(!validated) {
-			throw FI_MSG_ERROR_MAGIC_NUMBER;
+		// (note: should have been already validated using FreeImage_GetFileType but check again)
+		{
+			long start_pos = io->tell_proc(handle);
+			BOOL validated = pcx_validate(io, handle);
+			io->seek_proc(handle, start_pos, SEEK_SET);
+			if(!validated) {
+				throw FI_MSG_ERROR_MAGIC_NUMBER;
+			}
 		}

 		// process the header
@@ -366,20 +368,38 @@ Load(FreeImageIO *io, fi_handle handle,
 		SwapHeader(&header);
 #endif

-		// allocate a new DIB
+		// process the window
+		const WORD *window = header.window;	// left, upper, right,lower pixel coord.
+		const int left		= window[0];
+		const int top		= window[1];
+		const int right		= window[2];
+		const int bottom	= window[3];

-		unsigned width = header.window[2] - header.window[0] + 1;
-		unsigned height = header.window[3] - header.window[1] + 1;
-		unsigned bitcount = header.bpp * header.planes;
-
-		if (bitcount == 24) {
-			dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
-		} else {
-			dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
+		// check image size
+		if((left >= right) || (top >= bottom)) {
+			throw FI_MSG_ERROR_PARSING;
 		}

-		// if the dib couldn't be allocated, throw an error
+		const unsigned width = right - left + 1;
+		const unsigned height = bottom - top + 1;
+		const unsigned bitcount = header.bpp * header.planes;
+
+		// allocate a new DIB
+		switch(bitcount) {
+			case 1:
+			case 4:
+			case 8:
+				dib = FreeImage_AllocateHeader(header_only, width, height, bitcount);
+				break;
+			case 24:
+				dib = FreeImage_AllocateHeader(header_only, width, height, bitcount, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
+				break;
+			default:
+				throw FI_MSG_ERROR_DIB_MEMORY;
+				break;
+		}

+		// if the dib couldn't be allocated, throw an error
 		if (!dib) {
 			throw FI_MSG_ERROR_DIB_MEMORY;
 		}
@@ -426,19 +446,23 @@ Load(FreeImageIO *io, fi_handle handle,

 				if (palette_id == 0x0C) {
 					BYTE *cmap = (BYTE*)malloc(768 * sizeof(BYTE));
-					io->read_proc(cmap, 768, 1, handle);

-					pal = FreeImage_GetPalette(dib);
-					BYTE *pColormap = &cmap[0];
+					if(cmap) {
+						io->read_proc(cmap, 768, 1, handle);

-					for(int i = 0; i < 256; i++) {
-						pal[i].rgbRed   = pColormap[0];
-						pal[i].rgbGreen = pColormap[1];
-						pal[i].rgbBlue  = pColormap[2];
-						pColormap += 3;
+						pal = FreeImage_GetPalette(dib);
+						BYTE *pColormap = &cmap[0];
+
+						for(int i = 0; i < 256; i++) {
+							pal[i].rgbRed   = pColormap[0];
+							pal[i].rgbGreen = pColormap[1];
+							pal[i].rgbBlue  = pColormap[2];
+							pColormap += 3;
+						}
+
+						free(cmap);
 					}

-					free(cmap);
 				}

 				// wrong palette ID, perhaps a gray scale is needed ?
@@ -466,9 +490,9 @@ Load(FreeImageIO *io, fi_handle handle,
 		// calculate the line length for the PCX and the DIB

 		// length of raster line in bytes
-		unsigned linelength = header.bytes_per_line * header.planes;
+		const unsigned linelength = header.bytes_per_line * header.planes;
 		// length of DIB line (rounded to DWORD) in bytes
-		unsigned pitch = FreeImage_GetPitch(dib);
+		const unsigned pitch = FreeImage_GetPitch(dib);

 		// run-length encoding ?


code:
From: Debian Science Maintainers
 <debian-science-maintainers@lists.alioth.debian.org>
Date: Mon, 10 Oct 2016 08:22:44 +0100
Subject: CVE-2016-5684

---
 Source/FreeImage/PluginXPM.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Source/FreeImage/PluginXPM.cpp b/Source/FreeImage/PluginXPM.cpp
index a698321..cc7bd07 100644
--- a/Source/FreeImage/PluginXPM.cpp
+++ b/Source/FreeImage/PluginXPM.cpp
@@ -181,6 +181,11 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
 		}
 		free(str);

+		// check info string
+		if((width <= 0) || (height <= 0) || (colors <= 0) || (cpp <= 0)) {
+			throw "Improperly formed info string";
+		}
+
         if (colors > 256) {
 			dib = FreeImage_AllocateHeader(header_only, width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK);
 		} else {
@@ -193,7 +198,7 @@ Load(FreeImageIO *io, fi_handle handle, int page, int flags, void *data) {
 			FILE_RGBA rgba;

 			str = ReadString(io, handle);
-			if(!str)
+			if(!str || (strlen(str) < (size_t)cpp))
 				throw "Error reading color strings";

 			std::string chrs(str,cpp); //create a string for the color chars using the first cpp chars