code:
Install BipartiteMatchings headers for SuperLU_DIST.  Removes global variables
and code related to performance measurement that is not useful when used in a
library setting.

--- a/BipartiteMatchings/ApproxWeightPerfectMatching.h
+++ b/BipartiteMatchings/ApproxWeightPerfectMatching.h
@@ -9,7 +9,7 @@
 #ifndef ApproxWeightPerfectMatching_h
 #define ApproxWeightPerfectMatching_h

-#include "../CombBLAS.h"
+#include "CombBLAS.h"
 #include "BPMaximalMatching.h"
 #include "BPMaximumMatching.h"
 #include <parallel/algorithm>
@@ -39,9 +39,6 @@
     std::shared_ptr<CommGrid> commGrid;
 };

-double t1Comp, t1Comm, t2Comp, t2Comm, t3Comp, t3Comm, t4Comp, t4Comm, t5Comp, t5Comm, tUpdateMateComp;
-
-
 template <class IT, class NT>
 std::vector<std::tuple<IT,IT,NT>> ExchangeData(std::vector<std::vector<std::tuple<IT,IT,NT>>> & tempTuples, MPI_Comm World)
 {
@@ -391,7 +388,7 @@

-int ThreadBuffLenForBinning(int itemsize, int nbins)
+inline int ThreadBuffLenForBinning(int itemsize, int nbins)
 {
     // 1MB shared cache (per 2 cores) in KNL
 #ifndef L2_CACHE_SIZE
@@ -417,7 +414,6 @@

-    double tstart = MPI_Wtime();

     MPI_Comm World = param.commGrid->GetWorld();
@@ -528,9 +524,6 @@
         }
     }

-    t1Comp = MPI_Wtime() - tstart;
-    tstart = MPI_Wtime();
-
     // Step 3: Communicate data

     std::vector<int> recvcnt (param.nprocs);
@@ -548,7 +541,6 @@
     std::vector< std::tuple<IT,IT,NT> > recvTuples1(totrecv);
     MPI_Alltoallv(sendTuples.data(), sendcnt.data(), sdispls.data(), MPI_tuple, recvTuples1.data(), recvcnt.data(), rdispls.data(), MPI_tuple, World);
     MPI_Type_free(&MPI_tuple);
-    t1Comm = MPI_Wtime() - tstart;
     return recvTuples1;
 }

@@ -730,9 +722,6 @@

     // Step 4: Communicate data

-    t2Comp = MPI_Wtime() - tstart;
-    tstart = MPI_Wtime();
-
     std::vector<int> recvcnt (param.nprocs);
     std::vector<int> rdispls (param.nprocs, 0);

@@ -748,7 +737,6 @@
     std::vector< std::tuple<IT,IT,IT,NT> > recvTuples1(totrecv);
     MPI_Alltoallv(sendTuples.data(), sendcnt.data(), sdispls.data(), MPI_tuple, recvTuples1.data(), recvcnt.data(), rdispls.data(), MPI_tuple, World);
     MPI_Type_free(&MPI_tuple);
-    t2Comm = MPI_Wtime() - tstart;
     return recvTuples1;
 }

@@ -836,7 +824,6 @@
     param.myrank = myrank;
     param.commGrid = commGrid;

-    double t1CompAll = 0, t1CommAll = 0, t2CompAll = 0, t2CommAll = 0, t3CompAll = 0, t3CommAll = 0, t4CompAll = 0, t4CommAll = 0, t5CompAll = 0, t5CommAll = 0, tUpdateMateCompAll = 0, tUpdateWeightAll = 0;

 	// -----------------------------------------------------------
 	// replicate mate vectors for mateCol2Row
@@ -975,11 +962,7 @@
 		}

 		//vector< tuple<IT,IT,IT, NT> >().swap(recvTuples1);
-		double t3Comp = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();
 		recvTuples1 = ExchangeData1(tempTuples1, World);
-		double t3Comm = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();

 		std::vector<std::tuple<IT,IT,IT,IT, NT>> bestTuplesPhase4 (lncol);
 		// we could have used lnrow in both bestTuplesPhase3 and bestTuplesPhase4
@@ -1041,14 +1024,9 @@

 		//vector< tuple<IT,IT,IT, NT> >().swap(recvTuples1);
-		double t4Comp = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();

 		std::vector<std::tuple<IT,IT,IT,IT>> recvWinnerTuples = ExchangeData1(winnerTuples, World);

-		double t4Comm = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();
-
 		// at the owner of (mj,j)
 		std::vector<std::tuple<IT,IT>> rowBcastTuples(recvWinnerTuples.size()); //(mi,mj)
 		std::vector<std::tuple<IT,IT>> colBcastTuples(recvWinnerTuples.size()); //(j,i)
@@ -1065,15 +1043,10 @@
 			colBcastTuples[k] = std::make_tuple(j,i);
 			rowBcastTuples[k] = std::make_tuple(mj,mi);
 		}
-		double t5Comp = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();

 		std::vector<std::tuple<IT,IT>> updatedR2C = MateBcast(rowBcastTuples, RowWorld);
 		std::vector<std::tuple<IT,IT>> updatedC2R = MateBcast(colBcastTuples, ColWorld);

-		double t5Comm = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();
-
 #ifdef THREADED
 #pragma omp parallel for
 #endif
@@ -1095,13 +1068,9 @@
 		}

-		double tUpdateMateComp = MPI_Wtime() - tstart;
-		tstart = MPI_Wtime();
 		// update weights of matched edges
 		// we can do better than this since we are doing sparse updates
 		ReplicateMateWeights(param, dcsc, colptr, RepMateC2R, RepMateWR2C, RepMateWC2R);
-		double tUpdateWeight = MPI_Wtime() - tstart;
-

 		weightPrev = weightCur;
 		weightCur = MatchingWeight(RepMateWC2R, RowWorld, minw);
@@ -1110,32 +1079,8 @@
 		//UpdateMatching(mateRow2Col, mateCol2Row, RepMateR2C, RepMateC2R);
 		//CheckMatching(mateRow2Col,mateCol2Row);

-		if(myrank==0)
-		{
-			std::cout  <<  t1Comp << " " << t1Comm << " "<< t2Comp << " " << t2Comm << " " << t3Comp << " " << t3Comm << " " << t4Comp << " " << t4Comm << " " << t5Comp << " " << t5Comm << " " << tUpdateMateComp << " " << tUpdateWeight << std::endl;
-
-            t1CompAll += t1Comp;
-            t1CommAll += t1Comm;
-            t2CompAll += t2Comp;
-            t2CommAll += t2Comm;
-            t3CompAll += t3Comp;
-            t3CommAll += t3Comm;
-            t4CompAll += t4Comp;
-            t4CommAll += t4Comm;
-            t5CompAll += t5Comp;
-            t5CommAll += t5Comm;
-            tUpdateMateCompAll += tUpdateMateComp;
-            tUpdateWeightAll += tUpdateWeight;
-
-		}
 	}

-    if(myrank==0)
-    {
-        std::cout << "=========== overal timing ==========" << std::endl;
-        std::cout  <<  t1CompAll << " " << t1CommAll << " " << t2CompAll << " " << t2CommAll << " " << t3CompAll << " " << t3CommAll << " " << t4CompAll << " " << t4CommAll << " " << t5CompAll << " " << t5CommAll << " " << tUpdateMateCompAll << " " << tUpdateWeightAll << std::endl;
-    }
-
 	// update the distributed mate vectors from replicated mate vectors
 	UpdateMatching(mateRow2Col, mateCol2Row, RepMateR2C, RepMateC2R);
 	//weightCur = MatchingWeight(RepMateWC2R, RowWorld);
--- a/BipartiteMatchings/BPMaximalMatching.h
+++ b/BipartiteMatchings/BPMaximalMatching.h
@@ -1,7 +1,7 @@
 #ifndef BP_MAXIMAL_MATCHING_H
 #define BP_MAXIMAL_MATCHING_H

-#include "../CombBLAS.h"
+#include "CombBLAS.h"
 #include <iostream>
 #include <functional>
 #include <algorithm>
@@ -14,8 +14,6 @@
 #define GREEDY 1
 #define KARP_SIPSER 2
 #define DMD 3
-MTRand GlobalMT(123); // for reproducible result
-double tTotalMaximal;

 namespace combblas {

@@ -25,7 +25,7 @@
 void MaximalMatching(Par_DCSC_Bool & A, Par_DCSC_Bool & AT, FullyDistVec<IT, IT>& mateRow2Col,
             FullyDistVec<IT, IT>& mateCol2Row, FullyDistVec<IT, IT>& degColRecv, int type, bool rand=true)
 {
-
+    static MTRand GlobalMT(123); // for reproducible result
 	typedef VertexTypeML < IT, IT> VertexType;
     int nprocs, myrank;
     MPI_Comm_size(MPI_COMM_WORLD,&nprocs);
@@ -354,8 +354,6 @@

 	}

-    tTotalMaximal = MPI_Wtime() - tStart;
-
 	IT cardinality = mateRow2Col.Count([](IT mate){return mate!=-1;});
 	std::vector<double> totalTimes(timing[0].size(),0);
 	for(int i=0; i<timing.size(); i++)
--- a/BipartiteMatchings/BPMaximumMatching.h
+++ b/BipartiteMatchings/BPMaximumMatching.h
@@ -1,7 +1,7 @@
 #ifndef BP_MAXIMUM_MATCHING_H
 #define BP_MAXIMUM_MATCHING_H

-#include "../CombBLAS.h"
+#include "CombBLAS.h"
 #include <mpi.h>
 #include <sys/time.h>
 #include <iostream>
@@ -11,7 +11,6 @@
 #include <string>
 #include <sstream>
 #include "MatchingDefs.h"
-double tTotalMaximum;

 namespace combblas {

@@ -231,7 +231,7 @@
 void maximumMatching(SpParMat < IT, NT, DER > & A, FullyDistVec<IT, IT>& mateRow2Col,
                      FullyDistVec<IT, IT>& mateCol2Row, bool prune=true, bool randMM = false, bool maximizeWeight = false)
 {
-
+    static MTRand GlobalMT(123); // for reproducible result
 	typedef VertexTypeMM <IT> VertexType;

     int nthreads=1;
@@ -420,8 +420,6 @@

     MPI_Win_free(&winLeaves);

-    tTotalMaximum = MPI_Wtime() - tstart;
-
     //isMaximalmatching(A, mateRow2Col, mateCol2Row, unmatchedRow, unmatchedCol);
     //isMatching(mateCol2Row, mateRow2Col); //todo there is a better way to check this

--- a/BipartiteMatchings/MatchingDefs.h
+++ b/BipartiteMatchings/MatchingDefs.h
@@ -9,7 +9,7 @@
 #ifndef MatchingDefs_h
 #define MatchingDefs_h

-#include "../CombBLAS.h"
+#include "CombBLAS.h"
 #include <iostream>

 namespace combblas {
--- a/BipartiteMatchings/Utility.h
+++ b/BipartiteMatchings/Utility.h
@@ -1,7 +1,7 @@
 #ifndef BP_UTILITY_H
 #define BP_UTILITY_H

-#include "../CombBLAS.h"
+#include "CombBLAS.h"

 namespace combblas {

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -68,6 +68,7 @@ set_property(TARGET CombBLAS PROPERTY VERSION ${CombBLAS_VERSION})
 # installation
 install(DIRECTORY include/ DESTINATION include)
 install(DIRECTORY psort-1.0/include/ DESTINATION include)
+install(DIRECTORY BipartiteMatchings DESTINATION include FILES_MATCHING PATTERN "*.h")
 install(TARGETS CombBLAS EXPORT CombBLASTargets
   LIBRARY DESTINATION lib
   ARCHIVE DESTINATION lib


code:
IO not appropriate in the context of a sorting routine, and in any case the
proper headers are not included, so gcc emits an undefined symbol error.
Remove the "printf" statement.

--- CombBLAS_beta_16_2/usort/include/usort/seqUtils.tcc
+++ CombBLAS_beta_16_2/usort/include/usort/seqUtils.tcc
@@ -142,7 +142,6 @@
       }
         if ( (a[nmax]==a[nmin]) && (ctr==0) )
         {
-          printf("All the numbers are identical, the list is sorted\n");
           return;
         }

repo_name: maximed/guix

license: mit


code:
Patch taken from upstream to fix cross-compilation for aarch64.  This can be
removed on the next coreutils release.

From 10fcb97bd728f09d4a027eddf8ad2900f0819b0a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 5 Mar 2020 17:25:29 -0800
Subject: [PATCH] ls: restore 8.31 behavior on removed directories

* NEWS: Mention this.
* src/ls.c: Do not include <sys/sycall.h>
(print_dir): Don't worry about whether the directory is removed.
* tests/ls/removed-directory.sh: Adjust to match new (i.e., old)
behavior.
---
 NEWS                          |  6 ++++++
 src/ls.c                      | 22 ----------------------
 tests/ls/removed-directory.sh | 10 ++--------
 3 files changed, 8 insertions(+), 30 deletions(-)

diff --git a/NEWS b/NEWS
index fdc8bf5db..653e7178b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ GNU coreutils NEWS                                    -*- outline -*-

 * Noteworthy changes in release ?.? (????-??-??) [?]

+** Changes in behavior
+
+  On GNU/Linux systems, ls no longer issues an error message on
+  directory merely because it was removed.  This reverts a change
+  that was made in release 8.32.
+

 * Noteworthy changes in release 8.32 (2020-03-05) [stable]

diff --git a/src/ls.c b/src/ls.c
index 24b983287..4acf5f44d 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -49,10 +49,6 @@
 # include <sys/ptem.h>
 #endif

-#ifdef __linux__
-# include <sys/syscall.h>
-#endif
-
 #include <stdio.h>
 #include <assert.h>
 #include <setjmp.h>
@@ -2896,7 +2892,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
   struct dirent *next;
   uintmax_t total_blocks = 0;
   static bool first = true;
-  bool found_any_entries = false;

   errno = 0;
   dirp = opendir (name);
@@ -2972,7 +2967,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
       next = readdir (dirp);
       if (next)
         {
-          found_any_entries = true;
           if (! file_ignored (next->d_name))
             {
               enum filetype type = unknown;
@@ -3018,22 +3012,6 @@ print_dir (char const *name, char const *realname, bool command_line_arg)
           if (errno != EOVERFLOW)
             break;
         }
-#ifdef __linux__
-      else if (! found_any_entries)
-        {
-          /* If readdir finds no directory entries at all, not even "." or
-             "..", then double check that the directory exists.  */
-          if (syscall (SYS_getdents, dirfd (dirp), NULL, 0) == -1
-              && errno != EINVAL)
-            {
-              /* We exclude EINVAL as that pertains to buffer handling,
-                 and we've passed NULL as the buffer for simplicity.
-                 ENOENT is returned if appropriate before buffer handling.  */
-              file_failure (command_line_arg, _("reading directory %s"), name);
-            }
-          break;
-        }
-#endif
       else
         break;

diff --git a/tests/ls/removed-directory.sh b/tests/ls/removed-directory.sh
index e8c835dab..fe8f929a1 100755
--- a/tests/ls/removed-directory.sh
+++ b/tests/ls/removed-directory.sh
@@ -26,20 +26,14 @@ case $host_triplet in
   *) skip_ 'non linux kernel' ;;
 esac

-LS_FAILURE=2
-
-cat <<\EOF >exp-err || framework_failure_
-ls: reading directory '.': No such file or directory
-EOF
-
 cwd=$(pwd)
 mkdir d || framework_failure_
 cd d || framework_failure_
 rmdir ../d || framework_failure_

-returns_ $LS_FAILURE ls >../out 2>../err || fail=1
+ls >../out 2>../err || fail=1
 cd "$cwd" || framework_failure_
 compare /dev/null out || fail=1
-compare exp-err err || fail=1
+compare /dev/null err || fail=1

 Exit $fail


code:
Add an extra layer of quoting to ltmain.sh sanity check.

--- a/configure	2005-05-07 14:19:31.000000000 +0200
+++ b/configure	2015-02-10 11:16:32.456146934 +0100
@@ -6266,7 +6266,7 @@
   exit 1
 fi
 gentoo_lt_version="1.5.16"
-gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'`
+gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
 if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
--- a/aclocal.m4	2005-05-07 14:19:25.000000000 +0200
+++ b/aclocal.m4	2015-02-10 11:16:15.352030318 +0100
@@ -246,7 +246,7 @@
   exit 1
 fi
 gentoo_lt_version="1.5.16"
-gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
+gentoo_ltmain_version=`[grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||']`
 if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
   AC_MSG_RESULT(no)
   echo
--- a/libcpufreq/configure	2005-05-07 14:19:31.000000000 +0200
+++ b/libcpufreq/configure	2015-02-10 11:16:32.456146934 +0100
@@ -6266,7 +6266,7 @@
   exit 1
 fi
 gentoo_lt_version="1.5.16"
-gentoo_ltmain_version=`grep '^[:space:]*VERSION=' $ltmain | sed -e 's|^[:space:]*VERSION=||'`
+gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
 if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
   echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
--- a/libcpufreq/aclocal.m4	2005-05-07 14:19:25.000000000 +0200
+++ b/libcpufreq/aclocal.m4	2015-02-10 11:16:15.352030318 +0100
@@ -246,7 +246,7 @@
   exit 1
 fi
 gentoo_lt_version="1.5.16"
-gentoo_ltmain_version=`grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||'`
+gentoo_ltmain_version=`[grep '^[[:space:]]*VERSION=' $ltmain | sed -e 's|^[[:space:]]*VERSION=||']`
 if test "$gentoo_lt_version" != "$gentoo_ltmain_version"; then
   AC_MSG_RESULT(no)
   echo


code:
Store the crawl version in the textdatabases in SAVEDIR and
upgrade the databases when the crawl version changes.

By default crawl checks for a mtime difference on files in DATADIR to see if an
upgrade is required, but guix nulls all file dates,
and crawl would never upgrade saves.

diff -ur a/source/database.cc b/source/database.cc
--- a/source/database.cc	2018-08-09 21:49:26.000000000 -0400
+++ b/source/database.cc	2018-10-07 18:06:41.022445789 -0400
@@ -25,6 +25,7 @@
 #include "syscalls.h"
 #include "threads.h"
 #include "unicode.h"
+#include "version.h"

 // TextDB handles dependency checking the db vs text files, creating the
 // db, loading, and destroying the DB.
@@ -55,6 +56,7 @@
     vector<string> _input_files;
     DBM* _db;
     string timestamp;
+    string version;
     TextDB *_parent;
     const char* lang() { return _parent ? Options.lang_name : 0; }
 public:
@@ -163,7 +165,7 @@

 TextDB::TextDB(const char* db_name, const char* dir, vector<string> files)
     : _db_name(db_name), _directory(dir), _input_files(files),
-      _db(nullptr), timestamp(""), _parent(0), translation(0)
+      _db(nullptr), timestamp(""), version(""),  _parent(0), translation(0)
 {
 }

@@ -171,7 +173,7 @@
     : _db_name(parent->_db_name),
       _directory(parent->_directory + Options.lang_name + "/"),
       _input_files(parent->_input_files), // FIXME: pointless copy
-      _db(nullptr), timestamp(""), _parent(parent), translation(nullptr)
+      _db(nullptr), timestamp(""), version(""), _parent(parent), translation(nullptr)
 {
 }

@@ -186,6 +188,9 @@
         return false;

     timestamp = _query_database(*this, "TIMESTAMP", false, false, true);
+    version = _query_database(*this, "VERSION", false, false, true);
+    if (version.empty())
+        return false;
     if (timestamp.empty())
         return false;

@@ -229,6 +234,9 @@
     string ts;
     bool no_files = true;

+    if (string(Version::Long) != version)
+        return true;
+
     for (const string &file : _input_files)
     {
         string full_input_path = _directory + file;
@@ -245,7 +253,7 @@
         ts += buf;
     }

-    if (no_files && timestamp.empty())
+    if (no_files && timestamp.empty() && version.empty())
     {
         // No point in empty databases, although for simplicity keep ones
         // for disappeared translations for now.
@@ -313,7 +321,10 @@
             _store_text_db(full_input_path, _db);
         }
     }
+
+    string current_version = string(Version::Long);
     _add_entry(_db, "TIMESTAMP", ts);
+    _add_entry(_db, "VERSION", current_version);

     dbm_close(_db);
     _db = 0;


code:
This patch allows us to make the libgcrypt dependency optional (which it
is, if you look at the code), which in turns allows us to build CRDA
without the signature-checking capability on 'regulatory.bin'.

--- crda/Makefile	2015-07-17 11:33:33.546712893 +0200
+++ crda/Makefile	2015-07-17 11:34:05.210994373 +0200
@@ -45,12 +45,14 @@ LDLIBS += `pkg-config --libs openssl`
 $(LIBREG): keys-ssl.c

 else
+ifeq ($(USE_GCRYPT),1)
 CFLAGS += -DUSE_GCRYPT
 LDLIBS += -lgcrypt

 $(LIBREG): keys-gcrypt.c

 endif
+endif
 MKDIR ?= mkdir -p
 INSTALL ?= install


code:
Unconditionally disable network check for new versions (from Fedora).

diff -u /home/dlove/rpmbuild/BUILD/cube-4.3.4/src/GUI-qt/display/VersionCheckWidget.cpp\~ /home/dlove/rpmbuild/BUILD/cube-4.3.4/src/GUI-qt/display/VersionCheckWidget.cpp
--- cube-4.3.4/src/GUI-qt/display/VersionCheckWidget.cpp~	2016-04-03 00:05:37.942066948 +0100
+++ cube-4.3.4/src/GUI-qt/display/VersionCheckWidget.cpp	2016-05-06 17:16:31.648143908 +0100
@@ -52,7 +52,8 @@
     url              = QUrl( UPDATE_CHECK_URL );
     download         = NULL;
     update_Available = false;
-    bool no_http = env_str2bool( getenv( "CUBE_DISABLE_HTTP_DOCS" ) );
+    // bool no_http = env_str2bool( getenv( "CUBE_DISABLE_HTTP_DOCS" ) );
+    bool no_http = true;
     if ( !no_http )
     {
         updateDescription =   tr( "Check for update is not performed yet." );


code:
From efbea1742bd30f842fbbfb87a473e5c84f4162f9 Mon Sep 17 00:00:00 2001
From: Michael R Sweet <msweet@msweet.org>
Date: Mon, 1 Feb 2021 15:02:32 -0500
Subject: [PATCH] Fix a buffer (read) overflow in ippReadIO (CVE-2020-10001)

---

diff --git a/cups/ipp.c b/cups/ipp.c
index 3d529346c..adbb26fba 100644
--- a/cups/ipp.c
+++ b/cups/ipp.c
@@ -2866,7 +2866,8 @@ ippReadIO(void       *src,		/* I - Data source */
   unsigned char		*buffer,	/* Data buffer */
 			string[IPP_MAX_TEXT],
 					/* Small string buffer */
-			*bufptr;	/* Pointer into buffer */
+			*bufptr,	/* Pointer into buffer */
+			*bufend;	/* End of buffer */
   ipp_attribute_t	*attr;		/* Current attribute */
   ipp_tag_t		tag;		/* Current tag */
   ipp_tag_t		value_tag;	/* Current value tag */
@@ -3441,6 +3442,7 @@ ippReadIO(void       *src,		/* I - Data source */
 		}

                 bufptr = buffer;
+                bufend = buffer + n;

 	       /*
 	        * text-with-language and name-with-language are composite
@@ -3454,7 +3456,7 @@ ippReadIO(void       *src,		/* I - Data source */

 		n = (bufptr[0] << 8) | bufptr[1];

-		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE) || n >= (int)sizeof(string))
+		if ((bufptr + 2 + n + 2) > bufend || n >= (int)sizeof(string))
 		{
 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
 		                _("IPP language length overflows value."), 1);
@@ -3481,7 +3483,7 @@ ippReadIO(void       *src,		/* I - Data source */
                 bufptr += 2 + n;
 		n = (bufptr[0] << 8) | bufptr[1];

-		if ((bufptr + 2 + n) >= (buffer + IPP_BUF_SIZE))
+		if ((bufptr + 2 + n) > bufend)
 		{
 		  _cupsSetError(IPP_STATUS_ERROR_INTERNAL,
 		                _("IPP string length overflows value."), 1);


code:
Make libcurl respect the SSL_CERT_{DIR,FILE} variables by default. The variables
are fetched during initialization to preserve thread-safety (curl_global_init(3)
must be called when no other threads exist).

This fixes network functionality in rust:cargo, and probably removes the need
for other future workarounds.
===================================================================
--- curl-7.66.0.orig/lib/easy.c	2020-01-02 15:43:11.883921171 +0100
+++ curl-7.66.0/lib/easy.c	2020-01-02 16:18:54.691882797 +0100
@@ -134,6 +134,9 @@
 #  pragma warning(default:4232) /* MSVC extension, dllimport identity */
 #endif

+char * Curl_ssl_cert_dir = NULL;
+char * Curl_ssl_cert_file = NULL;
+
 /**
  * curl_global_init() globally initializes curl given a bitwise set of the
  * different features of what to initialize.
@@ -155,6 +158,9 @@
 #endif
   }

+  Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR");
+  Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE");
+
   if(!Curl_ssl_init()) {
     DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
     return CURLE_FAILED_INIT;
@@ -260,6 +266,9 @@
   Curl_ssl_cleanup();
   Curl_resolver_global_cleanup();

+  free(Curl_ssl_cert_dir);
+  free(Curl_ssl_cert_file);
+
 #ifdef WIN32
   Curl_win32_cleanup(init_flags);
 #endif
diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
--- curl-7.66.0.orig/lib/url.c	2020-01-02 15:43:11.883921171 +0100
+++ curl-7.66.0/lib/url.c	2020-01-02 16:21:11.563880346 +0100
@@ -524,6 +524,21 @@
     if(result)
       return result;
 #endif
+    extern char * Curl_ssl_cert_dir;
+    extern char * Curl_ssl_cert_file;
+    if(Curl_ssl_cert_dir) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH], Curl_ssl_cert_dir))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
+            return result;
+    }
+
+    if(Curl_ssl_cert_file) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE], Curl_ssl_cert_file))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
+            return result;
+    }
   }

   set->wildcard_enabled = FALSE;


code:
cURL 7.77.0 would use a bogus TLS priority string favoring older TLS
protocol versions, which in turn would prevent access to bitbucket.org:

  https://issues.guix.gnu.org/49035
  https://github.com/curl/curl/pull/7278

This patch fixes it.
From <https://github.com/curl/curl/pull/7278/commits/b98f79f6ecdb708c67f9a0cec56ce48952a54556>.

From b98f79f6ecdb708c67f9a0cec56ce48952a54556 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Fri, 18 Jun 2021 14:54:07 +0200
Subject: [PATCH] gnutls: set the prefer ciphers in correct order

Reported-by: civodul on github
Assisted-by: Nikos Mavrogiannopoulos
Fixes #7277
---
 lib/vtls/gtls.c | 30 +++++++++++++-----------------
 1 file changed, 13 insertions(+), 17 deletions(-)

diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c
index d9bc5611e8f9..da2af64955c3 100644
--- a/lib/vtls/gtls.c
+++ b/lib/vtls/gtls.c
@@ -330,6 +330,9 @@ set_ssl_version_min_max(struct Curl_easy *data,
       ssl_version_max = CURL_SSLVERSION_MAX_TLSv1_2;
     }
   }
+  else if(ssl_version_max == CURL_SSLVERSION_MAX_DEFAULT) {
+    ssl_version_max = CURL_SSLVERSION_MAX_TLSv1_3;
+  }

   switch(ssl_version | ssl_version_max) {
   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_0:
@@ -338,11 +341,11 @@ set_ssl_version_min_max(struct Curl_easy *data,
     return CURLE_OK;
   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_1:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.0:+VERS-TLS1.1";
+      "+VERS-TLS1.1:+VERS-TLS1.0";
     return CURLE_OK;
   case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_2:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.0:+VERS-TLS1.1:+VERS-TLS1.2";
+      "+VERS-TLS1.2:+VERS-TLS1.1:+VERS-TLS1.0";
     return CURLE_OK;
   case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_1:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
@@ -350,7 +353,7 @@ set_ssl_version_min_max(struct Curl_easy *data,
     return CURLE_OK;
   case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_2:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.1:+VERS-TLS1.2";
+      "+VERS-TLS1.2:+VERS-TLS1.1";
     return CURLE_OK;
   case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_2:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
@@ -360,25 +363,17 @@ set_ssl_version_min_max(struct Curl_easy *data,
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
       "+VERS-TLS1.3";
     return CURLE_OK;
-  case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_DEFAULT:
-    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.0:+VERS-TLS1.1:+VERS-TLS1.2"
-      ":+VERS-TLS1.3";
+  case CURL_SSLVERSION_TLSv1_0 | CURL_SSLVERSION_MAX_TLSv1_3:
+    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0";
     return CURLE_OK;
-  case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_DEFAULT:
+  case CURL_SSLVERSION_TLSv1_1 | CURL_SSLVERSION_MAX_TLSv1_3:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.1:+VERS-TLS1.2"
-      ":+VERS-TLS1.3";
+      "+VERS-TLS1.3:+VERS-TLS1.2:+VERS-TLS1.1";
     return CURLE_OK;
-  case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_DEFAULT:
+  case CURL_SSLVERSION_TLSv1_2 | CURL_SSLVERSION_MAX_TLSv1_3:
     *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.2"
-      ":+VERS-TLS1.3";
+      "+VERS-TLS1.3:+VERS-TLS1.2";
     return CURLE_OK;
-  case CURL_SSLVERSION_TLSv1_3 | CURL_SSLVERSION_MAX_DEFAULT:
-    *prioritylist = GNUTLS_CIPHERS ":-VERS-SSL3.0:-VERS-TLS-ALL:"
-      "+VERS-TLS1.2"
-      ":+VERS-TLS1.3";
     return CURLE_OK;
   }

@@ -608,6 +603,7 @@ gtls_connect_step1(struct Curl_easy *data,
   }
   else {
 #endif
+    infof(data, "GnuTLS ciphers: %s\n", prioritylist);
     rc = gnutls_priority_set_direct(session, prioritylist, &err);
 #ifdef HAVE_GNUTLS_SRP
   }


code:
Make libcurl respect the SSL_CERT_{DIR,FILE} variables by default. The variables
are fetched during initialization to preserve thread-safety (curl_global_init(3)
must be called when no other threads exist).

This fixes network functionality in rust:cargo, and probably removes the need
for other future workarounds.
===================================================================
--- curl-7.66.0.orig/lib/easy.c	2020-01-02 15:43:11.883921171 +0100
+++ curl-7.66.0/lib/easy.c	2020-01-02 16:18:54.691882797 +0100
@@ -134,6 +134,9 @@
 #  pragma warning(default:4232) /* MSVC extension, dllimport identity */
 #endif

+char * Curl_ssl_cert_dir = NULL;
+char * Curl_ssl_cert_file = NULL;
+
 /**
  * curl_global_init() globally initializes curl given a bitwise set of the
  * different features of what to initialize.
@@ -155,6 +158,9 @@
 #endif
   }

+  Curl_ssl_cert_dir = curl_getenv("SSL_CERT_DIR");
+  Curl_ssl_cert_file = curl_getenv("SSL_CERT_FILE");
+
   if(!Curl_ssl_init()) {
     DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
     return CURLE_FAILED_INIT;
@@ -260,6 +266,9 @@
   Curl_ssl_cleanup();
   Curl_resolver_global_cleanup();

+  free(Curl_ssl_cert_dir);
+  free(Curl_ssl_cert_file);
+
 #ifdef WIN32
   Curl_win32_cleanup(init_flags);
 #endif
diff -ur curl-7.66.0.orig/lib/url.c curl-7.66.0/lib/url.c
--- curl-7.66.0.orig/lib/url.c	2020-01-02 15:43:11.883921171 +0100
+++ curl-7.66.0/lib/url.c	2020-01-02 16:21:11.563880346 +0100
@@ -524,6 +524,21 @@
     if(result)
       return result;
 #endif
+    extern char * Curl_ssl_cert_dir;
+    extern char * Curl_ssl_cert_file;
+    if(Curl_ssl_cert_dir) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_ORIG], Curl_ssl_cert_dir))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAPATH_PROXY], Curl_ssl_cert_dir))
+            return result;
+    }
+
+    if(Curl_ssl_cert_file) {
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_ORIG], Curl_ssl_cert_file))
+            return result;
+        if(result = Curl_setstropt(&set->str[STRING_SSL_CAFILE_PROXY], Curl_ssl_cert_file))
+            return result;
+    }
   }

   set->wildcard_enabled = FALSE;


code:
Related to https://github.com/mtytel/cursynth/issues/9

--- a/mopo/src/wave.h	2014-06-25 14:10:57.827369578 -0500
+++ b/mopo/src/wave.h	2014-06-25 14:08:15.795376354 -0500
@@ -19,6 +19,7 @@
 #define WAVE_H

 #include "mopo.h"
+#include <cstdlib>
 #include <cmath>

 #define LOOKUP_SIZE 2048


code:
Fix CVE-2017-12836:

http://cve.mitre.org/cgi-bin/cvename.cgi?name=2017-12836
https://security-tracker.debian.org/tracker/CVE-2017-12836

Patch adpated from Debian (comments and changelog annotations removed):

https://anonscm.debian.org/cgit/collab-maint/cvs.git/commit/?h=stretch&id=41e077396e35efb6c879951f44c62dd8a1d0f094

From 41e077396e35efb6c879951f44c62dd8a1d0f094 Mon Sep 17 00:00:00 2001
From: mirabilos <m@mirbsd.org>
Date: Sat, 12 Aug 2017 03:17:18 +0200
Subject: Fix CVE-2017-12836 (Closes: #871810) for stretch

---
 debian/changelog |  6 ++++++
 src/rsh-client.c | 10 ++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/rsh-client.c b/src/rsh-client.c
index fe0cfc4..1fc860d 100644
--- a/src/rsh-client.c
+++ b/src/rsh-client.c
@@ -105,6 +106,9 @@ start_rsh_server (cvsroot_t *root, struct buffer **to_server_p,
 	rsh_argv[i++] = argvport;
     }

+    /* Only non-option arguments from here. (CVE-2017-12836) */
+    rsh_argv[i++] = "--";
+
     rsh_argv[i++] = root->hostname;
     rsh_argv[i++] = cvs_server;
     if (readonlyfs)
@@ -189,6 +193,8 @@ start_rsh_server (cvsroot_t *root, struct buffer **to_server_p,
 		*p++ = argvport;
 	}

+	*p++ = "--";
+
 	*p++ = root->hostname;
 	*p++ = command;
 	*p++ = NULL;
--
cgit v0.12


code:
From dcc9f51cbd4ed622cfb0f9b1c141eb2ffe3b12f1 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@symas.com>
Date: Tue, 18 Feb 2020 19:05:12 +0000
Subject: [PATCH] Fix #587

Off by one error in common.c, CVE-2019-19906.

Thanks to Stephan Zeisberg for reporting
---
 lib/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/common.c b/lib/common.c
index bc3bf1df..9969d6aa 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -190,7 +190,7 @@ int _sasl_add_string(char **out, size_t *alloclen,

   if (add==NULL) add = "(null)";

-  addlen=strlen(add); /* only compute once */
+  addlen=strlen(add)+1; /* only compute once */
   if (_buf_alloc(out, alloclen, (*outlen)+addlen)!=SASL_OK)
     return SASL_NOMEM;


code:
--- a/m4/sasl2.m4	2018-11-18 22:33:29.902625600 +0300
+++ b/m4/sasl2.m4	2018-11-18 22:33:59.828746176 +0300
@@ -339,7 +339,8 @@
 ],
 	[ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
 	AC_MSG_RESULT(yes) ],
-	AC_MSG_RESULT(no))
+	AC_MSG_RESULT(no),
+    AC_MSG_RESULT(no))
   LIBS="$cmu_save_LIBS"

 else


code:
From e56b2dce7e89a92e1b9b35caa13b3e938c4cedea Mon Sep 17 00:00:00 2001
From: Cole Mickens <cole.mickens@gmail.com>
Date: Sun, 26 Jan 2020 01:27:08 -0800
Subject: [PATCH] CMakeLists.txt: output date.pc for pkg-config

---
 CMakeLists.txt | 15 +++++++++++++++
 date.pc.in     | 10 ++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 date.pc.in

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f30c473..fe778e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -128,6 +128,15 @@ if( BUILD_TZ_LIB )
     endif( )
 endif( )

+if ( BUILD_TZ_LIB )
+  # Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@
+  set( TZ_COMPILE_DEFINITIONS "$<IF:$<TARGET_EXISTS:tz>,-D$<JOIN:$<TARGET_PROPERTY:tz,INTERFACE_COMPILE_DEFINITIONS>, -D>,>" )
+  configure_file(date.pc.in date.pc.cf @ONLY)
+  file( GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc"
+    INPUT "${CMAKE_CURRENT_BINARY_DIR}/date.pc.cf" )
+
+endif( )
+
 #[===================================================================[
    installation
 #]===================================================================]
@@ -171,6 +180,12 @@ install (
   FILES cmake/dateConfig.cmake "${version_config}"
   DESTINATION ${CONFIG_LOC})

+if ( BUILD_TZ_LIB )
+  install(
+    FILES ${CMAKE_BINARY_DIR}/date.pc
+    DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endif( )
+
 #[===================================================================[
    testing
 #]===================================================================]
diff --git a/date.pc.in b/date.pc.in
new file mode 100644
index 0000000..b9c4623
--- /dev/null
+++ b/date.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_BINDIR@
+libdir=@CMAKE_INSTALL_LIB@
+includedir=@CMAKE_INSTALL_INCLUDE@
+
+Name: date
+Description: A date and time library based on the C++11/14/17 <chrono> header
+Version: @PACKAGE_VERSION@
+Libs: -L${libdir} -ltz
+Cflags: -I${includedir} @TZ_COMPILE_DEFINITIONS@


code:
Add the 'restrict' qualifier to match the 'gettimeofday' declaration found
in glibc 2.31.

--- datefudge-1.23/datefudge.c	2020-02-17 22:35:21.343341725 +0100
+++ datefudge-1.23/datefudge.c	2020-02-17 22:35:49.619117874 +0100
@@ -78,6 +78,6 @@
     return 0;
 }

-int gettimeofday(struct timeval *x, struct timezone *y) {
+int gettimeofday(struct timeval *restrict x, void *restrict y) {
     return __gettimeofday(x,y);
 }


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sat, 11 Apr 2020 03:02:04 +0200
Subject: [PATCH] gnu: dbacl: Include <locale.h> in dbacl.h.

Copied verbatim[0] from Debian.

[0]: https://sources.debian.org/data/main/d/dbacl/1.14.1-2/debian/patches/05-locale-h.patch

Description: Add missing <locale.h> include in dbacl.h
Author: Fabian Wolff <fabi.wolff@arcor.de>
Bug-Debian: https://bugs.debian.org/916182
Last-Update: 2019-08-25
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/dbacl.h
+++ b/src/dbacl.h
@@ -21,6 +21,8 @@
 #ifndef DBACL_H
 #define DBACL_H

+#include <locale.h>
+
 #ifdef HAVE_CONFIG_H
 #undef HAVE_CONFIG_H
 #include "config.h"
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,7 +28,7 @@
 # stuff_SOURCES = stuff.c stuff.h fram.c stuff-lexer.l stuff-parser.y stuff-parser.h probs.c util.c util.h $(PUBDOM)
 # stuff_LDADD = @LEXLIB@

-AM_CFLAGS = -funsigned-char -std=c99 -Wall -pedantic $(CFLAGSIEEE) -O3
+AM_CFLAGS = -funsigned-char -std=c99 -D_XOPEN_SOURCE=700 -Wall -pedantic $(CFLAGSIEEE) -O3
 AM_YFLAGS = -d

 CLEANFILES = mailcross mailtoe mailfoot


code:
Fix CVE-2020-12049:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-12049
https://lists.freedesktop.org/archives/ftp-release/2020-June/000753.html

Taken from upstream:

https://gitlab.freedesktop.org/dbus/dbus/-/commit/272d484283883fa9ff95b69d924fff6cd34842f5

diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -435,18 +435,6 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
       struct cmsghdr *cm;
       dbus_bool_t found = FALSE;

-      if (m.msg_flags & MSG_CTRUNC)
-        {
-          /* Hmm, apparently the control data was truncated. The bad
-             thing is that we might have completely lost a couple of fds
-             without chance to recover them. Hence let's treat this as a
-             serious error. */
-
-          errno = ENOSPC;
-          _dbus_string_set_length (buffer, start);
-          return -1;
-        }
-
       for (cm = CMSG_FIRSTHDR(&m); cm; cm = CMSG_NXTHDR(&m, cm))
         if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
           {
@@ -501,6 +489,26 @@ _dbus_read_socket_with_unix_fds (DBusSocket        fd,
       if (!found)
         *n_fds = 0;

+      if (m.msg_flags & MSG_CTRUNC)
+        {
+          unsigned int i;
+
+          /* Hmm, apparently the control data was truncated. The bad
+             thing is that we might have completely lost a couple of fds
+             without chance to recover them. Hence let's treat this as a
+             serious error. */
+
+          /* We still need to close whatever fds we *did* receive,
+           * otherwise they'll never get closed. (CVE-2020-12049) */
+          for (i = 0; i < *n_fds; i++)
+            close (fds[i]);
+
+          *n_fds = 0;
+          errno = ENOSPC;
+          _dbus_string_set_length (buffer, start);
+          return -1;
+        }
+
       /* put length back (doesn't actually realloc) */
       _dbus_string_set_length (buffer, start + bytes_read);


code:
Fix a string comparison in C++ 11.

Taken from Debian:
https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/06_fix_gcc-7_ftbfs.patch/

--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -83,5 +83,5 @@ ssize_t Pipe::read(void *buffer, unsigne
 void Pipe::signal()
 {
   // TODO: ignoring return of read/write generates warning; maybe relevant for eventloop work...
-  ::write(_fd_write, '\0', 1);
+  ::write(_fd_write, "\0", 1);
 }


code:
Description: Fix FTBFS if DBUS_HAS_RECURSIVE_MUTEX is undefined
Author: Peter Williams <peter@newton.cx>
Last-Update: 2018-01-26

Taken from Debian:
https://sources.debian.org/src/dbus-c++/0.9.0-8.1/debian/patches/07_fix_mutex_ftbfs.patch/

--- dbus-c++-0.9.0.orig/include/dbus-c++/dispatcher.h
+++ dbus-c++-0.9.0/include/dbus-c++/dispatcher.h
@@ -267,6 +267,19 @@ struct Threading
     return new Mx;
   }

+#ifndef DBUS_HAS_RECURSIVE_MUTEX
+  static bool mutex_free(Mutex *mx)
+  {
+    delete mx;
+    return true;
+  }
+
+  static bool mutex_lock(Mutex *mx)
+  {
+    mx->lock();
+    return true;
+  }
+#else
   static void mutex_free(Mutex *mx)
   {
     delete mx;
@@ -276,6 +289,7 @@ struct Threading
   {
     mx->lock();
   }
+#endif

   static void mutex_unlock(Mutex *mx)
   {


code:
The setuid helper of D-Bus is responsible for "service activation".
It looks for '.service' files in fixed locations, but the default locations
make no sense (see below), so replace them with /etc/dbus-1/system-services.

--- dbus-1.10.0/dbus/dbus-sysdeps-util-unix.c	2015-10-22 00:07:03.829251854 +0200
+++ dbus-1.10.0/dbus/dbus-sysdeps-util-unix.c	2015-10-22 00:07:14.893445175 +0200
@@ -1410,10 +1410,7 @@ _dbus_get_standard_system_servicedirs (D
    * be available.
    */
   static const char standard_search_path[] =
-    "/usr/local/share:"
-    "/usr/share:"
-    DBUS_DATADIR ":"
-    "/lib";
+    "/etc";
   DBusString servicedir_path;

   _dbus_string_init_const (&servicedir_path, standard_search_path);


code:
sentry-sdk provides a link to sentry.io, a service which monitors applications deployed in the wild.
Defaults to true. Best to just remove the option.

---
 dbxfs/main.py | 16 ----------------
 setup.py      |  1 -
 2 files changed, 17 deletions(-)

diff --git a/dbxfs/main.py b/dbxfs/main.py
index 5a6cea1..5d00818 100755
--- a/dbxfs/main.py
+++ b/dbxfs/main.py
@@ -40,8 +40,6 @@ import userspacefs
 import keyring
 from keyring.errors import KeyringError

-import sentry_sdk
-
 from block_tracing import block_tracing, BLOCK_TRACING_INHERITS

 from dbxfs.dbxfs import FileSystem as DropboxFileSystem
@@ -299,12 +297,6 @@ def _main(argv=None):
             config['keyring_user'] = keyring_user
             save_config = True

-    if not config.get("asked_send_error_reports", False):
-        if yes_no_input("Would you like to help us improve %s by providing anonymous error reports?" % (APP_NAME,), default_yes=True):
-            config['send_error_reports'] = True
-        config['asked_send_error_reports'] = True
-        save_config = True
-
     if save_access_token and yes_no_input("Do you want \"%s\" to be the default mount point?" % (mount_point,), default_yes=True):
         config['mount_point'] = mount_point
         save_config = True
@@ -315,14 +307,6 @@ def _main(argv=None):

     log.info("Starting %s...", APP_NAME)

-    if config.get('send_error_reports', False):
-        try:
-            sentry_sdk.init("https://b4b13ebd300849bd92260507a594e618@sentry.io/1293235",
-                            release='%s@%s' % (APP_NAME, version),
-                            with_locals=False)
-        except Exception:
-            log.warning("Failed to initialize sentry", exc_info=True)
-
     if cache_folder is None:
         cache_folder = os.path.join(appdirs.user_cache_dir(APP_NAME), "file_cache")
         try:
diff --git a/setup.py b/setup.py
index 89e25c6..f940d47 100644
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,6 @@ setup(
         "privy>=6.0,<7",
         "keyring>=15.1.0",
         "keyrings.alt>=3.1,<5",
-        "sentry_sdk>=0.3,<1",
     ],
     extras_require={
         'safefs': ["safefs"],
--
2.28.0


code:
From 78d5cddafebb28e2e54efeb781495b5607ddb356 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Thu, 8 Aug 2019 15:19:48 +0200
Subject: [PATCH] Scripts: Use constants for external program names.

This makes it much, much easier to replace the program
with one using an absolute path. This is necessary for
e.g. Guix to keep references to these external programs.
---
 bin/debops              | 10 +++++++---
 bin/debops-padlock      | 21 +++++++++++++++------
 bin/debops-task         |  7 +++++--
 bin/debops-update       | 18 +++++++++++-------
 debops/__init__.py      | 17 ++++++++++++-----
 debops/cmds/__init__.py |  6 +++++-
 6 files changed, 55 insertions(+), 24 deletions(-)

diff --git a/bin/debops b/bin/debops
index 2b7ad3f88..caaeb892f 100755
--- a/bin/debops
+++ b/bin/debops
@@ -59,6 +59,10 @@ ConfigFileHeader = """\
 # You can manipulate the contents of this file via `.debops.cfg`.
 """

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+ANSIBLE_PLAYBOOK = 'ansible-playbook'
+

 def write_config(filename, config):
     cfgparser = configparser.ConfigParser()
@@ -131,7 +135,7 @@ def gen_ansible_cfg(filename, config, project_root, playbooks_path,
             os.path.join(playbooks_path, "roles"),
             "/etc/ansible/roles")))

-    ansible_version_out = subprocess.check_output(["ansible-playbook",
+    ansible_version_out = subprocess.check_output([ANSIBLE_PLAYBOOK,
                                                    "--version"]).decode()

     # Get first line and split by spaces to get second 'word'.
@@ -197,7 +201,7 @@ def main(cmd_args):
         playbooks_path = '/nonexistent'

     # Make sure required commands are present
-    require_commands('ansible-playbook')
+    require_commands(ANSIBLE_PLAYBOOK)

     # Check if user specified a potential playbook name as the first
     # argument. If yes, use it as the playbook name and remove it from
@@ -256,7 +260,7 @@ def main(cmd_args):
         print("Running Ansible playbooks:")
         for element in play_list:
             print(element)
-        return subprocess.call(['ansible-playbook'] + play_list + arg_list)
+        return subprocess.call([ANSIBLE_PLAYBOOK] + play_list + arg_list)
     finally:
         if revert_unlock:
             padlock_lock(encfs_encrypted)
diff --git a/bin/debops-padlock b/bin/debops-padlock
index bfdfb8e06..2a97716cd 100755
--- a/bin/debops-padlock
+++ b/bin/debops-padlock
@@ -67,6 +67,14 @@ devrandom = os.environ.get('DEVRANDOM', "/dev/urandom")

 SCRIPT_FILENAME = 'padlock-script'

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+ENCFS = 'encfs'
+FIND = 'find'
+FUSERMOUNT = 'fusermount'
+UMOUNT = 'umount'
+GPG = 'gpg'
+
 # ---- DebOps environment setup ----

@@ -80,9 +88,9 @@ def main(subcommand_func, **kwargs):
     # Make sure required commands are present
     # OS X compatibility
     if sys.platform == 'darwin':
-        require_commands('encfs', 'find', 'umount', 'gpg')
+        require_commands(ENCFS, FIND, UMOUNT, GPG)
     else:
-        require_commands('encfs', 'find', 'fusermount', 'gpg')
+        require_commands(ENCFS, FIND, FUSERMOUNT, GPG)

     inventory_path = find_inventorypath(project_root, required=False)
     # If inventory hasn't been found automatically, assume it's the default
@@ -121,7 +129,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients):
     # Generate a random password and encrypt it with GPG keys of recipients.
     print("Generating a random", ENCFS_KEYFILE_LENGTH, "char password")
     pwd = gen_pwd()
-    gpg = subprocess.Popen(['gpg', '--encrypt', '--armor',
+    gpg = subprocess.Popen([GPG, '--encrypt', '--armor',
                             '--output', encfs_keyfile] + recipients,
                            stdin=subprocess.PIPE)
     gpg.communicate(pwd.encode('utf-8'))
@@ -133,9 +141,10 @@ def init(encfs_decrypted, encfs_encrypted, recipients):
     # NB2: We can not use padlock_unlock here, because the config file
     # does not yet exist.
     encfs = subprocess.Popen([
-        'encfs', encfs_encrypted, encfs_decrypted,
+        ENCFS, encfs_encrypted, encfs_decrypted,
         '--extpass',
-        'gpg --decrypt --no-mdc-warning --output - '+shquote(encfs_keyfile)],
+        GPG + ' --decrypt --no-mdc-warning --output - '
+        + shquote(encfs_keyfile)],
         stdin=subprocess.PIPE)
     encfs.communicate(('p\n'+pwd).encode('utf-8'))

@@ -154,7 +163,7 @@ def init(encfs_decrypted, encfs_encrypted, recipients):

     # Protect the EncFS configuration file by also encrypting it with
     # the GPG keys of recipients.
-    subprocess.call(['gpg', '--encrypt', '--armor',
+    subprocess.call([GPG, '--encrypt', '--armor',
                      '--output', encfs_configfile+'.asc']
                     + recipients + [encfs_configfile])
     os.remove(encfs_configfile)
diff --git a/bin/debops-task b/bin/debops-task
index 223e5f834..dc31ad4e6 100755
--- a/bin/debops-task
+++ b/bin/debops-task
@@ -49,11 +49,14 @@ project_root = find_debops_project(required=True)
 # todo: need to decide on semantics!
 # config = read_config(project_root)

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+ANSIBLE = 'ansible'

 # ---- Main script ----

 # Make sure required commands are present
-require_commands('ansible')
+require_commands(ANSIBLE)

 ansible_inventory = find_inventorypath(project_root)

@@ -71,5 +74,5 @@ if INSECURE:
     os.environ['ANSIBLE_HOST_KEY_CHECKING'] = 'False'

 # Run ansible with custom environment
-cmd = ['ansible'] + module + sys.argv[1:]
+cmd = [ANSIBLE] + module + sys.argv[1:]
 subprocess.call(cmd)
diff --git a/bin/debops-update b/bin/debops-update
index 88c5e2c82..cc7e57cb0 100755
--- a/bin/debops-update
+++ b/bin/debops-update
@@ -90,6 +90,10 @@ GALAXY_REQUIREMENTS = "galaxy/requirements.txt"
 # Default Ansible Galaxy user account name
 GALAXY_ACCOUNT = "debops"

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+GIT = 'git'
+

 # ---- Functions ----

@@ -137,7 +141,7 @@ def clone_git_repository(repo_uri, branch, destination, dry_run=False):
     if dry_run:
         print("Cloning '%s' to %s..." % (repo_uri, destination))
     else:
-        subprocess.call(['git', 'clone', '--quiet', '--branch', branch,
+        subprocess.call([GIT, 'clone', '--quiet', '--branch', branch,
                          repo_uri, destination])

@@ -152,22 +156,22 @@ def update_git_repository(path, dry_run=False, remote_uri=False):
     os.chdir(path)

     if dry_run:
-        subprocess.call(['git', 'fetch'])
-        subprocess.call(['git', 'diff', 'HEAD', 'origin', '--stat'])
+        subprocess.call([GIT, 'fetch'])
+        subprocess.call([GIT, 'diff', 'HEAD', 'origin', '--stat'])
     else:
         # Get the current sha of the head branch
         current_sha = subprocess.check_output(
-                ['git', 'rev-parse', 'HEAD']).strip()
+                [GIT, 'rev-parse', 'HEAD']).strip()

         # Fetch it silently and store the new sha
-        subprocess.call(['git', 'fetch', '--quiet'])
+        subprocess.call([GIT, 'fetch', '--quiet'])
         fetch_sha = subprocess.check_output(
-                ['git', 'rev-parse', 'FETCH_HEAD']).strip()
+                [GIT, 'rev-parse', 'FETCH_HEAD']).strip()

         if current_sha != fetch_sha:
             print()
             print('--')
-            subprocess.call(['git', 'merge', fetch_sha])
+            subprocess.call([GIT, 'merge', fetch_sha])

             if remote_uri:
                 compare_uri = (remote_uri + '/compare/' + current_sha[:7]
diff --git a/debops/__init__.py b/debops/__init__.py
index 1c2cedcb0..da8430e41 100644
--- a/debops/__init__.py
+++ b/debops/__init__.py
@@ -93,6 +93,13 @@ ENCFS_KEYFILE = ".encfs6.keyfile"
 # Length of the random EncFS password stored in encrypted keyfile
 ENCFS_KEYFILE_LENGTH = 256

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+ENCFS = 'encfs'
+FUSERMOUNT = 'fusermount'
+UMOUNT = 'umount'
+GPG = 'gpg'
+

 # ---- Functions ----

@@ -180,9 +187,9 @@ def padlock_lock(encrypted_path):
         return False
     # OS X compatibility
     if sys.platform == 'darwin':
-        subprocess.call(['umount', decrypted_path])
+        subprocess.call([UMOUNT, decrypted_path])
     else:
-        subprocess.call(['fusermount', '-u', decrypted_path])
+        subprocess.call([FUSERMOUNT, '-u', decrypted_path])
     return True

@@ -237,14 +244,14 @@ def padlock_unlock(encrypted_path):
     # Start encfs. It will wait for input on the `configfile` named
     # pipe.
     encfs = subprocess.Popen([
-        'encfs', encrypted_path, decrypted_path,
+        ENCFS, encrypted_path, decrypted_path,
         '--extpass',
-        'gpg --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)])
+        GPG + ' --decrypt --no-mdc-warning --output - %s' % shquote(keyfile)])
     # now decrypt the config and write it into the named pipe
     with open(configfile, 'w') as fh:
         # NB: gpg must write to stdout to avoid it is asking whether
         # the file should be overwritten
-        subprocess.Popen(['gpg',
+        subprocess.Popen([GPG,
                           '--decrypt', '--no-mdc-warning', '--output', '-',
                           crypted_configfile], stdout=fh).wait()
     encfs.wait()
diff --git a/debops/cmds/__init__.py b/debops/cmds/__init__.py
index b221fa191..9fabf43a5 100644
--- a/debops/cmds/__init__.py
+++ b/debops/cmds/__init__.py
@@ -55,6 +55,10 @@ SCRIPT_NAME = os.path.basename(sys.argv[0])
 # command line)
 INSECURE = bool(os.environ.get('INSECURE', False))

+# External programms used. List here for easy substitution for
+# hard-coded paths.
+WHICH = 'which'
+

 def error_msg(message, severity="Error"):
     """
@@ -70,7 +74,7 @@ def require_commands(*cmd_names):
     Check if required commands exist.
     """
     def command_exists(cmd_name):
-        which = "where" if platform.system() == "Windows" else "which"
+        which = "where" if platform.system() == "Windows" else WHICH
         return not subprocess.call([which, cmd_name],
                                    stdout=DEVNULL, stderr=subprocess.STDOUT)

--
2.21.0


code:
From 5059daf8bd59a83f520c14731173ea76ce8b8661 Mon Sep 17 00:00:00 2001
From: Hartmut Goebel <h.goebel@crazy-compilers.com>
Date: Sun, 8 Sep 2019 13:09:15 +0200
Subject: [PATCH] [debops-defaults] If `view` is not available, try less, etc.

---
 bin/debops-defaults | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/bin/debops-defaults b/bin/debops-defaults
index 9dd87fe0a..3e3db4c41 100755
--- a/bin/debops-defaults
+++ b/bin/debops-defaults
@@ -96,13 +96,22 @@ def main(role_list):
     config = read_config(project_root)
     playbooks_path = find_playbookpath(config, project_root, required=True)

-    # Make sure required commands are present
-    require_commands('view')
-
-    if sys.stdout.isatty():
+    # Check if one of the output commands is present
+    sys.stdout = io.BytesIO()  # suppress error message, if any
+    for cmd_args in (('view', '+set ft=yaml', '-'),
+                     ('less', '-'),
+                     ('more', '-')):
+        try:
+            require_commands(cmd_args[0])
+            break
+        except SystemExit:
+            # this command was not found
+            cmd_args = None
+    sys.stdout = sys.__stdout__
+
+    if cmd_args and sys.stdout.isatty():
         # if script is run as standalone, redirect to view
-        view = subprocess.Popen(['view', '+set ft=yaml', '-'],
-                                stdin=subprocess.PIPE)
+        view = subprocess.Popen(cmd_args, stdin=subprocess.PIPE)
         try:
             aggregate_defaults(playbooks_path, role_list, view.stdin)
         except IOError as e:
--
2.21.0


code:
Index: dee-1.2.7+17.10.20170616/vapi/Dee-1.0.metadata
===================================================================
--- dee-1.2.7+17.10.20170616.orig/vapi/Dee-1.0.metadata
+++ dee-1.2.7+17.10.20170616/vapi/Dee-1.0.metadata
@@ -2,7 +2,9 @@ GListResultSet skip
 GListResultSetClass skip

 FilterModel
-	.filter unowned
+        .filter skip // unsupported type for construct property
+Index
+        .reader skip // unsupported type for construct property
 Model
 	.append skip=false
 	.build_named_row skip


code:
From: zeromus
Origin: upstream, https://sourceforge.net/p/desmume/code/5514, https://sourceforge.net/p/desmume/code/5517, https://sourceforge.net/p/desmume/code/5430
Subject: fix GCC6 issues
Bug: https://sourceforge.net/p/desmume/bugs/1570/
Bug-Debian: http://bugs.debian.org/811691

Index: desmume/src/MMU_timing.h
===================================================================
--- desmume/src/MMU_timing.h	(revision 5513)
+++ desmume/src/MMU_timing.h	(revision 5517)
@@ -155,8 +155,8 @@
 	enum { ASSOCIATIVITY = 1 << ASSOCIATIVESHIFT };
 	enum { BLOCKSIZE = 1 << BLOCKSIZESHIFT };
 	enum { TAGSHIFT = SIZESHIFT - ASSOCIATIVESHIFT };
-	enum { TAGMASK = (u32)(~0 << TAGSHIFT) };
-	enum { BLOCKMASK = ((u32)~0 >> (32 - TAGSHIFT)) & (u32)(~0 << BLOCKSIZESHIFT) };
+	enum { TAGMASK = (u32)(~0U << TAGSHIFT) };
+	enum { BLOCKMASK = ((u32)~0U >> (32 - TAGSHIFT)) & (u32)(~0U << BLOCKSIZESHIFT) };
 	enum { WORDSIZE = sizeof(u32) };
 	enum { WORDSPERBLOCK = (1 << BLOCKSIZESHIFT) / WORDSIZE };
 	enum { DATAPERWORD = WORDSIZE * ASSOCIATIVITY };
Index: desmume/src/ctrlssdl.cpp
===================================================================
--- desmume/src/ctrlssdl.cpp	(revision 5513)
+++ desmume/src/ctrlssdl.cpp	(revision 5517)
@@ -200,7 +200,7 @@
           break;
         case SDL_JOYAXISMOTION:
           /* Dead zone of 50% */
-          if( (abs(event.jaxis.value) >> 14) != 0 )
+          if( ((u32)abs(event.jaxis.value) >> 14) != 0 )
             {
               key = ((event.jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event.jaxis.axis & 127) << 1);
               if (event.jaxis.value > 0) {
@@ -370,7 +370,7 @@
          Note: button constants have a 1bit offset. */
     case SDL_JOYAXISMOTION:
       key_code = ((event->jaxis.which & 15) << 12) | JOY_AXIS << 8 | ((event->jaxis.axis & 127) << 1);
-      if( (abs(event->jaxis.value) >> 14) != 0 )
+      if( ((u32)abs(event->jaxis.value) >> 14) != 0 )
         {
           if (event->jaxis.value > 0)
             key_code |= 1;
Index: desmume/src/wifi.cpp
===================================================================
--- desmume/src/wifi.cpp	(revision 5429)
+++ desmume/src/wifi.cpp	(revision 5430)
@@ -320,9 +320,9 @@

 #if (WIFI_LOGGING_LEVEL >= 1)
 	#if WIFI_LOG_USE_LOGC
-		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: "__VA_ARGS__);
+		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) LOGC(8, "WIFI: " __VA_ARGS__);
 	#else
-		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: "__VA_ARGS__);
+		#define WIFI_LOG(level, ...) if(level <= WIFI_LOGGING_LEVEL) printf("WIFI: " __VA_ARGS__);
 	#endif
 #else
 #define WIFI_LOG(level, ...) {}


code:
From e1f7039f1b06add4fb75b2f8774000b8f05574af Mon Sep 17 00:00:00 2001
From: rogerman <rogerman@users.sf.net>
Date: Mon, 17 Aug 2015 21:15:04 +0000
Subject: Fix bug with libfat string handling.

diff --git a/src/utils/libfat/directory.cpp b/src/utils/libfat/directory.cpp
index 765d7ae5..b6d7f01f 100644
--- a/src/utils/libfat/directory.cpp
+++ b/src/utils/libfat/directory.cpp
@@ -139,7 +139,7 @@ static size_t _FAT_directory_mbstoucs2 (ucs2_t* dst, const char* src, size_t len
 	int bytes;
 	size_t count = 0;

-	while (count < len-1 && src != '\0') {
+	while (count < len-1 && *src != '\0') {
 		bytes = mbrtowc (&tempChar, src, MB_CUR_MAX, &ps);
 		if (bytes > 0) {
 			*dst = (ucs2_t)tempChar;


code:
Dfu-programmer cannot cannot find libusb. This patch fixes that.

diff --git a/src/dfu-device.h b/src/dfu-device.h
index bbdfa99..31af0e8 100644
--- a/src/dfu-device.h
+++ b/src/dfu-device.h
@@ -6,7 +6,7 @@
 #endif
 #include <stdint.h>
 #ifdef HAVE_LIBUSB_1_0
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 #else
 #include <usb.h>
 #endif

diff --git a/src/main.c b/src/main.c
index ef2aa16..dcc3636 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,7 +24,7 @@
 #include <stdio.h>
 #include <string.h>
 #ifdef HAVE_LIBUSB_1_0
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 #else
 #include <usb.h>
 #endif

diff --git a/src/dfu.c b/src/dfu.c
index 7dbcc57..952e896 100644
--- a/src/dfu.c
+++ b/src/dfu.c
@@ -27,7 +27,7 @@
 #include <stdlib.h>
 #include <stddef.h>
 #ifdef HAVE_LIBUSB_1_0
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 #else
 #include <usb.h>
 #endif

diff --git a/src/dfu.h b/src/dfu.h
index 2a159e8..63510f2 100644
--- a/src/dfu.h
+++ b/src/dfu.h
@@ -25,7 +25,7 @@
 # include <config.h>
 #endif
 #ifdef HAVE_LIBUSB_1_0
-#include <libusb.h>
+#include <libusb-1.0/libusb.h>
 #else
 #include <usb.h>
 #endif


code:
This patch is needed to allow builds with newer versions of
the GNU libc (2.16+).

commit 66712c23388e93e5c518ebc8515140fa0c807348
Author: Eric Blake <eblake@redhat.com>
Date:   Thu Mar 29 13:30:41 2012 -0600

    stdio: don't assume gets any more

    Gnulib intentionally does not have a gets module, and now that C11
    and glibc have dropped it, we should be more proactive about warning
    any user on a platform that still has a declaration of this dangerous
    interface.

    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
    support.
    * modules/stdio (Makefile.am): Likewise.
    * lib/stdio-read.c (gets): Likewise.
    * tests/test-stdio-c++.cc: Likewise.
    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
    * lib/stdio.in.h (gets): Make warning occur in more places.
    * doc/posix-functions/gets.texi (gets): Update documentation.
    Reported by Christer Solskogen.

    Signed-off-by: Eric Blake <eblake@redhat.com>

diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index aa7b599..c377b6e 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
 # endif
 #endif

-#if @GNULIB_GETS@
-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#   undef gets
-#   define gets rpl_gets
-#  endif
-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (gets, char *, (char *s));
-# else
-_GL_CXXALIAS_SYS (gets, char *, (char *s));
-#  undef gets
-# endif
-_GL_CXXALIASWARN (gets);
 /* It is very rare that the developer ever has full control of stdin,
-   so any use of gets warrants an unconditional warning.  Assume it is
-   always declared, since it is required by C89.  */
+   so any use of gets warrants an unconditional warning; besides, C11
+   removed it.  */
+#undef gets
+#if HAVE_RAW_DECL_GETS
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 #endif

@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 # endif
 #endif

-/* Some people would argue that sprintf should be handled like gets
-   (for example, OpenBSD issues a link warning for both functions),
-   since both can cause security holes due to buffer overruns.
+/* Some people would argue that all sprintf uses should be warned about
+   (for example, OpenBSD issues a link warning for it),
+   since it can cause security holes due to buffer overruns.
    However, we believe that sprintf can be used safely, and is more
    efficient than snprintf in those safe cases; and as proof of our
    belief, we use sprintf in several gnulib modules.  So this header


code:
From dc0f8f8bf8608c39da32e3c8ca1484b766fc7452 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Mon, 17 May 2021 16:47:19 -0400
Subject: [PATCH] build: Fix cross-compilation.

The cross-compilation issues corrected by this change were discovered
when attempting to cross-compile disarchive for the i586-gnu target on
GNU Guix.

* configure.ac [O_NOFOLLOW]: Rewrite test using AC_COMPUTE_INT, which
is supported even when cross-compiling.
(GUILD_TARGET_OPTION): New computed variable.
* build-aux/guile.am ($(AM_V_GUILEC)GUILE_AUTO_COMPILE): Use it.
---
 build-aux/guile.am |  6 +++---
 configure.ac       | 24 +++++++++++++++---------
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/build-aux/guile.am b/build-aux/guile.am
index bec04ea..7745125 100644
--- a/build-aux/guile.am
+++ b/build-aux/guile.am
@@ -54,7 +54,7 @@ AM_V_GUILEC_0 = @echo "  GUILEC" $@;
 SUFFIXES = .scm .go

 .scm.go:
-	$(AM_V_GUILEC)GUILE_AUTO_COMPILE=0      \
-	$(top_builddir)/pre-inst-env            \
-	$(GUILD) compile $(GUILE_WARNINGS)      \
+	$(AM_V_GUILEC)GUILE_AUTO_COMPILE=0                              \
+	$(top_builddir)/pre-inst-env                                    \
+	$(GUILD) compile $(GUILE_WARNINGS) $(GUILD_TARGET_OPTION)       \
 	         -o "$@" "$<"
diff --git a/configure.ac b/configure.ac
index 99c5ac5..0cd0173 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,21 +39,27 @@ AS_IF([test "x$GUILD" = "x"],
     [AC_MSG_ERROR(m4_normalize([
       'guild' binary not found; please check your Guile installation.]))])])

+dnl This argument is passed to guild; it ensures cross-compiling uses
+dnl the right target.
+if test -n "$host_alias"; then
+   AC_SUBST([GUILD_TARGET_OPTION], [--target=$host_alias])
+fi
+
 GUILE_MODULE_REQUIRED(gcrypt hash)

 dnl Guile defines a handful of values from <fcntl.h>, but it is
 dnl missing O_NOFOLLOW.
 AC_ARG_VAR([O_NOFOLLOW], [value to use for O_NOFOLLOW (cf. <fcntl.h>)])
 AS_IF([test "x$O_NOFOLLOW" = "x"],
-  [AC_MSG_CHECKING([the value of O_NOFOLLOW])
-   AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-       #include <fcntl.h>
-       #include <stdio.h>
-     ]], [[
-       printf("%d\n", O_NOFOLLOW)
-     ]])],
-     [O_NOFOLLOW=`./conftest$EXEEXT`],
-     [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])])
+  [AC_MSG_CHECKING([the value of O_NOFOLLOW])]
+  [AC_COMPUTE_INT([O_NOFOLLOW],
+      [O_NOFOLLOW],
+      [[
+        #include <fcntl.h>
+        #include <stdio.h>
+      ]],
+      [AC_MSG_FAILURE([could find value for O_NOFOLLOW])])]
+  [AC_MSG_RESULT([$O_NOFOLLOW])])

 AC_ARG_VAR([TAR], [tar utility])
 AS_IF([test "x$TAR" = "x"], [AC_PATH_PROG([TAR], [tar])])
--
2.31.1


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 01 Mar 2019 20:51:32 +0100
Subject: [PATCH] dkimproxy: Add IPv6 support.

The following patch was copied verbatim from Debian[0].

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656041

---
--- dkimproxy-1.4.1.orig/lib/MSDW/SMTP/Server.pm
+++ dkimproxy-1.4.1/lib/MSDW/SMTP/Server.pm
@@ -11,7 +11,7 @@
 # Written by Bennett Todd <bet@rahul.net>

 package MSDW::SMTP::Server;
-use IO::Socket;
+use IO::Socket::INET6;
 use IO::File;

 =head1 NAME
@@ -88,14 +88,14 @@
 =item new(interface => $interface, port => $port);

 The interface and port to listen on must be specified. The interface
-must be a valid numeric IP address (0.0.0.0 to listen on all
-interfaces, as usual); the port must be numeric. If this call
-succeeds, it returns a server structure with an open
-IO::Socket::INET in it, ready to listen on. If it fails it dies, so
-if you want anything other than an exit with an explanatory error
-message, wrap the constructor call in an eval block and pull the
-error out of $@ as usual. This is also the case for all other
-methods; they succeed or they die.
+must be a valid numeric IPv4 or IPv6 address (0.0.0.0 or :: to listen
+on all interfaces, as usual); the port must be numeric. If this call
+succeeds, it returns a server structure with an open IO::Socket::INET6
+in it, ready to listen on. If it fails it dies, so if you want
+anything other than an exit with an explanatory error message, wrap
+the constructor call in an eval block and pull the error out of $@ as
+usual. This is also the case for all other methods; they succeed or
+they die.

 =item accept([debug => FD]);

@@ -154,7 +154,7 @@
     my ($this, @opts) = @_;
     my $class = ref($this) || $this;
     my $self = bless { @opts }, $class;
-    $self->{sock} = IO::Socket::INET->new(
+    $self->{sock} = IO::Socket::INET6->new(
 	LocalAddr => $self->{interface},
 	LocalPort => $self->{port},
 	Proto => 'tcp',
only in patch2:
unchanged:
--- dkimproxy-1.4.1.orig/scripts/dkimproxy.out
+++ dkimproxy-1.4.1/scripts/dkimproxy.out
@@ -314,17 +314,11 @@
 {
 	my $self = shift;

-	# try to determine peer's address
-	use Socket;
-	my $peersockaddr = getpeername(STDOUT);
-	my ($port, $iaddr) = sockaddr_in($peersockaddr);
-	$ENV{REMOTE_ADDR} = inet_ntoa($iaddr);
-
 	# initialize syslog
 	eval
 	{
 		openlog("dkimproxy.out", "perror,pid,ndelay", "mail");
-		syslog("debug", '%s', "connect from $ENV{REMOTE_ADDR}");
+		syslog("debug", '%s', "connect from $self->{server}->{peeraddr}");
 	};
 	if (my $E = $@)
 	{


code:
Adapted from https://sourceforge.net/p/docpp/patches/1/

--- doc++-3.4.10/src/comment.ll	2000-06-24 18:50:23.000000000 +0200
+++ doc++-3.4.10/src/comment.ll	2012-09-17 11:14:50.744922841 +0200
@@ -24,7 +24,7 @@

 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdarg.h>
 #include <stdio.h>

--- doc++-3.4.10/src/cpp.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/cpp.ll	2012-09-17 11:15:21.184333236 +0200
@@ -26,7 +26,7 @@

 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdarg.h>
 #include <stdio.h>

--- doc++-3.4.10/src/datahashtable.h	2000-08-27 21:44:34.000000000 +0200
+++ doc++-3.4.10/src/datahashtable.h	2012-09-17 11:22:59.442589960 +0200
@@ -26,11 +26,13 @@
 #define _DATAHASHTABLE_H

 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>

 #include "McDArray.h"

+using namespace std;
+
 /* This should be a private subclass of #DataHashTable#. However, since cfront
    is not able to compile this constrution, we had move the class to global
    scope.
--- doc++-3.4.10/src/doc2dbsgml.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/doc2dbsgml.ll	2012-09-17 11:20:49.077259414 +0200
@@ -22,8 +22,8 @@

 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -36,6 +36,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);

+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc2dbxml.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/doc2dbxml.ll	2012-09-17 11:20:22.264831159 +0200
@@ -25,8 +25,8 @@

 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -39,6 +39,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);

+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc2html.ll	2000-07-17 23:17:24.000000000 +0200
+++ doc++-3.4.10/src/doc2html.ll	2012-09-17 11:22:40.354469631 +0200
@@ -29,6 +29,8 @@
 #include "doc.h"
 #include "nametable.h"

+using namespace std;
+
 extern NameTable	gifs;

 #define YY_DECL int yylex()
--- doc++-3.4.10/src/doc2tex.ll	2000-11-05 17:21:16.000000000 +0100
+++ doc++-3.4.10/src/doc2tex.ll	2012-09-17 11:23:22.210701715 +0200
@@ -23,8 +23,8 @@

 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,6 +38,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);

+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc.ll	2000-09-17 21:41:17.000000000 +0200
+++ doc++-3.4.10/src/doc.ll	2012-09-17 11:15:37.068009454 +0200
@@ -23,8 +23,8 @@

 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- doc++-3.4.10/src/equate.cc	2002-05-02 21:13:10.000000000 +0200
+++ doc++-3.4.10/src/equate.cc	2012-09-17 11:25:42.850669366 +0200
@@ -23,9 +23,9 @@

 #include "config.h"

-#include <fstream.h>
+#include <fstream>
 #include <getopt.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 #include <string.h>

--- doc++-3.4.10/src/html.cc	2001-02-17 07:34:49.000000000 +0100
+++ doc++-3.4.10/src/html.cc	2012-09-17 11:24:07.978824681 +0200
@@ -31,7 +31,7 @@
 #include <direct.h>
 #endif
 #include <errno.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- doc++-3.4.10/src/java.ll	2001-11-25 18:04:12.000000000 +0100
+++ doc++-3.4.10/src/java.ll	2012-09-17 11:24:19.138834603 +0200
@@ -26,7 +26,7 @@

 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>

 #include "doc.h"
--- doc++-3.4.10/src/main.cc	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/main.cc	2012-09-17 11:25:30.650719070 +0200
@@ -25,7 +25,7 @@
 #include "config.h"

 #include <assert.h>
-#include <fstream.h>
+#include <fstream>
 #include <getopt.h>
 #include <locale.h>
 #include <stdio.h>
--- doc++-3.4.10/src/nametable.cc	2000-04-08 23:11:54.000000000 +0200
+++ doc++-3.4.10/src/nametable.cc	2012-09-17 11:25:58.894591128 +0200
@@ -22,7 +22,7 @@
 */

 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>
 #include <string.h>

--- doc++-3.4.10/src/nametable.h	2000-04-08 23:11:56.000000000 +0200
+++ doc++-3.4.10/src/nametable.h	2012-09-17 11:22:07.826207198 +0200
@@ -25,7 +25,7 @@
 #define	_NAME_TABLE_H

 #include <assert.h>
-#include <iostream.h>
+#include <iostream>

 #include "datahashtable.h"

--- doc++-3.4.10/src/php.ll	2001-02-16 23:34:47.000000000 +0100
+++ doc++-3.4.10/src/php.ll	2012-09-17 11:25:18.582759801 +0200
@@ -23,7 +23,7 @@
 %{
 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>

 #include "doc.h"
--- doc++-3.4.10/src/tex2gif.cc	2001-08-07 20:55:40.000000000 +0200
+++ doc++-3.4.10/src/tex2gif.cc	2012-09-17 11:26:06.698547836 +0200
@@ -21,8 +21,8 @@
   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <stdio.h>
 #include <string.h>


code:
Adapted from https://sources.debian.net/data/main/d/doc%2B%2B/3.4.10-3.4/debian/patches/segfault_fix.patch

--- doc++-3.4.10/src/McDArray.h	2000-07-30 12:40:48.000000000 +0200
+++ doc++-3.4.10/src/McDArray.h	2005-05-10 15:02:06.000000000 +0200
@@ -80,9 +80,14 @@
     McDArray(const McDArray& old) : memFactor(old.memFactor),
 	thesize(old.thesize), themax(old.themax)
 	{
-	data = (T*)malloc(themax * sizeof(T));
-	if(thesize)
-	    memcpy(data, old.data, thesize * sizeof(T));
+	if (themax)
+	    {
+	    data = (T*)malloc(themax * sizeof(T));
+	    if(thesize)
+		memcpy(data, old.data, thesize * sizeof(T));
+	    }
+	else
+	    data = 0;
 	assert(isConsistent());
 	}

--- doc++-3.4.10/src/McDirectory.cc	2000-03-14 22:17:36.000000000 +0100
+++ doc++-3.4.10/src/McDirectory.cc	2005-05-10 15:02:18.000000000 +0200
@@ -23,12 +23,13 @@
 */

 #include "McDirectory.h"
-#include "McSorter.h"
 #include "McString.h"
 #include "doc.h"

 #include <stdio.h>

+#include <algorithm>
+
 #ifdef WIN32
 #include <windows.h>
 #ifdef __BORLANDC__
@@ -62,7 +63,7 @@
     FindClose(searchHandle);
     StringCompare comp;
     if(list.size())
-	sort((char **)list, list.size(), comp, 0);
+	std::sort((char **)list, (char **)list + list.size(), comp);
     return 0;
 }

@@ -107,7 +108,7 @@
     closedir(dir);
     StringCompare comp;
     if(list.size())
-	sort((char **)list, list.size(), comp, 0);
+	std::sort((char **)list, (char **)list + list.size(), comp);
     return list.size();
 }

--- doc++-3.4.10/src/McDirectory.h	2000-06-28 21:54:58.000000000 +0200
+++ doc++-3.4.10/src/McDirectory.h	2005-05-10 15:02:18.000000000 +0200
@@ -59,9 +59,9 @@
     class StringCompare
 	{
 	public:
-	    int operator()(const char *t1, const char *t2)
+	    bool operator()(const char *t1, const char *t2)
 		{
-		return strcmp(t1, t2);
+		return strcmp(t1, t2) < 0;
 		}
 	};
 };
--- doc++-3.4.10/src/html.cc	2001-02-17 07:34:49.000000000 +0100
+++ doc++-3.4.10/src/html.cc	2005-05-10 15:02:18.000000000 +0200
@@ -38,9 +38,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>

+#include <algorithm>
+
 #include "McDirectory.h"
 #include "McHashTable.h"
-#include "McSorter.h"
 #include "classgraph.h"
 #include "doc.h"
 #include "gifs.h"
@@ -314,9 +315,11 @@
 	virtual void writeMember(Entry *e, bool links, bool withSub = true);
 	class EntryCompare {
 	    public:
-		int operator()(const MemberWriterListEntry& l1, const MemberWriterListEntry& l2)
+		bool operator()(const MemberWriterListEntry& l1, const MemberWriterListEntry& l2)
 		    {
-		    return strcmp(l1.entry->fullName.c_str(), l2.entry->fullName.c_str());
+		    const char *s1 = l1.entry->fullName.c_str();
+		    const char *s2 = l2.entry->fullName.c_str();
+		    return strcmp(s1, s2) < 0;
 		    }
 	};
     public:
@@ -324,7 +327,7 @@
 	    {
 	    EntryCompare comp;
 	    if(list.size())
-		::sort((MemberWriterListEntry *)list, list.size(), comp, 0);
+		std::sort((MemberWriterListEntry *)list, (MemberWriterListEntry *)list + list.size(), comp);
 	    }
 	virtual void startList(FILE *f, char *heading, bool withLinks);
 	virtual void addMember(Entry *e, bool links, bool withSub = true)
@@ -376,7 +379,7 @@
 	    int lp;

 	    if(list.size() > 1)
-		::sort((TOCListEntry *)list, list.size(), comp, 0);
+		std::sort((TOCListEntry *)list, (TOCListEntry *)list + list.size(), comp);

 	    // Sort subsections
 	    for(lp = 0; lp < list.size(); lp++)
@@ -385,9 +388,9 @@
 	    }
 	class EntryCompare {
 	    public:
-		int operator()(TOCListEntry& l1, TOCListEntry& l2)
+		bool operator()(const TOCListEntry& l1, const TOCListEntry& l2)
 		    {
-		    return strcmp(l1.name, l2.name);
+		    return strcmp(l1.name, l2.name) < 0;
 		    }
 	};
 	void addEntry(Entry *entry, TOClist *tl);
@@ -487,7 +490,7 @@

     for(i = 0; i < list.size(); i++)
 	if(list[i].tl)
-	    free(list[i].tl);
+	    delete list[i].tl;
 }

 class HIERlist;
@@ -509,7 +512,7 @@
 	    int i;

 	    if(list.size() > 1)
-		::sort((HIERListEntry *)list, list.size(), comp, 0);
+		std::sort((HIERListEntry *)list, (HIERListEntry *)list + list.size(), comp);

 	    // Sort subentries
 	    for(i = 0; i < list.size(); i++)
@@ -519,9 +522,9 @@
 	class EntryCompare
 	    {
 	    public:
-		int operator()(HIERListEntry& l1, HIERListEntry& l2)
+		bool operator()(const HIERListEntry& l1, const HIERListEntry& l2)
 		    {
-		    return strcmp(l1.name, l2.name);
+		    return strcmp(l1.name, l2.name) < 0;
 		    }
 	    };
 	void addEntry(Entry *entry, HIERlist *hl);
--- doc++-3.4.10/src/readfiles.ll	2001-11-25 18:04:48.000000000 +0100
+++ doc++-3.4.10/src/readfiles.ll	2005-05-10 15:02:18.000000000 +0200
@@ -28,7 +28,6 @@
 #include <sys/types.h>

 #include "McDirectory.h"
-#include "McSorter.h"
 #include "McString.h"
 #include "doc.h"
 #include "nametable.h"


code:
Use a non-recursive replace function when the parser supports it.

https://bugs.gnu.org/29782
https://bugzilla.samba.org/show_bug.cgi?id=9515
https://bugzilla.gnome.org/show_bug.cgi?id=736077 (for xsltproc)

Patch copied from Debian:
https://anonscm.debian.org/cgit/collab-maint/docbook-xsl.git/tree/debian/patches/765567_non-recursive_string_subst.patch

Description: use EXSLT "replace" function when available
 A recursive implementation  of string.subst is problematic,
 long strings with many matches will cause stack overflows.
Author: Peter De Wachter <pdewacht@gmail.com>
Bug-Debian: https://bugs.debian.org/750593

--- a/lib/lib.xsl
+++ b/lib/lib.xsl
@@ -10,7 +10,10 @@
      This module implements DTD-independent functions

      ******************************************************************** -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:str="http://exslt.org/strings"
+                exclude-result-prefixes="str"
+                version="1.0">

 <xsl:template name="dot.count">
   <!-- Returns the number of "." characters in a string -->
@@ -56,6 +59,9 @@
   <xsl:param name="replacement"/>

   <xsl:choose>
+    <xsl:when test="function-available('str:replace')">
+      <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
+    </xsl:when>
     <xsl:when test="contains($string, $target)">
       <xsl:variable name="rest">
         <xsl:call-template name="string.subst">


code:
Author: Danny Milosavljevic <dannym@scratchpost.org>
The socket name ended up too long inside the container.
Use a shorter one.
--- a/pkg/authorization/authz_unix_test.go	2019-01-10 01:55:02.997985947 +0100
+++ b/pkg/authorization/authz_unix_test.go	2019-01-10 02:03:21.177439757 +0100
@@ -24,7 +24,7 @@
 )

 const (
-	pluginAddress = "authz-test-plugin.sock"
+	pluginAddress = "/tmp/authz-test-plugin.sock"
 )

 func TestAuthZRequestPluginError(t *testing.T) {
@@ -263,12 +263,7 @@

 // createTestPlugin creates a new sample authorization plugin
 func createTestPlugin(t *testing.T) *authorizationPlugin {
-	pwd, err := os.Getwd()
-	if err != nil {
-		t.Fatal(err)
-	}
-
-	client, err := plugins.NewClient("unix:///"+path.Join(pwd, pluginAddress), &tlsconfig.Options{InsecureSkipVerify: true})
+	client, err := plugins.NewClient("unix:///"+path.Join("/", pluginAddress), &tlsconfig.Options{InsecureSkipVerify: true})
 	if err != nil {
 		t.Fatalf("Failed to create client %v", err)
 	}


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Mon, 25 Jun 2018 00:34:52 +0200
Subject: dovecot-trees: Fix build with dovecot 2.3.

The following patch was taken verbatim from the upstream repository[0]
and will be included in the next release.

[0]: https://0xacab.org/riseuplabs/trees/commit/e136c32a044701d68b0235b8405357c5fca62a11
---
From e136c32a044701d68b0235b8405357c5fca62a11 Mon Sep 17 00:00:00 2001
From: David Goulet <dgoulet@ev0ke.net>
Date: Tue, 10 Apr 2018 13:48:01 -0400
Subject: [PATCH] Support dovecot 2.3

Untested but it builds now properly. Thanks to "smorks" for the report!

Fixes #16

Signed-off-by: David Goulet <dgoulet@ev0ke.net>
---
 src/trees-istream.c | 4 ++++
 src/trees-ostream.c | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/src/trees-istream.c b/src/trees-istream.c
index b08ff16..e94be7d 100644
--- a/src/trees-istream.c
+++ b/src/trees-istream.c
@@ -431,5 +431,9 @@ trees_istream_create(struct istream *input,
   sstream->out_byte_count = 0;
 #endif

+#if DOVECOT_PREREQ(2, 3)
+	return i_stream_create(&sstream->istream, input, i_stream_get_fd(input), 0);
+#else
   return i_stream_create(&sstream->istream, input, i_stream_get_fd(input));
+#endif /* DOVECOT_PREREQ */
 }
diff --git a/src/trees-ostream.c b/src/trees-ostream.c
index 1b25a91..0cb7867 100644
--- a/src/trees-ostream.c
+++ b/src/trees-ostream.c
@@ -174,7 +174,14 @@ trees_ostream_sendv(struct ostream_private *stream,
 static int
 trees_ostream_flush(struct ostream_private *stream)
 {
+  /* This is pretty ugly but unfortunately between 2.2 and 2.3, Dovecot changed
+   * the expected value to be non zero in 2.3+ . */
+#if DOVECOT_PREREQ(2, 3)
+  ssize_t result = 1;
+#else
   ssize_t result = 0;
+#endif /* DOVECOT_PREREQ */
+
   struct trees_ostream *sstream = (struct trees_ostream *) stream;

   if (sstream->flushed) {
--
2.17.1


code:
1.8.17 was released with a broken test runner.

https://github.com/doxygen/doxygen/issues/7464

Taken from upstream:
https://github.com/doxygen/doxygen/commit/cd9dee013dc749a10bbe019c350e0e62b6635795

diff --git a/testing/runtests.py b/testing/runtests.py
index a4118b865..10fe50214 100755
--- a/testing/runtests.py
+++ b/testing/runtests.py
@@ -3,6 +3,7 @@
 from __future__ import print_function
 import argparse, glob, itertools, re, shutil, os, sys
 import subprocess
+import shlex

 config_reg = re.compile('.*\/\/\s*(?P<name>\S+):\s*(?P<value>.*)$')

@@ -28,10 +29,10 @@ def xpopen(cmd, cmd1="",encoding='utf-8-sig', getStderr=False):
 		return os.popen(cmd).read() # Python 2 without encoding
 	else:
 		if (getStderr):
-			proc = subprocess.run(cmd1,encoding=encoding,capture_output=True) # Python 3 with encoding
-			return proc.stderr
+			proc = subprocess.Popen(shlex.split(cmd1),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
+			return proc.stderr.read()
 		else:
-			proc = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
+			proc = subprocess.Popen(shlex.split(cmd),stdout=subprocess.PIPE,stderr=subprocess.PIPE,encoding=encoding) # Python 3 with encoding
 			return proc.stdout.read()

 class Tester:
@@ -137,7 +138,7 @@ def prepare_test(self):
 				print('GENERATE_DOCBOOK=NO', file=f)
 			if (self.args.xhtml):
 				print('GENERATE_HTML=YES', file=f)
-			# HTML_OUTPUT can also be set locally
+			# HTML_OUTPUT can also have been set locally
 			print('HTML_OUTPUT=%s/html' % self.test_out, file=f)
 			print('HTML_FILE_EXTENSION=.xhtml', file=f)
 			if (self.args.pdf):
@@ -184,7 +185,7 @@ def update_test(self,testmgr):
 					print('Non-existing file %s after \'check:\' statement' % check_file)
 					return
 				# convert output to canonical form
-				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file)).read()
+				data = xpopen('%s --format --noblanks --nowarning %s' % (self.args.xmllint,check_file))
 				if data:
 					# strip version
 					data = re.sub(r'xsd" version="[0-9.-]+"','xsd" version=""',data).rstrip('\n')
@@ -326,7 +327,7 @@ def perform_test(self,testmgr):
 			tests.append(glob.glob('%s/*.xml' % (docbook_output)))
 			tests.append(glob.glob('%s/*/*/*.xml' % (docbook_output)))
 			tests = ' '.join(list(itertools.chain.from_iterable(tests))).replace(self.args.outputdir +'/','').replace('\\','/')
-			exe_string = '%s --nonet --postvalid %s' % (self.args.xmllint,tests)
+			exe_string = '%s --noout --nonet --postvalid %s' % (self.args.xmllint,tests)
 			exe_string1 = exe_string
 			exe_string += ' %s' % (redirx)
 			exe_string += ' %s more "%s/temp"' % (separ,docbook_output)
@@ -346,7 +347,11 @@ def perform_test(self,testmgr):
 				redirx=' 2> %s/temp >nul:'%html_output
 			else:
 				redirx='2>%s/temp >/dev/null'%html_output
-			exe_string = '%s --path dtd --nonet --postvalid %s/*xhtml' % (self.args.xmllint,html_output)
+			check_file = []
+			check_file.append(glob.glob('%s/*.xhtml' % (html_output)))
+			check_file.append(glob.glob('%s/*/*/*.xhtml' % (html_output)))
+			check_file = ' '.join(list(itertools.chain.from_iterable(check_file))).replace(self.args.outputdir +'/','').replace('\\','/')
+			exe_string = '%s --noout --path dtd --nonet --postvalid %s' % (self.args.xmllint,check_file)
 			exe_string1 = exe_string
 			exe_string += ' %s' % (redirx)
 			exe_string += ' %s more "%s/temp"' % (separ,html_output)


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
@@ -6,38 +6,6 @@
     <briefdescription>
     </briefdescription>
     <detaileddescription>
-      <para>
-        <variablelist>
-          <varlistentry>
-            <term><anchor id="citelist_1CITEREF_Be09"/>[1]</term>
-          </varlistentry>
-          <listitem>
-            <para>P.<nonbreakablespace/>Belotti. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_5">Disjunctive cuts for non-convex MINLP</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 117<ndash/>144.</para>
-            <para/>
-          </listitem>
-          <varlistentry>
-            <term><anchor id="citelist_1CITEREF_BertholdHeinzVigerske2009"/>[2]</term>
-          </varlistentry>
-          <listitem>
-            <para>T.<nonbreakablespace/>Berthold, S.<nonbreakablespace/>Heinz, and S.<nonbreakablespace/>Vigerske. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3_15">Extending a CIP framework to solve MIQCPs</ulink>. In <ulink url="#CITEREF_LeLe12">Lee and Leyffer</ulink> <ulink url="#CITEREF_LeLe12">[4]</ulink>, pages 427<ndash/>444.</para>
-            <para/>
-          </listitem>
-          <varlistentry>
-            <term><anchor id="citelist_1CITEREF_knuth79"/>[3]</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>
-          <varlistentry>
-            <term><anchor id="citelist_1CITEREF_LeLe12"/>[4]</term>
-          </varlistentry>
-          <listitem>
-            <para>Jon Lee and Sven Leyffer, editors. <ulink url="http://doi.org/10.1007/978-1-4614-1927-3"><emphasis>Mixed Integer Nonlinear Programming</emphasis></ulink>, volume 154 of <emphasis>The IMA Volumes in Mathematics and its Applications</emphasis>. Springer, 2012.</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
@@ -6,8 +6,8 @@
     <briefdescription>
     </briefdescription>
     <detaileddescription>
-      <para>See <ref refid="citelist_1CITEREF_knuth79" kindref="member">[3]</ref> for more info.</para>
-      <para>Other references with cross references see <ref refid="citelist_1CITEREF_Be09" kindref="member">[1]</ref> and <ref refid="citelist_1CITEREF_BertholdHeinzVigerske2009" kindref="member">[2]</ref> for more info. </para>
+      <para>See knuth79 for more info.</para>
+      <para>Other references with cross references see Be09 and BertholdHeinzVigerske2009 for more info. </para>
     </detaileddescription>
   </compounddef>
 </doxygen>


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 16 Jun 2019 02:34:10 +0200
Subject: [PATCH] gnu: dstat: Fix crash when specifying a delay.

Taken verbatim from a pull request[0] that will never be merged.

[0]: https://github.com/dagwieers/dstat/pull/167

From 220a785321b13b6df92a536080aca6ef1cb644ad Mon Sep 17 00:00:00 2001
From: Falko Goettsch <falko@uw.edu>
Date: Mon, 11 Mar 2019 20:12:49 -0700
Subject: [PATCH] Fixed bug when specifying a delay

The division in the 'loop' calculation in perform() was returning floating point values
after the migration to Python 3, rather than rounding down. Changed to floor division.

I think the floating point values kept 'loop == 0' from ever being
true and the variables inside that conditional were never initialized,
causing the following error when a delay other than 1 was specified:

You did not select any stats, using -cdngy by default.
Traceback (most recent call last):
  File "/home/falko/repos/dstat/dstat", line 2825, in <module>
    main()
  File "/home/falko/repos/dstat/dstat", line 2684, in main
    scheduler.run()
  File "/home/falko/.conda/envs/python3/lib/python3.7/sched.py", line 151, in run
    action(*argument, **kwargs)
  File "/home/falko/repos/dstat/dstat", line 2729, in perform
    oldcols = cols
NameError: name 'cols' is not defined
---
 dstat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dstat b/dstat
index 9359965..3b4980f 100755
--- a/dstat
+++ b/dstat
@@ -2697,7 +2697,7 @@ def perform(update):

         starttime = time.time()

-        loop = (update - 1 + op.delay) / op.delay
+        loop = (update - 1 + op.delay) // op.delay
         step = ((update - 1) % op.delay) + 1

         ### Get current time (may be different from schedule) for debugging


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Sun, 16 Jun 2019 02:36:23 +0200
Subject: [PATCH] gnu: dstat: Skip devices without I/O.

Taken verbatim from a pull request[0] that will never be merged.

[0]: https://github.com/dagwieers/dstat/pull/164

From 0988589ea4ee092b285bd4049d56add5f61e3f69 Mon Sep 17 00:00:00 2001
From: Tobias Gruetzmacher <tobias-git@23.gs>
Date: Fri, 15 Feb 2019 18:46:57 +0100
Subject: [PATCH] Skip devices without I/O

Linux 4.18+ has added more fields to the diskstats proc file, so the
original skip condition for devices without I/O didn't apply anymore.
---
 dstat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dstat b/dstat
index 9359965..5c2fb53 100755
--- a/dstat
+++ b/dstat
@@ -763,7 +763,7 @@ class dstat_disk(dstat):
         ret = []
         for l in self.splitlines():
             if len(l) < 13: continue
-            if l[3:] == ['0',] * 11: continue
+            if l[3:] == ['0',] * (len(l) - 3): continue
             name = l[2]
             ret.append(name)
         for item in objlist: ret.append(item)


code:
Fix build of dune-istl's tests

Patch copied from upstream source repository:

https://gitlab.dune-project.org/core/dune-istl/-/commit/9eee3462df5a64881c08574f9291e76db398de0a

From 9eee3462df5a64881c08574f9291e76db398de0a Mon Sep 17 00:00:00 2001
From: Felix Gruber <felgru@posteo.net>
Date: Sat, 4 Apr 2020 15:27:09 +0200
Subject: [PATCH] make tests succeed when MPI is disabled

When MPI is not available or explicitly disabled with the CMake build
option -DCMAKE_IDSABLE_FIND_PACKAGE_MPI=TRUE, some tests were unable to
build.

The tests created from solverfactorytest.cc.in and part of
scalarproductstest.cc use Dune::OwnerOverlapCopyCommunication which is
defined behind `#if HAVE_MPI` and is thus not available in a non-MPI
build. I've thus disabled those tests when MPI is unavailable.

The matrixmarkettest did not work without MPI, as it contained some code
using the wrong template parameters when HAVE_MPI was not set. Those
template paramters have been fixed now.

I've confirmed, that after my changes `make build_tests` succeeds to
build all tests and that those tests run without failure.
---
 dune/istl/test/CMakeLists.txt        | 3 ++-
 dune/istl/test/matrixmarkettest.cc   | 2 +-
 dune/istl/test/scalarproductstest.cc | 2 ++
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/dune/istl/test/CMakeLists.txt b/dune/istl/test/CMakeLists.txt
index ffd87969..2c7b2387 100644
--- a/dune/istl/test/CMakeLists.txt
+++ b/dune/istl/test/CMakeLists.txt
@@ -77,7 +77,8 @@ set(DUNE_TEST_FACTORY_BLOCK_SIZES
 function(add_factory_test BLOCK)
   STRING(REGEX REPLACE "[^a-zA-Z0-9]" "" BLOCK_CLEAN ${BLOCK})
   configure_file(solverfactorytest.cc.in solverfactorytest_${BLOCK_CLEAN}.cc)
-  dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc)
+  dune_add_test(SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverfactorytest_${BLOCK_CLEAN}.cc
+                CMAKE_GUARD HAVE_MPI)
 endfunction(add_factory_test)

 foreach(FIELD_TYPE ${DUNE_TEST_FACTORY_FIELD_TYPES})
diff --git a/dune/istl/test/matrixmarkettest.cc b/dune/istl/test/matrixmarkettest.cc
index b335afe6..ce30e8ae 100644
--- a/dune/istl/test/matrixmarkettest.cc
+++ b/dune/istl/test/matrixmarkettest.cc
@@ -52,7 +52,7 @@ int testMatrixMarket(int N)
   storeMatrixMarket(mat, std::string("testmat"), comm);
   storeMatrixMarket(bv, std::string("testvec"), comm, false);
 #else
-  typedef Dune::MatrixAdapter<BCRSMat,BVector,BVector> Operator;
+  typedef Dune::MatrixAdapter<Matrix,Vector,Vector> Operator;
   Operator op(mat);
   op.apply(bv, cv);

diff --git a/dune/istl/test/scalarproductstest.cc b/dune/istl/test/scalarproductstest.cc
index 452b1d89..f46ce2a9 100644
--- a/dune/istl/test/scalarproductstest.cc
+++ b/dune/istl/test/scalarproductstest.cc
@@ -115,6 +115,7 @@ int main(int argc, char** argv)
     scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
   }

+#if HAVE_MPI
   // Test the ParallelScalarProduct class
   {
     using Vector = BlockVector<FieldVector<double,BlockSize> >;
@@ -139,6 +140,7 @@ int main(int argc, char** argv)
     ScalarProduct scalarProduct(communicator,SolverCategory::nonoverlapping);
     scalarProductTest<ScalarProduct, Vector>(scalarProduct,numBlocks);
   }
+#endif

   return t.exit();
 }
--
2.25.1


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:
Patch backported by Sage.

Fix from upstream that happens to work around
https://trac.sagemath.org/ticket/23011
diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp
index 77ca799..53b887c 100644
--- a/src/lsp/format.lsp
+++ b/src/lsp/format.lsp
@@ -307,11 +307,13 @@
                   :start (format-directive-start struct)
                   :end (format-directive-end struct))))

+(defconstant +format-directive-limit+ (1+ (char-code #\~)))
+
 #+formatter
 (defparameter *format-directive-expanders*
-  (make-array char-code-limit :initial-element nil))
+  (make-array +format-directive-limit+ :initial-element nil))
 (defparameter *format-directive-interpreters*
-  (make-array char-code-limit :initial-element nil))
+  (make-array +format-directive-limit+ :initial-element nil))

 (defparameter *default-format-error-control-string* nil)
 (defparameter *default-format-error-offset* nil)
@@ -550,24 +552,24 @@
            (write-string directive stream)
            (interpret-directive-list stream (cdr directives) orig-args args))
           (#-ecl format-directive #+ecl vector
+           (multiple-value-bind
+                 (new-directives new-args)
+               (let* ((code (char-code (format-directive-character directive)))
+                      (function
+                        (and (< code +format-directive-limit+)
+                             (svref *format-directive-interpreters* code)))
+                      (*default-format-error-offset*
+                        (1- (format-directive-end directive))))
+                 (unless function
+                   (error 'format-error
+                          :complaint "Unknown format directive."))
                  (multiple-value-bind
                        (new-directives new-args)
-                     (let ((function
-                            (svref *format-directive-interpreters*
-                                   (char-code (format-directive-character
-                                               directive))))
-                           (*default-format-error-offset*
-                            (1- (format-directive-end directive))))
-                       (unless function
-                         (error 'format-error
-                                :complaint "Unknown format directive."))
-                       (multiple-value-bind
-                             (new-directives new-args)
-                           (funcall function stream directive
-                                    (cdr directives) orig-args args)
-                         (values new-directives new-args)))
-                   (interpret-directive-list stream new-directives
-                                             orig-args new-args)))))
+                     (funcall function stream directive
+                              (cdr directives) orig-args args)
+                   (values new-directives new-args)))
+             (interpret-directive-list stream new-directives
+                                       orig-args new-args)))))
       args))

@@ -639,11 +641,12 @@
        (values `(write-string ,directive stream)
                more-directives))
       (format-directive
-       (let ((expander
-              (aref *format-directive-expanders*
-                    (char-code (format-directive-character directive))))
-             (*default-format-error-offset*
-              (1- (format-directive-end directive))))
+       (let* ((code (char-code (format-directive-character directive)))
+              (expander
+                (and (< code +format-directive-limit+)
+                     (svref *format-directive-expanders* code)))
+              (*default-format-error-offset*
+                (1- (format-directive-end directive))))
          (if expander
              (funcall expander directive more-directives)
              (error 'format-error


code:
Patch adapted from Sage.
diff -Naur ecl-16.1.2.orig/src/c/file.d ecl-16.1.2/src/c/file.d
--- ecl-16.1.2.orig/src/c/file.d	2016-05-11 13:10:51.867673867 +1200
+++ ecl-16.1.2/src/c/file.d	2016-05-11 14:44:48.121907307 +1200
@@ -3354,8 +3354,10 @@
   ecl_disable_interrupts();
   do {
     out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm));
-  } while (out < n && restartable_io_error(strm, "fwrite"));
-  ecl_enable_interrupts();
+  /* Ignore write errors to stderr to avoid an infinite loop */
+  } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite"));
+
+  ecl_enable_interrupts();
   return out;
 }


code:
Patch adapted from Sage. Allows building ECL on libffi 3.3.
diff --git a/src/c/ffi.d b/src/c/ffi.d
index 8861303e..8a959c23 100644
--- a/src/c/ffi.d
+++ b/src/c/ffi.d
@@ -133,8 +133,8 @@ static struct {
 #elif defined(X86_WIN64)
   {@':win64', FFI_WIN64},
 #elif defined(X86_ANY) || defined(X86) || defined(X86_64)
-  {@':cdecl', FFI_SYSV},
-  {@':sysv', FFI_SYSV},
+  {@':cdecl', FFI_UNIX64},
+  {@':sysv', FFI_UNIX64},
   {@':unix64', FFI_UNIX64},
 #endif
 };