diff -Nru distcc-3.3.2/AUTHORS distcc-3.3.3/AUTHORS --- distcc-3.3.2/AUTHORS 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/AUTHORS 2019-08-14 19:07:05.000000000 +0000 @@ -1,6 +1,6 @@ Author and maintainer emeritus of distcc: - Martin Pool + Martin Pool Authors of "pump" functionality, and maintainers of distcc: diff -Nru distcc-3.3.2/configure.ac distcc-3.3.3/configure.ac --- distcc-3.3.2/configure.ac 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/configure.ac 2019-08-14 19:07:05.000000000 +0000 @@ -10,7 +10,7 @@ # As of 0.6cvs, distcc no longer uses automake, only autoconf. AC_PREREQ(2.69) -AC_INIT(distcc, 3.3.2, distcc@lists.samba.org) +AC_INIT(distcc, 3.3.3, distcc@lists.samba.org) AC_CONFIG_HEADERS(src/config.h) @@ -22,7 +22,7 @@ # either set CPPFLAGS and LDFLAGS when running configure, or use # --with-extra-foo. -# Check for socklen_t, and do something appropiate on systems +# Check for socklen_t, and do something appropriate on systems # that don't have it. AC_CHECK_TYPE([socklen_t], ,[ AC_MSG_CHECKING([for socklen_t equivalent]) @@ -59,7 +59,7 @@ #include ]) dnl Android requires -llog for printf and friends -dnl and will only run position independant executables +dnl and will only run position independent executables AC_MSG_CHECKING([if building on Android]) AC_TRY_COMPILE([ #ifdef __BIONIC__ diff -Nru distcc-3.3.2/debian/changelog distcc-3.3.3/debian/changelog --- distcc-3.3.2/debian/changelog 2019-05-12 07:48:36.000000000 +0000 +++ distcc-3.3.3/debian/changelog 2019-08-15 15:09:56.000000000 +0000 @@ -1,3 +1,15 @@ +distcc (3.3.3-1) unstable; urgency=medium + + * New upstream bugfix release. + + -- Christian Marillat Thu, 15 Aug 2019 17:09:56 +0200 + +distcc (3.3.2-11) unstable; urgency=medium + + * Update French translation of debconf messages (Closes: #926451) + + -- Christian Marillat Sun, 12 May 2019 10:12:18 +0200 + distcc (3.3.2-10) unstable; urgency=medium * Add Pre-Depends: field to fix diff -Nru distcc-3.3.2/debian/control distcc-3.3.3/debian/control --- distcc-3.3.2/debian/control 2019-05-12 07:48:23.000000000 +0000 +++ distcc-3.3.3/debian/control 2019-05-12 08:12:18.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Christian Marillat Homepage: https://distcc.github.io/ -Standards-Version: 4.3.0 +Standards-Version: 4.4.0 Build-Depends: debhelper-compat (= 12), libpopt-dev, libgtk2.0-dev, po-debconf, dh-python, libiberty-dev, python3-dev | python3.7-dev, libavahi-client-dev, libkrb5-dev diff -Nru distcc-3.3.2/debian/distcc.triggers.in distcc-3.3.3/debian/distcc.triggers.in --- distcc-3.3.2/debian/distcc.triggers.in 2018-12-23 08:37:55.000000000 +0000 +++ distcc-3.3.3/debian/distcc.triggers.in 2019-05-12 08:12:18.000000000 +0000 @@ -1,2 +1,3 @@ interest /usr/lib/gcc +interest /usr/lib/clang interest /usr/lib/%DEB_HOST_MULTIARCH%/gcc diff -Nru distcc-3.3.2/debian/patches/01_Makefile.am.patch distcc-3.3.3/debian/patches/01_Makefile.am.patch --- distcc-3.3.2/debian/patches/01_Makefile.am.patch 2018-12-20 16:05:39.000000000 +0000 +++ distcc-3.3.3/debian/patches/01_Makefile.am.patch 2019-08-15 15:09:56.000000000 +0000 @@ -10,7 +10,7 @@ dist_dirs = m4 include_server/test_data -@@ -1040,7 +1041,7 @@ showpaths: +@@ -1037,7 +1038,7 @@ showpaths: # tricky features so mkinstalldirs and cp will do install: showpaths install-doc install-man install-programs \ @@ -19,7 +19,7 @@ install-programs: $(bin_PROGRAMS) $(sbin_PROGRAMS) $(mkinstalldirs) "$(DESTDIR)$(bindir)" -@@ -1083,7 +1084,7 @@ install-include-server: include-server p +@@ -1080,7 +1081,7 @@ install-include-server: include-server p --build-base="$(include_server_builddir)" \ --build-temp="$(include_server_builddir)" \ install \ @@ -28,7 +28,7 @@ --record="$(include_server_builddir)/install.log.pre" \ --root="$$DESTDIR" \ || exit 1; \ -@@ -1095,7 +1096,7 @@ install-include-server: include-server p +@@ -1092,7 +1093,7 @@ install-include-server: include-server p cp -f "$(include_server_builddir)/install.log" "$(PYTHON_INSTALL_RECORD)"; \ fi; \ $(mkinstalldirs) "$(DESTDIR)$(bindir)" && \ @@ -36,8 +36,8 @@ + INCLUDE_SERVER="/usr/lib/distcc-pump/include_server/include_server.py" && \ sed "s,^include_server='',include_server='$$INCLUDE_SERVER'," \ pump > "$(include_server_builddir)/pump" && \ - $(INSTALL_PROGRAM) "$(include_server_builddir)/pump" "$(DESTDIR)$(bindir)"; \ -@@ -1128,10 +1129,14 @@ install-example: $(example_DOCS) + $(INSTALL_SCRIPT) "$(include_server_builddir)/pump" "$(DESTDIR)$(bindir)"; \ +@@ -1125,10 +1126,14 @@ install-example: $(example_DOCS) $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(docdir)/example" || exit 1; \ done @@ -56,7 +56,7 @@ done install-conf: $(conf_files) $(default_files) -@@ -1217,11 +1222,16 @@ uninstall-example: +@@ -1214,11 +1219,16 @@ uninstall-example: -rmdir "$(DESTDIR)$(docdir)/example" uninstall-gnome-data: diff -Nru distcc-3.3.2/debian/patches/04_rename-pump.patch distcc-3.3.3/debian/patches/04_rename-pump.patch --- distcc-3.3.2/debian/patches/04_rename-pump.patch 2018-12-18 15:19:20.000000000 +0000 +++ distcc-3.3.3/debian/patches/04_rename-pump.patch 2019-08-15 15:09:56.000000000 +0000 @@ -39,7 +39,7 @@ .TP .B ,auth Enables GSSAPI-based mutual authentication for this host. -@@ -974,7 +974,7 @@ Other known bugs may be documented on +@@ -980,7 +980,7 @@ Other known bugs may be documented on distcc was written by Martin Pool , with the co-operation of many scholars including Wayne Davison, Frerich Raabe, Dimitri Papadopoulos and others noted in the NEWS file. Please report @@ -48,7 +48,7 @@ .SH "LICENCE" You are free to use distcc. distcc (including this manual) may be copied, modified or distributed only under the terms of the GNU -@@ -982,7 +982,7 @@ General Public Licence version 2 or late +@@ -988,7 +988,7 @@ General Public Licence version 2 or late absolutely no warrany. A copy of the GPL is included in the file COPYING. .SH "SEE ALSO" @@ -56,7 +56,7 @@ +\fBdistccd\fR(1), \fBdistcc-pump\fR(1), \fBinclude_server\fR(1), \fBgcc\fR(1), \fBmake\fR(1), and \fBccache\fR(1). .I http://code.google.com/p/distcc/ - .I http://ccache.samba.org/ + .I https://ccache.dev/ --- a/man/pump.1 +++ b/man/pump.1 @@ -1,23 +1,23 @@ diff -Nru distcc-3.3.2/debian/po/fr.po distcc-3.3.3/debian/po/fr.po --- distcc-3.3.2/debian/po/fr.po 2019-01-26 15:21:38.000000000 +0000 +++ distcc-3.3.3/debian/po/fr.po 2019-04-18 10:02:33.000000000 +0000 @@ -11,7 +11,7 @@ "Project-Id-Version: \n" "Report-Msgid-Bugs-To: distcc@packages.debian.org\n" "POT-Creation-Date: 2018-12-22 18:41+0100\n" -"PO-Revision-Date: 2019-01-18 12:53+0100\n" +"PO-Revision-Date: 2019-02-25 18:57+0100\n" "Last-Translator: Quentin LEJARD \n" "Language-Team: French \n" "Language: fr\n" @@ -72,10 +72,6 @@ #. Type: string #. Description #: ../distcc.templates:2001 -#| msgid "" -#| "You can list multiple hosts and/or networks, separated by spaces. Hosts " -#| "are represented by their IP address, networks have to be in CIDR " -#| "notation, f.e. \"192.168.1.0/24\"." msgid "" "You can list multiple hosts and/or networks, separated by spaces. Hosts are " "represented by their IP address, networks have to be in CIDR notation, e.g. " @@ -151,15 +147,19 @@ #. Type: string #. Description #: ../distcc.templates:4001 +#| msgid "" +#| "You can start the distcc daemon with a nice level, to give it a low " +#| "priority compared to other processes. The start script will only accept " +#| "values between 0 and 20." msgid "" "You can start the distcc daemon with a nice level, to give it a low priority " "compared to other processes. The start script will only accept values " -"between 0 and 20." +"between 0 and 20." msgstr "" "Il est possible de lancer le démon distcc avec un niveau de politesse " "permettant qu'il s'exécute avec une priorité inférieure à celle d'autres " -"processus. Cette valeur dans le script de démarrage doit être un " -"nombre entier compris entre 0 et 20 inclus." +"processus. Cette valeur dans le script de démarrage doit être un nombre " +"entier compris entre 0 et 20 inclus." #. Type: string #. Description diff -Nru distcc-3.3.2/doc/example/init distcc-3.3.3/doc/example/init --- distcc-3.3.2/doc/example/init 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/example/init 2019-08-14 19:07:05.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # # chkconfig: - 60 20 -# description: The distcc deamon +# description: The distcc daemon # http://code.google.com/p/distcc/ # # processname: distccd diff -Nru distcc-3.3.2/doc/protocol-1.txt distcc-3.3.3/doc/protocol-1.txt --- distcc-3.3.2/doc/protocol-1.txt 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/protocol-1.txt 2019-08-14 19:07:05.000000000 +0000 @@ -117,7 +117,7 @@ [note: Sending the parameter as hexadecimal is redundant, because four bytes would be sufficient to encode the 32-bit integer. Sending as -hexadecimal serves as a futher check that the client and server are +hexadecimal serves as a further check that the client and server are synchronized. Incorrect values for the parameter are detected as a program or network error.] diff -Nru distcc-3.3.2/doc/protocol-3.txt distcc-3.3.3/doc/protocol-3.txt --- distcc-3.3.2/doc/protocol-3.txt 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/protocol-3.txt 2019-08-14 19:07:05.000000000 +0000 @@ -72,7 +72,7 @@ Notes ----- -This protocol is most useful in conjuction with an "include server" that +This protocol is most useful in conjunction with an "include server" that discovers, for each compilation unit, the list of needed files without actually preprocessing. The protocol for talking to the include server is simple: distcc sends a CDIR packet, and an ARGC/ARGV sequence with the diff -Nru distcc-3.3.2/doc/web/benchmark.html distcc-3.3.3/doc/web/benchmark.html --- distcc-3.3.2/doc/web/benchmark.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/benchmark.html 2019-08-14 19:07:05.000000000 +0000 @@ -35,7 +35,7 @@ diff -Nru distcc-3.3.2/doc/web/compared.html distcc-3.3.3/doc/web/compared.html --- distcc-3.3.2/doc/web/compared.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/compared.html 2019-08-14 19:07:05.000000000 +0000 @@ -47,7 +47,7 @@ diff -Nru distcc-3.3.2/doc/web/compilers.html distcc-3.3.3/doc/web/compilers.html --- distcc-3.3.2/doc/web/compilers.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/compilers.html 2019-08-14 19:07:05.000000000 +0000 @@ -47,7 +47,7 @@ diff -Nru distcc-3.3.2/doc/web/distcc-lca-2004.html distcc-3.3.3/doc/web/distcc-lca-2004.html --- distcc-3.3.2/doc/web/distcc-lca-2004.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/distcc-lca-2004.html 2019-08-14 19:07:05.000000000 +0000 @@ -114,7 +114,7 @@ preprocessed text plus the compiler command line completely specifies the output. By running the preprocessor locally, distcc avoids any requirement to have the same headers on all machines.

-

Before distcc, the compilercache and ccache programs used this +

Before distcc, the compilercache and ccache programs used this observation to remember the results of building a particular source file. This can be useful when trees are cleaned and rebuilt, or when similar trees are built in different directories.

@@ -649,7 +649,7 @@

A few maxims about demonstration of software projects have been borne out by distcc's development. Before development began, a feasibility study demonstrated that the concept could work. The design is -intentionally simple and the scope modestly focussed on a subset of +intentionally simple and the scope modestly focused on a subset of important problems. Strong logging helps get useful results from distributed community testing. Performance features such as compression and new network APIs were used selectively in places where diff -Nru distcc-3.3.2/doc/web/faq.html distcc-3.3.3/doc/web/faq.html --- distcc-3.3.2/doc/web/faq.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/faq.html 2019-08-14 19:07:05.000000000 +0000 @@ -44,7 +44,7 @@

@@ -737,7 +737,7 @@

Programs that use gcc's DEPENDENCIES_OUTPUT option don't work with ccache.

- This should be fixed in ccache 2.3. There is no problem with distcc. + This should be fixed in ccache 2.3. There is no problem with distcc.

distcc fails to build on OS X

@@ -816,7 +816,7 @@ This can affect other programs which rely on debug stabs, such as addr2line, and it results in object files not being byte-for-byte identical when they include the source directory. The -same bug affects ccache. +same bug affects ccache.

TCP_CORK in linux-2.2

diff -Nru distcc-3.3.2/doc/web/index.html distcc-3.3.3/doc/web/index.html --- distcc-3.3.2/doc/web/index.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/index.html 2019-08-14 19:07:05.000000000 +0000 @@ -34,7 +34,7 @@

@@ -159,7 +159,7 @@
  • - ccache + ccache caches compiler output to accelerate builds.
  • dmucs helps distcc select diff -Nru distcc-3.3.2/doc/web/man/distcc_1.html distcc-3.3.3/doc/web/man/distcc_1.html --- distcc-3.3.2/doc/web/man/distcc_1.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/man/distcc_1.html 2019-08-14 19:07:05.000000000 +0000 @@ -1291,6 +1291,6 @@ distccd(1), pump(1), include_server(1), gcc(1), make(1), and ccache(1). http://code.google.com/p/distcc/ -http://ccache.samba.org/
    +https://ccache.dev/
    diff -Nru distcc-3.3.2/doc/web/man/distccmon_text_1.html distcc-3.3.3/doc/web/man/distccmon_text_1.html --- distcc-3.3.2/doc/web/man/distccmon_text_1.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/man/distccmon_text_1.html 2019-08-14 19:07:05.000000000 +0000 @@ -156,6 +156,6 @@

    distccd(1), ccache(1), gcc(1), make(1) http://code.google.com/p/distcc/ -http://ccache.samba.org/
    +https://ccache.dev/
    diff -Nru distcc-3.3.2/doc/web/man/include_server_1.html distcc-3.3.3/doc/web/man/include_server_1.html --- distcc-3.3.2/doc/web/man/include_server_1.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/man/include_server_1.html 2019-08-14 19:07:05.000000000 +0000 @@ -493,6 +493,6 @@ SEE ALSO distcc(1), distccd(1), include_server(1), -and gcc(1). http://code.google.com/p/distcc/ http://ccache.samba.org/
    +and gcc(1). http://code.google.com/p/distcc/ https://ccache.dev/
    diff -Nru distcc-3.3.2/doc/web/results.html distcc-3.3.3/doc/web/results.html --- distcc-3.3.2/doc/web/results.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/results.html 2019-08-14 19:07:05.000000000 +0000 @@ -44,7 +44,7 @@

    @@ -64,7 +64,7 @@ be set up in no time and if like us you're continuously and repeatedly building lots of code it'll save you hours if not days of waiting around for compiles to finish. Also check out - ccache. + ccache. — The Rosegarden music software developers. diff -Nru distcc-3.3.2/doc/web/scenarios.html distcc-3.3.3/doc/web/scenarios.html --- distcc-3.3.2/doc/web/scenarios.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/scenarios.html 2019-08-14 19:07:05.000000000 +0000 @@ -44,7 +44,7 @@ diff -Nru distcc-3.3.2/doc/web/security.html distcc-3.3.3/doc/web/security.html --- distcc-3.3.2/doc/web/security.html 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/doc/web/security.html 2019-08-14 19:07:05.000000000 +0000 @@ -44,7 +44,7 @@ diff -Nru distcc-3.3.2/.gitignore distcc-3.3.3/.gitignore --- distcc-3.3.2/.gitignore 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/.gitignore 2019-08-14 19:07:05.000000000 +0000 @@ -8,6 +8,7 @@ distccmon-text lsdistcc pump +update-distcc-symlinks # files generated by build tools Makefile @@ -24,3 +25,5 @@ src/config.h.stamp man/*.gz _testtmp/ +__pycache__/ +/h_* diff -Nru distcc-3.3.2/include_server/parse_command.py distcc-3.3.3/include_server/parse_command.py --- distcc-3.3.2/include_server/parse_command.py 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/include_server/parse_command.py 2019-08-14 19:07:05.000000000 +0000 @@ -119,6 +119,22 @@ for key in CPP_OPTIONS_MAYBE_TWO_WORDS.keys(): assert key[1] in CPP_OPTIONS_MAYBE_TWO_WORDS_FIRST_LETTERS +PATH_EXPR='[/a-zA-Z_0-9.]+' # regular expression for a partial file path + +# These are the cpp options that require regular expressions, m is Match. +CPP_OPTIONS_REGULAR_EXPRESSIONS = { + '-Wa,(%s\.s)' % PATH_EXPR: lambda ps, m: ps.include_files.append(m.group(1)), + '-Wa,\[(%s\.s)\]' % PATH_EXPR: lambda ps, m: ps.include_files.append(m.group(1)), +} + +CPP_OPTIONS_REGULAR_EXPRESSIONS_STARTS_WITH = '-Wa,' +for key in CPP_OPTIONS_REGULAR_EXPRESSIONS.keys(): + assert key.startswith(CPP_OPTIONS_REGULAR_EXPRESSIONS_STARTS_WITH) + +CPP_OPTIONS_REGULAR_EXPRESSIONS_COMPILED = {} +for key in CPP_OPTIONS_REGULAR_EXPRESSIONS.keys(): + CPP_OPTIONS_REGULAR_EXPRESSIONS_COMPILED[key] = re.compile(key) + # These are the cpp options that a) are more than one letter long, # b) always take an argument, and c) must have that argument as a # separate word in argv. @@ -415,6 +431,20 @@ if found_action: # what we really need here is a goto! continue + # Deal with the complex options requiring regular expressions last. + if args[i].startswith(CPP_OPTIONS_REGULAR_EXPRESSIONS_STARTS_WITH): + found_action = False + for (option, action) in CPP_OPTIONS_REGULAR_EXPRESSIONS.items(): + r = CPP_OPTIONS_REGULAR_EXPRESSIONS_COMPILED[option] + m = r.match(args[i]) + if action and m is not None: + action(parse_state, m) + i += 1 + found_action = True + break + if found_action: + continue + # Whatever is left must be a one-word option (that is, an option # without an arg) that it's safe to ignore. i += 1 diff -Nru distcc-3.3.2/include_server/parse_command_test.py distcc-3.3.3/include_server/parse_command_test.py --- distcc-3.3.2/include_server/parse_command_test.py 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/include_server/parse_command_test.py 2019-08-14 19:07:05.000000000 +0000 @@ -133,6 +133,10 @@ + " -isystem system -Imice -iquote/and -I/men a.c " + " -include included_A.h " + " -includeincluded_B.h " + + " -Wa,macros_A.s " + + " -Wa,[macros_B.s] " + + " -Wa,arch/x86/kernel/macros.s -Wa,- " + + " -Wa,other_directive " + "-Xlinker W,l -L /ignored_by_us -o a.o"), os.getcwd(), self.includepath_map, @@ -146,7 +150,8 @@ filepath), (('/and', 'mice', '/men', 'system'), ('mice', '/men', 'system'), - ["included_A.h", "included_B.h"], + ["included_A.h", "included_B.h", + "macros_A.s", "macros_B.s", "arch/x86/kernel/macros.s"], 'a.c')) diff -Nru distcc-3.3.2/INSTALL distcc-3.3.3/INSTALL --- distcc-3.3.2/INSTALL 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/INSTALL 2019-08-14 19:07:05.000000000 +0000 @@ -56,7 +56,7 @@ A C compiler GNU libiberty (distributed with GNU Binutils and GCC) -It is also highly desireable to have +It is also highly desirable to have Python >=3.1 @@ -256,7 +256,7 @@ localhost @red @green @blue The hosts should be listed in descending order of speed. localhost -should normally be first, unless it is signficantly slower than +should normally be first, unless it is significantly slower than another machine. If you many hosts (say ten or more), it's probably better to leave localhost out of the list. diff -Nru distcc-3.3.2/Makefile.in distcc-3.3.3/Makefile.in --- distcc-3.3.2/Makefile.in 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/Makefile.in 2019-08-14 19:07:05.000000000 +0000 @@ -612,7 +612,7 @@ -rm -fr "$(distdir)" $(MAKE) dist-files $(TAR) cf "$(tarball)" "$(distdir)" - $(GZIP_BIN) --help >/dev/null && \ + $(GZIP_BIN) --help >/dev/null 2>&1 && \ $(GZIP_BIN) -fc "$(tarball)" > "$(tarball_gz)" $(BZIP2_BIN) --help 2>/dev/null && \ $(BZIP2_BIN) -vfc "$(tarball)" > "$(tarball_bz2)" @@ -777,12 +777,9 @@ check: @if test -n "$(PYTHON)"; then \ $(MAKE) maintainer-check; \ - elif test -n "$(PYTHON)"; then \ + else \ echo "WARNING: pump-mode not being tested"; \ $(MAKE) distcc-maintainer-check; \ - else \ - echo "Cannot run tests: python binary not found"; \ - false; \ fi # Runs the tests in lzo-mode. @@ -1098,13 +1095,13 @@ INCLUDE_SERVER=`grep '/include_server.py$$' "$(include_server_builddir)/install.log"` && \ sed "s,^include_server='',include_server='$$INCLUDE_SERVER'," \ pump > "$(include_server_builddir)/pump" && \ - $(INSTALL_PROGRAM) "$(include_server_builddir)/pump" "$(DESTDIR)$(bindir)"; \ + $(INSTALL_SCRIPT) "$(include_server_builddir)/pump" "$(DESTDIR)$(bindir)"; \ fi install-man: $(man1_MEN) $(mkinstalldirs) "$(DESTDIR)$(man1dir)" for p in $(man1_MEN); do \ - if $(GZIP_BIN) --help >/dev/null; then \ + if $(GZIP_BIN) --help >/dev/null 2>&1; then \ mkdir -p "`dirname $$p`"; \ if [ -e "$(DESTDIR)$(man1dir)$$p" ]; then rm -fv "$(DESTDIR)$(man1dir)$$p"; fi; \ $(GZIP_BIN) < "$(srcdir)/$$p" > "$$p.gz"; \ diff -Nru distcc-3.3.2/man/distcc.1 distcc-3.3.3/man/distcc.1 --- distcc-3.3.2/man/distcc.1 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/man/distcc.1 2019-08-14 19:07:05.000000000 +0000 @@ -491,7 +491,7 @@ force the machine to swap, which reduces performance over just running the jobs in sequence without swapping. Getting the number of parallel preprocessors just right allows you to use larger parallel factors with make, since the local machine -now has some machanism for measuring local resource usage. +now has some mechanism for measuring local resource usage. .PP Finally there is the host entry .PP @@ -516,7 +516,7 @@ OLDSTYLE_TCP_HOST = HOSTID[/LIMIT][:PORT][OPTIONS] HOSTID = HOSTNAME | IPV4 | IPV6 OPTIONS = ,OPTION[OPTIONS] - OPTION = lzo | cpp | auth + OPTION = lzo | cpp | auth[=AUTH_NAME] GLOBAL_OPTION = --randomize ZEROCONF = +zeroconf .fi @@ -577,6 +577,12 @@ .B ,auth Enables GSSAPI-based mutual authentication for this host. .TP +.B AUTH_NAME +The "canonical" name to use for the service principal name instead +of HOSTNAME (or its corresponding fqdn). This option is useful in case of +accessing an authenticated server via ssh port forwarding, in which case +the HOSTNAME is 127.0.0.1. +.TP .B --randomize Randomize the order of the host list before execution. .TP @@ -985,4 +991,4 @@ \fBdistccd\fR(1), \fBpump\fR(1), \fBinclude_server\fR(1), \fBgcc\fR(1), \fBmake\fR(1), and \fBccache\fR(1). .I http://code.google.com/p/distcc/ -.I http://ccache.samba.org/ +.I https://ccache.dev/ diff -Nru distcc-3.3.2/man/distccmon-text.1 distcc-3.3.3/man/distccmon-text.1 --- distcc-3.3.2/man/distccmon-text.1 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/man/distccmon-text.1 2019-08-14 19:07:05.000000000 +0000 @@ -55,4 +55,4 @@ .LP d distccd(1), ccache(1), gcc(1), make(1) http://code.google.com/p/distcc/ -http://ccache.samba.org/ +https://ccache.dev/ diff -Nru distcc-3.3.2/man/include_server.1 distcc-3.3.3/man/include_server.1 --- distcc-3.3.2/man/include_server.1 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/man/include_server.1 2019-08-14 19:07:05.000000000 +0000 @@ -53,7 +53,7 @@ other powers of two: see include_server/basics.py. .TP .B -e, --email -Send email to 'distcc-pump-errors' or if defined, the value of enviroment +Send email to 'distcc-pump-errors' or if defined, the value of environment variable DISTCC_EMAILLOG_WHOM_TO_BLAME, when include server gets in trouble. The default is to not send email. .TP @@ -111,7 +111,7 @@ .TP .B --no_force_dirs Do not force the creation of all directories used -in an include path. May improve peformance for +in an include path. May improve performance for some cases, but will break builds which use include structures like "" without including other files in foo/. @@ -303,4 +303,4 @@ .SH "SEE ALSO" \fBdistcc\fR(1), \fBdistccd\fR(1), \fBinclude_server\fR(1), and \fBgcc\fR(1). -http://code.google.com/p/distcc/ http://ccache.samba.org/ +http://code.google.com/p/distcc/ https://ccache.dev/ diff -Nru distcc-3.3.2/popt/popt.c distcc-3.3.3/popt/popt.c --- distcc-3.3.2/popt/popt.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/popt/popt.c 2019-08-14 19:07:05.000000000 +0000 @@ -591,7 +591,7 @@ *te = '\0'; t = realloc(t, tn); te = t + strlen(t); - strncpy(te, a, alen); te += alen; + memcpy(te, a, alen); te += alen; continue; /*@notreached@*/ /*@switchbreak@*/ break; default: diff -Nru distcc-3.3.2/popt/popt.h distcc-3.3.3/popt/popt.h --- distcc-3.3.2/popt/popt.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/popt/popt.h 2019-08-14 19:07:05.000000000 +0000 @@ -83,7 +83,7 @@ #define POPT_ERROR_NOARG -10 /*!< missing argument */ #define POPT_ERROR_BADOPT -11 /*!< unknown option */ #define POPT_ERROR_OPTSTOODEEP -13 /*!< aliases nested too deeply */ -#define POPT_ERROR_BADQUOTE -15 /*!< error in paramter quoting */ +#define POPT_ERROR_BADQUOTE -15 /*!< error in parameter quoting */ #define POPT_ERROR_ERRNO -16 /*!< errno set, use strerror(errno) */ #define POPT_ERROR_BADNUMBER -17 /*!< invalid numeric value */ #define POPT_ERROR_OVERFLOW -18 /*!< number too large or too small */ @@ -456,7 +456,7 @@ /** \ingroup popt * Print detailed description of options. * @param con context - * @param fp ouput file handle + * @param fp output file handle * @param flags (unused) */ void poptPrintHelp(poptContext con, FILE * fp, /*@unused@*/ int flags) @@ -466,7 +466,7 @@ /** \ingroup popt * Print terse description of options. * @param con context - * @param fp ouput file handle + * @param fp output file handle * @param flags (unused) */ void poptPrintUsage(poptContext con, FILE * fp, /*@unused@*/ int flags) diff -Nru distcc-3.3.2/popt/popthelp.c distcc-3.3.3/popt/popthelp.c --- distcc-3.3.2/popt/popthelp.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/popt/popthelp.c 2019-08-14 19:07:05.000000000 +0000 @@ -332,7 +332,7 @@ /*@-boundsread@*/ while (helpLength > lineLength) { const char * ch; - char format[16]; + char format[30]; ch = help + lineLength - 1; while (ch > help && !isspace(*ch)) ch--; diff -Nru distcc-3.3.2/pump.in distcc-3.3.3/pump.in --- distcc-3.3.2/pump.in 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/pump.in 2019-08-14 19:07:05.000000000 +0000 @@ -96,7 +96,7 @@ the location. If this location is the build directory, then Python - sources are retrived from the source directory. + sources are retrieved from the source directory. DISTCC_POTENTIAL_HOSTS The distcc servers that will be queried by lsdistcc in order to produce a value for DISTCC_HOSTS. diff -Nru distcc-3.3.2/README.md distcc-3.3.3/README.md --- distcc-3.3.2/README.md 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/README.md 2019-08-14 19:07:05.000000000 +0000 @@ -3,7 +3,7 @@ by Martin Pool -Current Documents: https://cdn.rawgit.com/distcc/distcc/9a09372bd3f420cdd7021e52eda14fa536a3c10e/doc/web/index.html +Current Documents: https://distcc.github.io/ Formally http://distcc.org/ "pump" functionality added by diff -Nru distcc-3.3.2/README.packaging distcc-3.3.3/README.packaging --- distcc-3.3.2/README.packaging 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/README.packaging 2019-08-14 19:07:05.000000000 +0000 @@ -63,7 +63,7 @@ 'i386-redhat-linux-cc-3.2.2'). This makes it much more likely that people will be able to plug-and-go for cross-architecture or cross-OS builds. It's good to name even native compilers this way - so that they can participate in heterogenous builds. If you don't + so that they can participate in heterogeneous builds. If you don't maintain the compiler packages for your OS, please talk to the person who does. diff -Nru distcc-3.3.2/src/arg.c distcc-3.3.3/src/arg.c --- distcc-3.3.2/src/arg.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/arg.c 2019-08-14 19:07:05.000000000 +0000 @@ -41,7 +41,7 @@ * * We need to distinguish the two by working out whether the first argument * "looks like" a compiler name or not. I think the two cases in which we - * should assume it's implicit are "distcc -c hello.c" (starts with a hypen), + * should assume it's implicit are "distcc -c hello.c" (starts with a hyphen), * and "distcc hello.c" (starts with a source filename.) * * In the case of implicit compilation "distcc --help" will always give you @@ -206,8 +206,12 @@ seen_opt_s = 1; } else if (!strcmp(a, "-fprofile-arcs") || !strcmp(a, "-ftest-coverage") - || !strcmp(a, "--coverage")) { - rs_log_info("compiler will emit profile info; must be local"); + || !strcmp(a, "--coverage") + || !strncmp(a, "-fprofile-generate", 18) /* it also has an -fprofile-generate= form */ + || !strncmp(a, "-fprofile-use", 13) + || !strncmp(a, "-fauto-profile", 14) + || !strcmp(a, "-fprofile-correction")) { + rs_log_info("compiler will emit/use profile info; must be local"); return EXIT_DISTCC_FAILED; } else if (!strcmp(a, "-frepo")) { rs_log_info("compiler will emit .rpo files; must be local"); diff -Nru distcc-3.3.2/src/argutil.c distcc-3.3.3/src/argutil.c --- distcc-3.3.2/src/argutil.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/argutil.c 2019-08-14 19:07:05.000000000 +0000 @@ -95,7 +95,7 @@ int dcc_copy_argv(char **from, char ***out, int delta) { char **b; - int l, i; + int l, i, k; l = dcc_argv_len(from); b = malloc((l+1+delta) * (sizeof from[0])); @@ -106,6 +106,9 @@ for (i = 0; i < l; i++) { if ((b[i] = strdup(from[i])) == NULL) { rs_log_error("failed to duplicate element %d", i); + for(k = 0; k < i; k++) + free(b[k]); + free(b); return EXIT_OUT_OF_MEMORY; } } diff -Nru distcc-3.3.2/src/auth_distcc.c distcc-3.3.3/src/auth_distcc.c --- distcc-3.3.2/src/auth_distcc.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/auth_distcc.c 2019-08-14 19:07:05.000000000 +0000 @@ -32,10 +32,12 @@ #include "auth.h" #include "distcc.h" #include "exitcode.h" +#include "hosts.h" #include "netutil.h" #include "trace.h" -static int dcc_gssapi_establish_secure_context(int to_net_sd, +static int dcc_gssapi_establish_secure_context(const struct dcc_hostdef *host, + int to_net_sd, int from_net_sd, OM_uint32 req_flags, OM_uint32 *ret_flags); @@ -58,14 +60,16 @@ * * Returns 0 on success, otherwise error. */ -int dcc_gssapi_perform_requested_security(int to_net_sd, +int dcc_gssapi_perform_requested_security(const struct dcc_hostdef *host, + int to_net_sd, int from_net_sd) { int ret; OM_uint32 req_flags, ret_flags; req_flags = GSS_C_MUTUAL_FLAG | GSS_C_REPLAY_FLAG | GSS_C_SEQUENCE_FLAG; - if ((ret = dcc_gssapi_establish_secure_context(to_net_sd, + if ((ret = dcc_gssapi_establish_secure_context(host, + to_net_sd, from_net_sd, req_flags, &ret_flags)) != 0) { @@ -108,7 +112,8 @@ * * Returns 0 on success, otherwise error. */ -static int dcc_gssapi_establish_secure_context(int to_net_sd, +static int dcc_gssapi_establish_secure_context(const struct dcc_hostdef *host, + int to_net_sd, int from_net_sd, OM_uint32 req_flags, OM_uint32 *ret_flags) { @@ -126,40 +131,37 @@ struct hostent *hp; struct sockaddr_in addr; - addr_len = sizeof(addr); + if (!host->auth_name) { + addr_len = sizeof(addr); - if ((ret = getpeername(to_net_sd, (struct sockaddr *)&addr, &addr_len)) != 0) { - rs_log_error("Failed to look up peer address using socket \"%d\": %s.", - to_net_sd, - hstrerror(h_errno)); - return EXIT_CONNECT_FAILED; - } + if ((ret = getpeername(to_net_sd, (struct sockaddr *)&addr, &addr_len)) != 0) { + rs_log_error("Failed to look up peer address using socket \"%d\": %s.", + to_net_sd, + hstrerror(h_errno)); + return EXIT_CONNECT_FAILED; + } - rs_log_info("Successfully looked up IP address %s using socket %d.", + rs_log_info("Successfully looked up IP address %s using socket %d.", inet_ntoa(addr.sin_addr), to_net_sd); - if ((hp = gethostbyaddr((char *) &addr.sin_addr, - sizeof(addr.sin_addr), - AF_INET)) == NULL) { - rs_log_error("Failed to look up host by address \"%s\": %s.", - inet_ntoa(addr.sin_addr), - hstrerror(h_errno)); - return EXIT_CONNECT_FAILED; - } + if ((hp = gethostbyaddr((char *) &addr.sin_addr, + sizeof(addr.sin_addr), + AF_INET)) == NULL) { + rs_log_error("Failed to look up host by address \"%s\": %s.", + inet_ntoa(addr.sin_addr), + hstrerror(h_errno)); + return EXIT_CONNECT_FAILED; + } - rs_log_info("Successfully looked up host %s using IP address %s.", + rs_log_info("Successfully looked up host %s using IP address %s.", hp->h_name, inet_ntoa(addr.sin_addr)); - - if ((full_name = malloc(strlen(hp->h_name) + 1)) == NULL) { - rs_log_error("malloc failed : %ld bytes: out of memory.", - (long) (strlen(hp->h_name) + 1)); - return EXIT_OUT_OF_MEMORY; + full_name = hp->h_name; + } else { + full_name = host->auth_name; } - strcpy(full_name, hp->h_name); - if ((princ_env_val = getenv("DISTCC_PRINCIPAL"))) { if (asprintf(&ext_princ_name, "%s@%s", princ_env_val, full_name) < 0) { rs_log_error("Failed to allocate memory for asprintf."); @@ -176,7 +178,6 @@ name_type = GSS_C_NT_USER_NAME; } - free(full_name); name_buffer.value = ext_princ_name; name_buffer.length = strlen(ext_princ_name); diff -Nru distcc-3.3.2/src/auth.h distcc-3.3.3/src/auth.h --- distcc-3.3.2/src/auth.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/auth.h 2019-08-14 19:07:05.000000000 +0000 @@ -27,12 +27,15 @@ /* Notification of server access denied. */ #define NO_ACCESS 'n' +struct dcc_hostdef; + int dcc_gssapi_acquire_credentials(void); void dcc_gssapi_release_credentials(void); int dcc_gssapi_obtain_list(int mode); void dcc_gssapi_free_list(void); int dcc_gssapi_check_client(int to_net_fd, int from_net_fd); -int dcc_gssapi_perform_requested_security(int to_net_fd, +int dcc_gssapi_perform_requested_security(const struct dcc_hostdef *host, + int to_net_fd, int from_net_fd); void dcc_gssapi_status_to_log(OM_uint32 status_code, int status_type); void dcc_gssapi_cleanup(gss_buffer_desc *input_tok, diff -Nru distcc-3.3.2/src/climasq.c distcc-3.3.3/src/climasq.c --- distcc-3.3.2/src/climasq.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/climasq.c 2019-08-14 19:07:05.000000000 +0000 @@ -117,8 +117,10 @@ if (*p != '\0') { int ret = dcc_set_path(p); - if (ret) + if (ret) { + free(buf); return ret; + } *did_masquerade = 1; } else { diff -Nru distcc-3.3.2/src/compile.c distcc-3.3.3/src/compile.c --- distcc-3.3.2/src/compile.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/compile.c 2019-08-14 19:07:05.000000000 +0000 @@ -491,7 +491,12 @@ if ((st.st_mode & S_IFMT) == S_IFLNK) { /* this is a Debian thing. Fedora just has /usr/bin/cc -> gcc */ if (strcmp(linkbuf, cpp ? "/etc/alternatives/c++" : "/etc/alternatives/cc") == 0) { - ssz = readlinkat(dir, linkbuf, linkbuf, sizeof(linkbuf) - 1); + char m[MAXPATHLEN + 1]; + + m[0] = '\0'; + strcpy(m, linkbuf); + + ssz = readlinkat(dir, m, linkbuf, sizeof(linkbuf) - 1); linkbuf[ssz] = '\0'; } } @@ -568,7 +573,7 @@ return -ENOMEM; if ((t = strstr(target_with_vendor, "-pc-"))) { - strncpy(newcmd, target_with_vendor, t - target_with_vendor); + memcpy(newcmd, target_with_vendor, t - target_with_vendor); strcat(newcmd, t + strlen("-pc")); } else strcpy(newcmd, target_with_vendor); @@ -589,7 +594,7 @@ t = path + strlen(path); pathlen = t - path; if (*path == '\0') - return -ENOENT; + break; strncpy(binname, path, pathlen); binname[pathlen] = '\0'; strcat(binname, "/"); @@ -604,6 +609,7 @@ argv[0] = newcmd; return 0; } while ((path += pathlen + 1)); + free(newcmd); return -ENOENT; } @@ -752,7 +758,7 @@ /* It's unfortunate that the variable that controls that is in the * "host" datastructure, even though in this case it's the client * that fails to support it, but "host" is what gets passed - * around in the client code. We are, in essense, throwing away + * around in the client code. We are, in essence, throwing away * the host's capability to do cpp, so if this code was to execute * again (it won't, not in the same process) we wouldn't know if * the server supports it or not. @@ -858,7 +864,7 @@ (Currently, we send email to an appropriate email address). */ if (getenv("DISTCC_SKIP_LOCAL_RETRY")) { - /* dont retry locally. We'll treat the remote failure as + /* don't retry locally. We'll treat the remote failure as if it was a local one. But if we can't get the failures then we need to retry regardless. */ diff -Nru distcc-3.3.2/src/compress.c distcc-3.3.3/src/compress.c --- distcc-3.3.2/src/compress.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/compress.c 2019-08-14 19:07:05.000000000 +0000 @@ -118,7 +118,7 @@ /** * Send LZO-compressed bulk data. * - * The most straighforward method for miniLZO is to just send everything in + * The most straightforward method for miniLZO is to just send everything in * one big chunk. So we just read the whole input into a buffer, build the * output in a buffer, and send it once its complete. **/ diff -Nru distcc-3.3.2/src/daemon.c distcc-3.3.3/src/daemon.c --- distcc-3.3.2/src/daemon.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/daemon.c 2019-08-14 19:07:05.000000000 +0000 @@ -166,7 +166,7 @@ rs_log_crit(LIBDIR "/distcc not found. %s", warn); dcc_exit(EXIT_COMPILER_MISSING); } - if (!readdir(e) && !readdir(d)) { + if ((!e || !readdir(e)) && (!d || !readdir(d))) { rs_log_crit(LIBDIR "/distcc empty. %s", warn); dcc_exit(EXIT_COMPILER_MISSING); } diff -Nru distcc-3.3.2/src/distcc.h distcc-3.3.3/src/distcc.h --- distcc-3.3.2/src/distcc.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/distcc.h 2019-08-14 19:07:05.000000000 +0000 @@ -87,13 +87,13 @@ enum dcc_compress { - /* wierd values to catch errors */ + /* weird values to catch errors */ DCC_COMPRESS_NONE = 69, DCC_COMPRESS_LZO1X }; enum dcc_cpp_where { - /* wierd values to catch errors */ + /* weird values to catch errors */ DCC_CPP_ON_CLIENT = 42, DCC_CPP_ON_SERVER }; diff -Nru distcc-3.3.2/src/dotd.c distcc-3.3.3/src/dotd.c --- distcc-3.3.2/src/dotd.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/dotd.c 2019-08-14 19:07:05.000000000 +0000 @@ -150,7 +150,7 @@ /* Go through arguments (in @p argv), and relevant environment variables, and * find out where the dependencies output should go. Return that location in a * newly allocated string in @p dotd_fname. @p needs_dotd is set to true if the - * compilation command line and environent imply that a .d file must be + * compilation command line and environment imply that a .d file must be * produced. @p sets_dotd_target is set to true if there is a -MQ or -MT * option. This is to be used on the client, so that the client knows where to * put the .d file it gets from the server. @p dotd_target is set only if diff -Nru distcc-3.3.2/src/hosts.c distcc-3.3.3/src/hosts.c --- distcc-3.3.2/src/hosts.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/hosts.c 2019-08-14 19:07:05.000000000 +0000 @@ -207,7 +207,7 @@ * *psrc is the current parse cursor; it is advanced over what is read. * * If a multiplier is present, *psrc points to a substring starting with '/'. - * The host defintion is updated to the numeric value following. Otherwise + * The host definition is updated to the numeric value following. Otherwise * the hostdef is unchanged. **/ static int dcc_parse_multiplier(const char **psrc, struct dcc_hostdef *hostdef) @@ -245,6 +245,7 @@ host->cpp_where = DCC_CPP_ON_CLIENT; #ifdef HAVE_GSSAPI host->authenticate = 0; + host->auth_name = NULL; #endif while (p[0] == ',') { @@ -266,6 +267,17 @@ rs_trace("got GSSAPI option"); host->authenticate = 1; p += 4; + if (p[0] == '=') { + p++; + int ret; + if ((ret = dcc_dup_part(&p, &host->auth_name, "/: \t\n\r\f,"))) + return ret; + + if (host->auth_name) { + rs_trace("using \"%s\" server name instead of fqdn " + "lookup for GSS-API auth", host->auth_name); + } + } #endif } else { rs_log_error("unrecognized option in host specification: %s", diff -Nru distcc-3.3.2/src/hosts.h distcc-3.3.3/src/hosts.h --- distcc-3.3.2/src/hosts.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/hosts.h 2019-08-14 19:07:05.000000000 +0000 @@ -60,8 +60,9 @@ enum dcc_cpp_where cpp_where; #ifdef HAVE_GSSAPI - /* Are we autenticating with this host? */ + /* Are we authenticating with this host? */ int authenticate; + char * auth_name; #endif struct dcc_hostdef *next; diff -Nru distcc-3.3.2/src/lock.c distcc-3.3.3/src/lock.c --- distcc-3.3.2/src/lock.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/lock.c 2019-08-14 19:07:05.000000000 +0000 @@ -23,7 +23,7 @@ /* Power is nothing without control - * -- Pirelli tyre advertisment. */ + * -- Pirelli tyre advertisement. */ /** @@ -83,7 +83,7 @@ * - Each distcc process should hold no more than two locks at a time; * one local lock, and one remote lock. * - * - When acquring more than one lock, a strict lock ordering discipline + * - When acquiring more than one lock, a strict lock ordering discipline * must be observed: the remote lock must be acquired first, before the * local lock; and conversely the local lock must be released first, * before the remote lock. @@ -103,6 +103,7 @@ DCC_CPP_ON_CLIENT, /* where to cpp (ignored) */ #ifdef HAVE_GSSAPI 0, /* Authentication? */ + NULL, /* Authentication name */ #endif NULL }; @@ -123,6 +124,7 @@ DCC_CPP_ON_CLIENT, /* where to cpp (ignored) */ #ifdef HAVE_GSSAPI 0, /* Authentication? */ + NULL, /* Authentication name */ #endif NULL }; @@ -250,7 +252,7 @@ * in user home directories. */ *plockfd = open(fname, O_WRONLY|O_CREAT, 0666); if (*plockfd == -1 && errno != EEXIST) { - rs_log_error("failed to creat %s: %s", fname, strerror(errno)); + rs_log_error("failed to create %s: %s", fname, strerror(errno)); return EXIT_IO_ERROR; } @@ -262,7 +264,7 @@ * Lock a server slot, in either blocking or nonblocking mode. * * In blocking mode, this function will not return until either the lock has - * been acquired, or an error occured. In nonblocking mode, it will instead + * been acquired, or an error occurred. In nonblocking mode, it will instead * return EXIT_BUSY if some other process has this slot locked. * * @param slot 0-based index of available slots on this host. diff -Nru distcc-3.3.2/src/mon.c distcc-3.3.3/src/mon.c --- distcc-3.3.2/src/mon.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/mon.c 2019-08-14 19:07:05.000000000 +0000 @@ -358,7 +358,7 @@ && pthis) { /* We can succeed without getting a new entry back, but it * turns out that this time we did get one. So insert it - * intot he right point on the list. */ + * into the right point on the list. */ dcc_mon_insert_sorted(p_list, pthis); } } diff -Nru distcc-3.3.2/src/mon-gnome.c distcc-3.3.3/src/mon-gnome.c --- distcc-3.3.2/src/mon-gnome.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/mon-gnome.c 2019-08-14 19:07:05.000000000 +0000 @@ -261,7 +261,7 @@ * nothing now. * * Every time through, we update each table row exactly once, whether - * that is adding new state, settting it back to idle, or inserting + * that is adding new state, setting it back to idle, or inserting * it. In particular, on each pass we add one value to the start of * every state history. **/ diff -Nru distcc-3.3.2/src/mon.h distcc-3.3.3/src/mon.h --- distcc-3.3.2/src/mon.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/mon.h 2019-08-14 19:07:05.000000000 +0000 @@ -198,7 +198,7 @@ /** * Read the list of running processes for this user. * - * @param ppl On return, recieves a pointer to the start of a list of + * @param ppl On return, receives a pointer to the start of a list of * status elements, representing the running processes. *ppl will be * NULL if there are no processes running. * diff -Nru distcc-3.3.2/src/prefork.c distcc-3.3.3/src/prefork.c --- distcc-3.3.2/src/prefork.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/prefork.c 2019-08-14 19:07:05.000000000 +0000 @@ -70,7 +70,7 @@ int dcc_preforking_parent(int listen_fd) { int ret; - /* use sigaction instead of signal() because we need persistant handler, not oneshot */ + /* use sigaction instead of signal() because we need persistent handler, not oneshot */ struct sigaction act_child; memset(&act_child, 0, sizeof act_child); act_child.sa_handler = dcc_sigchld_handler; diff -Nru distcc-3.3.2/src/remote.c distcc-3.3.3/src/remote.c --- distcc-3.3.2/src/remote.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/remote.c 2019-08-14 19:07:05.000000000 +0000 @@ -231,7 +231,7 @@ if(host->authenticate) { rs_log_info("Performing authentication."); - if ((ret = dcc_gssapi_perform_requested_security(to_net_fd, from_net_fd)) != 0) { + if ((ret = dcc_gssapi_perform_requested_security(host, to_net_fd, from_net_fd)) != 0) { rs_log_crit("Failed to perform authentication."); goto out; } diff -Nru distcc-3.3.2/src/rpc.c distcc-3.3.3/src/rpc.c --- distcc-3.3.2/src/rpc.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/rpc.c 2019-08-14 19:07:05.000000000 +0000 @@ -218,7 +218,7 @@ return ret; } - strncpy(token, buf, 4); + memcpy(token, buf, 4); token[4] = '\0'; buf[12] = '\0'; /* terminate */ diff -Nru distcc-3.3.2/src/serve.c distcc-3.3.3/src/serve.c --- distcc-3.3.2/src/serve.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/serve.c 2019-08-14 19:07:05.000000000 +0000 @@ -363,7 +363,7 @@ * * Before this it was possible to execute arbitrary command after connecting * to distcc, which is quite a security risk when combined with any local root - * privledge escalation exploit. See CVE 2004-2687 + * privilege escalation exploit. See CVE 2004-2687 * * https://nvd.nist.gov/vuln/detail/CVE-2004-2687 * https://github.com/distcc/distcc/issues/155 @@ -402,8 +402,14 @@ } if (faccessat(dirfd, compiler_name, X_OK, 0) < 0) { - rs_log_crit("%s not in %s whitelist.", compiler_name, LIBDIR "/distcc"); - return EXIT_BAD_ARGUMENTS; /* ENOENT, EACCESS, etc */ + char *compiler_path = NULL; + if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) && compiler_path) { + if (access(compiler_path, X_OK) < 0) { + rs_log_crit("%s not in %s or %s whitelist.", compiler_name, LIBDIR "/distcc", "/usr/lib/distcc"); + return EXIT_BAD_ARGUMENTS; /* ENOENT, EACCESS, etc */ + } + free(compiler_path); + } } rs_trace("%s in" LIBDIR "/distcc whitelist", compiler_name); @@ -414,10 +420,11 @@ int ret = 0; if (asprintf(&compiler_path, "%s/distcc/%s", LIBDIR, compiler_name) && compiler_path) { if (access(compiler_path, X_OK) < 0) { + free(compiler_path); /* check /usr/lib/distcc too */ if (asprintf(&compiler_path, "/usr/lib/distcc/%s", compiler_name) && compiler_path) { if (access(compiler_path, X_OK) < 0) { - rs_log_crit("%s not in %s whitelist.", compiler_name, LIBDIR "/distcc"); + rs_log_crit("%s not in %s or %s whitelist.", compiler_name, LIBDIR "/distcc", "/usr/lib/distcc"); ret = EXIT_BAD_ARGUMENTS; /* ENOENT, EACCESS, etc */ } } @@ -762,8 +769,10 @@ int i; for (i = 0; (a = argv[i]); i++) if (strncmp(a, "-fplugin=", strlen("-fplugin=")) == 0 || - strncmp(a, "-specs=", strlen("-specs=")) == 0) + strncmp(a, "-specs=", strlen("-specs=")) == 0) { + rs_log_warning("-fplugin= and/or -specs= passed, which are insecure and not supported."); goto out_cleanup; + } if ((compile_ret = dcc_spawn_child(argv, &cc_pid, "/dev/null", out_fname, err_fname)) diff -Nru distcc-3.3.2/src/snprintf.c distcc-3.3.3/src/snprintf.c --- distcc-3.3.2/src/snprintf.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/snprintf.c 2019-08-14 19:07:05.000000000 +0000 @@ -35,7 +35,7 @@ * probably requires libm on most operating systems. Don't yet * support the exponent (e,E) and sigfig (g,G). Also, fmtint() * was pretty badly broken, it just wasn't being exercised in ways - * which showed it, so that's been fixed. Also, formated the code + * which showed it, so that's been fixed. Also, formatted the code * to mutt conventions, and removed dead code left over from the * original. Also, there is now a builtin-test, just compile with: * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm diff -Nru distcc-3.3.2/src/srvnet.c distcc-3.3.3/src/srvnet.c --- distcc-3.3.2/src/srvnet.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/srvnet.c 2019-08-14 19:07:05.000000000 +0000 @@ -102,7 +102,8 @@ rs_log_info("listening on %s", sa_buf ? sa_buf : "UNKNOWN"); free(sa_buf); - if (listen(fd, 10)) { + /* This should be at least 2X the number of threads, and AMD EPYX sells 64-thread CPUs (2019) */ + if (listen(fd, 1024)) { rs_log_error("listen failed: %s", strerror(errno)); close(fd); return EXIT_BIND_FAILED; diff -Nru distcc-3.3.2/src/srvrpc.c distcc-3.3.3/src/srvrpc.c --- distcc-3.3.2/src/srvrpc.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/srvrpc.c 2019-08-14 19:07:05.000000000 +0000 @@ -170,7 +170,7 @@ /* We should explain what happened here, but we have already read * a few more bytes. */ - strncpy(buf, token, 4); + memcpy(buf, token, 4); /* TODO(manos): this is probably not kosher */ memcpy(&buf[4], &link_or_file_len, sizeof(link_or_file_len)); dcc_explain_mismatch(buf, 12, in_fd); diff -Nru distcc-3.3.2/src/stats.c distcc-3.3.3/src/stats.c --- distcc-3.3.2/src/stats.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/stats.c 2019-08-14 19:07:05.000000000 +0000 @@ -133,8 +133,8 @@ memcpy(&(sd.start), &start, sizeof(struct timeval)); memcpy(&(sd.stop), &stop, sizeof(struct timeval)); sd.time = time_usec; - strncpy(sd.filename, filename, MAX_FILENAME_LEN); - strncpy(sd.compiler, compiler, MAX_FILENAME_LEN); + strncpy(sd.filename, filename, MAX_FILENAME_LEN - 1); + strncpy(sd.compiler, compiler, MAX_FILENAME_LEN - 1); dcc_writex(dcc_statspipe[1], &sd, sizeof(sd)); } } @@ -178,7 +178,7 @@ free(curr_sd); curr_sd = prev_sd->next; } else { - /* we didn't delete anyting. move forward by one */ + /* we didn't delete anything. move forward by one */ prev_sd = curr_sd; curr_sd = curr_sd->next; } diff -Nru distcc-3.3.2/src/stringmap.c distcc-3.3.3/src/stringmap.c --- distcc-3.3.2/src/stringmap.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/stringmap.c 2019-08-14 19:07:05.000000000 +0000 @@ -43,14 +43,20 @@ */ stringmap_t *stringmap_load(const char *filename, int numFinalWordsToMatch) { - stringmap_t *result = calloc(1, sizeof(*result)); - FILE *fp = fopen(filename, "r"); + stringmap_t *result; + FILE *fp; char buf[2*PATH_MAX]; int n; + result = calloc(1, sizeof(*result)); + if (!result) + return NULL; result->numFinalWordsToMatch = numFinalWordsToMatch; - if (!fp) + fp = fopen(filename, "r"); + if (!fp) { + free(result); return NULL; + } n=0; while (fgets(buf, sizeof(buf), fp)) n++; diff -Nru distcc-3.3.2/src/strip.c distcc-3.3.3/src/strip.c --- distcc-3.3.2/src/strip.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/strip.c 2019-08-14 19:07:05.000000000 +0000 @@ -48,7 +48,7 @@ * remotely, it is possible that omitting these options will make * failure more obvious and avoid false success. * - * Giving -L on a compile-only command line is a bit wierd, but it is + * Giving -L on a compile-only command line is a bit weird, but it is * observed to happen in Makefiles that are not strict about CFLAGS vs * LDFLAGS, etc. * diff -Nru distcc-3.3.2/src/trace.c distcc-3.3.3/src/trace.c --- distcc-3.3.2/src/trace.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/trace.c 2019-08-14 19:07:05.000000000 +0000 @@ -433,9 +433,10 @@ } -static char job_summary[4096]; +static char job_summary[4096*4]; void dcc_job_summary_clear(void) { job_summary[0] = 0; + job_summary[sizeof(job_summary) - 1] = '\0'; } void dcc_job_summary(void) { @@ -443,5 +444,7 @@ } void dcc_job_summary_append(const char *s) { - strncat(job_summary, s, 4096-strlen(job_summary)); + int64_t len = (4096 * 4 - 1) - strlen(job_summary); + if (len > 0) + strncat(job_summary, s, len); } diff -Nru distcc-3.3.2/src/trace.h distcc-3.3.3/src/trace.h --- distcc-3.3.2/src/trace.h 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/trace.h 2019-08-14 19:07:05.000000000 +0000 @@ -128,7 +128,7 @@ void rs_logger_syslog(int level, const char *fn, char const *fmt, va_list va, void *, int); -/** Check whether the library was compiled with debugging trace suport. */ +/** Check whether the library was compiled with debugging trace support. */ int rs_supports_trace(void); void rs_log0(int level, char const *fn, char const *fmt, ...) diff -Nru distcc-3.3.2/src/util.c distcc-3.3.3/src/util.c --- distcc-3.3.2/src/util.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/util.c 2019-08-14 19:07:05.000000000 +0000 @@ -39,6 +39,8 @@ #include #include +#include + #ifdef HAVE_SYS_RESOURCE_H #include #endif @@ -210,7 +212,8 @@ return -1; } - strncpy(host_name, h->h_name, sizeof(host_name)); + strncpy(host_name, h->h_name, sizeof(host_name) - 1); + host_name[sizeof(host_name) - 1] = '\0'; *domain_name = strchr(h->h_name, '.'); #else /* cheaper */ @@ -262,7 +265,8 @@ hstrerror(h_errno)); return -1; } - strncpy(host_name, h->h_name, sizeof(host_name)); + strncpy(host_name, h->h_name, sizeof(host_name) - 1); + host_name[sizeof(host_name) - 1] = '\0'; } envh = host_name; } @@ -578,20 +582,25 @@ int dcc_which(const char *command, char **out) { - char *loc = NULL, *path, *t; + char *loc = NULL, *_loc, *path, *t; int ret; path = getenv("PATH"); if (!path) return -ENOENT; do { + if (strstr(path, "distcc")) + continue; /* emulate strchrnul() */ t = strchr(path, ':'); if (!t) t = path + strlen(path); - loc = realloc(loc, t - path + 1 + strlen(command) + 1); - if (!loc) + _loc = realloc(loc, t - path + 1 + strlen(command) + 1); + if (!_loc) { + free(loc); return -ENOMEM; + } + loc = _loc; strncpy(loc, path, t - path); loc[t - path] = '\0'; strcat(loc, "/"); @@ -744,7 +753,7 @@ *n_writes += writes; } else { #if 0 - /* individual parition stats */ + /* individual partition stats */ retval = fscanf(f, " %*d %d %*d %d", &reads, &writes); if (retval == EOF || retval != 2) break; @@ -997,7 +1006,7 @@ if (getsockname(fd, &sockaddr.sa, &l) < 0) return -errno; - if (l < sizeof(sa_family_t)) + if ((size_t)l < sizeof(sa_family_t)) return -EINVAL; return sockaddr.sa.sa_family == family; diff -Nru distcc-3.3.2/src/where.c distcc-3.3.3/src/where.c --- distcc-3.3.2/src/where.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/where.c 2019-08-14 19:07:05.000000000 +0000 @@ -173,11 +173,15 @@ int ret; while (1) { - for (i_cpu = 0; i_cpu < 50; i_cpu++) { + for (i_cpu = 0; i_cpu < 10000; i_cpu++) { + char i_cpu_is_usable = 0; + for (h = hostlist; h; h = h->next) { if (i_cpu >= h->n_slots) continue; + i_cpu_is_usable = 1; + ret = dcc_lock_host("cpu", h, i_cpu, 0, cpu_lock_fd); if (ret == 0) { @@ -191,6 +195,9 @@ return ret; } } + + if (!i_cpu_is_usable) + break; } dcc_lock_pause(); diff -Nru distcc-3.3.2/src/zeroconf.c distcc-3.3.3/src/zeroconf.c --- distcc-3.3.2/src/zeroconf.c 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/src/zeroconf.c 2019-08-14 19:07:05.000000000 +0000 @@ -52,7 +52,7 @@ /* How long shall the background daemon be idle before i terminates itself? */ #define MAX_IDLE_TIME 20 -/* Maxium size of host file to load */ +/* Maximum size of host file to load */ #define MAX_FILE_SIZE (1024*100) /* General daemon data */ @@ -84,7 +84,7 @@ AvahiServiceResolver *resolver; }; -/* A generic, system independant lock routine, similar to sys_lock, +/* A generic, system independent lock routine, similar to sys_lock, * but more powerful: * rw: if non-zero: r/w lock instead of r/o lock * enable: lock or unlock @@ -503,7 +503,7 @@ /* Iterate the main loop for 5s */ if (avahi_simple_poll_iterate(d.simple_poll, 5000) != 0) { - rs_log_crit("Event loop exited abnormaly.\n"); + rs_log_crit("Event loop exited abnormally.\n"); goto finish; } } diff -Nru distcc-3.3.2/test/testdistcc.py distcc-3.3.3/test/testdistcc.py --- distcc-3.3.2/test/testdistcc.py 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/test/testdistcc.py 2019-08-14 19:07:05.000000000 +0000 @@ -1195,7 +1195,7 @@ def source(self): return """ -#include "sys/types.h" /* Should resolve to /usr/incude/sys/types.h. */ +#include "sys/types.h" /* Should resolve to /usr/include/sys/types.h. */ #include #include "testhdr.h" int main(void) { diff -Nru distcc-3.3.2/TODO distcc-3.3.3/TODO --- distcc-3.3.2/TODO 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/TODO 2019-08-14 19:07:05.000000000 +0000 @@ -19,7 +19,7 @@ State files depend on host byte order and break when DISTCC_DIR is -shared between heterogenous machines. Of course sharing this +shared between heterogeneous machines. Of course sharing this directory is probably a bad idea anyhow. @@ -1049,7 +1049,7 @@ would be good, and probably quite practical. Setting up a list of machines centrally rather than configuring each one sounds more friendly. The most likely design is to use DNS SRV records (RFC2052), or perhaps - multi-RR A records. For exmaple, compile.ozlabs.foo.com would resolve to + multi-RR A records. For example, compile.ozlabs.foo.com would resolve to all relevant machines. Another possibility would be to use SLP, the Service Location Protocol, but that adds a larger dependency and it seems not to be widely deployed. diff -Nru distcc-3.3.2/.travis.yml distcc-3.3.3/.travis.yml --- distcc-3.3.2/.travis.yml 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/.travis.yml 2019-08-14 19:07:05.000000000 +0000 @@ -1,3 +1,10 @@ +notifications: + email: + recipients: + - shawn@git.icu + on_success: change # default: change + on_failure: always # default: always + language: c cache: ccache @@ -30,15 +37,5 @@ compiler: clang dist: trusty - os: osx - osx_image: xcode8.2 - env: - - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9" - - os: osx - osx_image: xcode8.2 - compiler: clang - - os: osx - osx_image: xcode8.3 - compiler: clang - - os: osx osx_image: xcode9 compiler: clang diff -Nru distcc-3.3.2/update-distcc-symlinks.py distcc-3.3.3/update-distcc-symlinks.py --- distcc-3.3.2/update-distcc-symlinks.py 2018-07-27 05:08:29.000000000 +0000 +++ distcc-3.3.3/update-distcc-symlinks.py 2019-08-14 19:07:05.000000000 +0000 @@ -31,17 +31,26 @@ consider_gcc("", "") consider_gcc("c89-", "") consider_gcc("c99-", "") -for gnu_host in os.listdir(gcc_dir): - consider_gcc("%(gnu_host)s-" % vars(), "") - for version in os.listdir(gcc_dir + "/" + gnu_host): - consider_gcc("", "-%(version)s" % vars()) - consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars()) -for gnu_host in os.listdir(gcccross_dir): - consider_gcc("%(gnu_host)s-" % vars(), "") - for version in os.listdir(gcccross_dir + "/" + gnu_host): - consider_gcc("", "-%(version)s" % vars()) - consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars()) - +try: + for gnu_host in os.listdir(gcc_dir): + consider_gcc("%(gnu_host)s-" % vars(), "") + for version in os.listdir(gcc_dir + "/" + gnu_host): + consider_gcc("", "-%(version)s" % vars()) + consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars()) +except FileNotFoundError: + pass +except NotADirectoryError: + pass +try: + for gnu_host in os.listdir(gcccross_dir): + consider_gcc("%(gnu_host)s-" % vars(), "") + for version in os.listdir(gcccross_dir + "/" + gnu_host): + consider_gcc("", "-%(version)s" % vars()) + consider_gcc("%(gnu_host)s-" % vars(), "-%(version)s" % vars()) +except FileNotFoundError: + pass +except NotADirectoryError: + pass consider_clang("") for ent in os.listdir("/usr/lib"):