Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package atftp for openSUSE:Factory checked in at 2021-06-02 22:10:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/atftp (Old) and /work/SRC/openSUSE:Factory/.atftp.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "atftp" Wed Jun 2 22:10:25 2021 rev:40 rq:895482 version:0.7.4 Changes: -------- --- /work/SRC/openSUSE:Factory/atftp/atftp.changes 2021-02-04 20:21:50.378622133 +0100 +++ /work/SRC/openSUSE:Factory/.atftp.new.1898/atftp.changes 2021-06-02 22:10:30.556127635 +0200 @@ -1,0 +2,14 @@ +Tue May 25 23:26:52 UTC 2021 - Ferdinand Thiessen <[email protected]> + +- Update to version 0.7.4 + * fix compile, missing include + * fix compile, add missing defines + * link against libpthread for atftp + * fixed atftp fails to write to /proc/self/fd/1 + * Fix for DoS issue CVE-2020-6097 + * remove inline keyword from definitions + * remove extern inlines + * sys/cdefs usage +- Drop fixed atftp-CVE-2020-6097.patch + +------------------------------------------------------------------- Old: ---- atftp-0.7.2.tar.gz atftp-CVE-2020-6097.patch New: ---- atftp-0.7.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ atftp.spec ++++++ --- /var/tmp/diff_new_pack.625RvR/_old 2021-06-02 22:10:31.144127588 +0200 +++ /var/tmp/diff_new_pack.625RvR/_new 2021-06-02 22:10:31.148127588 +0200 @@ -23,7 +23,7 @@ %endif Name: atftp -Version: 0.7.2 +Version: 0.7.4 Release: 0 Summary: Advanced TFTP Server and Client License: GPL-2.0-or-later @@ -44,8 +44,6 @@ # PATCH-FIX-SUSE update default directory in man (bnc#507011) Patch5: atftp-0.7-default_dir_man.patch Patch6: atftp-drop_privileges_non-daemon.patch -# PATCH-FIX-UPSTREAM bsc#1176437 CVE-2020-6097 Fix for DoS issue -Patch7: atftp-CVE-2020-6097.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: pcre-devel @@ -77,7 +75,6 @@ %patch4 %patch5 %patch6 -p1 -%patch7 -p1 %build autoreconf -fi @@ -86,7 +83,7 @@ make %{?_smp_mflags} %install -make DESTDIR=%{buildroot} install %{?_smp_mflags} +%make_install # SuSE rc install -D -m 0644 %{SOURCE5} %{buildroot}/%{_unitdir}/atftpd.service install -D -m 0644 %{SOURCE6} %{buildroot}/%{_unitdir}/atftpd.socket ++++++ atftp-0.7.2.tar.gz -> atftp-0.7.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/Changelog new/atftp-0.7.4/Changelog --- old/atftp-0.7.2/Changelog 2012-07-31 23:18:20.000000000 +0200 +++ new/atftp-0.7.4/Changelog 2021-02-02 00:59:12.000000000 +0100 @@ -1,4 +1,52 @@ -atftp (0.7.xx) +atftp-0.7.4 +=========== +4f2f95c N - Martin Dummer / test.sh: rework test script +5008879 N - Martin Dummer / rework .gitignore files + + +atftp-0.7.3 +=========== +e1fc418 N - Martin Dummer / Version 0.7.3 (Bugfix Release) +f5c2fcd N - Peter Seiderer / tftp.h/tftpd.h: fix musl compile (missing include) +e7f6fb4 N - Peter Seiderer / argz.h: fix musl compile (add missing defines) +b39ab6b N - Martin Dummer / Makefile.am: link against libpthread for atftp + +68a06c0 N - Martin Dummer / Merge /u/johndemolition/atftp/ branch nvb into master +b763fce N - Martin Dummer / Merge /u/peterkaestle/atftp/ branch master into master +f5a229d N - Martin Dummer / support request #5: atftp fails to write to /proc/self/fd/1 +96409ef N - Peter Kaestle / Fix for DoS issue CVE-2020-6097 +d4eac31 E - Rosen Penev / remove inline keyword from definitions +2834c49 E - Rosen Penev / argz: remove extern inlines +c480581 E - Rosen Penev / argz: remove sys/cdefs usage + + +atftp-0.7.2 +=========== +52b71f0 N - Martin Dummer / test.sh: add large file test to proof blocknumber rollover is working +eda2d3d N - Martin Dummer / Merge branch 'master' of ssh://git.code.sf.net/p/atftp/code +a87ece1 N - Martin Dummer / automake.ac: modernize autoconf file to avoid warning +7e7c933 N - Martin Dummer / add more files to .gitignore +ec13942 N - Martin Dummer / fix error handler stack overflow +f78da6c N - Martin Dummer / fix Concurrency issue denial of service +3b07980 N - Martin Dummer / test/test.sh: fix test for UID != 0 +abed7d2 N - Martin Dummer / fix error handler stack overflow +382f76a N - Martin Dummer / fix Concurrency issue denial of service +cf5a3ef N - Martin Dummer / test/test.sh: fix test for UID != 0 +1bfd65a N - Martin Dummer / import debian code patches +4d0bff1 N - Martin Dummer / import debian localisation files +f9dbb96 N - Martin Dummer / configure.ac: fix hard setting of CFLAGS + +atftp-0.7.1 +=========== + * tftpd.c: exit if chown on pidfile fails + * logger.c: fix fprintf format warning + * logger.c: fix warning: implicit declaration of function + * logger.c: fix fprintf format warning + * logger.c: fix warning: implicit declaration of function + * tftpd.c: fix --user parameter + * atftpd.1: fix typos, add more details for options + * Documentation review for typos, add git instructions + * test/test.sh: restructure head of script * atftpd.c: Fixed a potential DoS bug (introduced by the IPv6 patch) thankfully taken from Debian atftpd-0.7.dfsg-11 * Fix Debian Bug #613582 and #258998 @@ -25,10 +73,6 @@ * Initial Developer + Maintainer "Jean-Pierre Lefebvre" <[email protected]> gave up maintenance, thanks for all the work!!! * New Project home: http://sourceforge.net/projects/atftp/ - - - - ======================================================== debian changelog inserted here for completeness diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/Makefile.am new/atftp-0.7.4/Makefile.am --- old/atftp-0.7.2/Makefile.am 2012-07-22 09:20:32.000000000 +0200 +++ new/atftp-0.7.4/Makefile.am 2021-01-31 23:59:14.000000000 +0100 @@ -28,7 +28,7 @@ tftpd.h tftpd_pcre.h tftpd_mtftp.h bin_PROGRAMS = atftp -atftp_LDADD = $(LIBTERMCAP) $(LIBREADLINE) +atftp_LDADD = $(LIBTERMCAP) $(LIBREADLINE) $(LIBPTHREAD) atftp_SOURCES = tftp.c tftp_io.c logger.c options.c tftp_def.c tftp_file.c \ argz.c tftp_mtftp.c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/Makefile.in new/atftp-0.7.4/Makefile.in --- old/atftp-0.7.2/Makefile.in 2019-04-21 14:46:19.000000000 +0200 +++ new/atftp-0.7.4/Makefile.in 2021-02-02 01:05:16.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -125,7 +125,8 @@ argz.$(OBJEXT) tftp_mtftp.$(OBJEXT) atftp_OBJECTS = $(am_atftp_OBJECTS) am__DEPENDENCIES_1 = -atftp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) +atftp_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) am_atftpd_OBJECTS = tftpd.$(OBJEXT) logger.$(OBJEXT) options.$(OBJEXT) \ stats.$(OBJEXT) tftp_io.$(OBJEXT) tftp_def.$(OBJEXT) \ tftpd_file.$(OBJEXT) tftpd_list.$(OBJEXT) \ @@ -225,8 +226,8 @@ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck -am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ - $(LISP)config.h.in +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. @@ -287,6 +288,8 @@ DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -385,6 +388,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -407,7 +411,7 @@ noinst_HEADERS = argz.h logger.h options.h stats.h tftp.h tftp_def.h tftp_io.h \ tftpd.h tftpd_pcre.h tftpd_mtftp.h -atftp_LDADD = $(LIBTERMCAP) $(LIBREADLINE) +atftp_LDADD = $(LIBTERMCAP) $(LIBREADLINE) $(LIBPTHREAD) atftp_SOURCES = tftp.c tftp_io.c logger.c options.c tftp_def.c tftp_file.c \ argz.c tftp_mtftp.c @@ -884,6 +888,10 @@ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -926,6 +934,8 @@ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -941,7 +951,7 @@ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -1146,7 +1156,7 @@ clean-binPROGRAMS clean-cscope clean-generic \ clean-sbinPROGRAMS cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ - dist-tarZ dist-xz dist-zip distcheck distclean \ + dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/aclocal.m4 new/atftp-0.7.4/aclocal.m4 --- old/atftp-0.7.2/aclocal.m4 2019-04-21 14:46:17.000000000 +0200 +++ new/atftp-0.7.4/aclocal.m4 2021-02-02 01:05:16.000000000 +0100 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -110,7 +110,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -141,7 +141,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -332,7 +332,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -371,7 +371,9 @@ done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -398,7 +400,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -595,7 +597,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -616,7 +618,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -637,7 +639,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -680,7 +682,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -701,12 +703,7 @@ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -721,7 +718,7 @@ # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -748,7 +745,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -777,7 +774,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -824,7 +821,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -843,7 +840,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -924,7 +921,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -984,7 +981,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1012,7 +1009,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1031,7 +1028,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/argz.h new/atftp-0.7.4/argz.h --- old/atftp-0.7.2/argz.h 2011-03-11 07:51:24.000000000 +0100 +++ new/atftp-0.7.4/argz.h 2021-01-31 23:59:14.000000000 +0100 @@ -38,8 +38,6 @@ #ifndef _ARGZ_H #define _ARGZ_H 1 -#include <features.h> - #define __need_error_t #include <errno.h> #include <string.h> /* Need size_t, and strchr is called below. */ @@ -48,20 +46,33 @@ # define __const const #endif -#ifndef __error_t_defined -typedef int error_t; +#ifndef __THROW +# define __THROW #endif +#ifndef __BEGIN_DECLS +# define __BEGIN_DECLS +#endif -__BEGIN_DECLS +#ifndef __END_DECLS +# define __END_DECLS +#endif + +#ifndef __attribute_pure__ +# define __attribute_pure__ +#endif + +#ifndef __error_t_defined +typedef int error_t; +#endif /* Make a '\0' separated arg vector from a unix argv vector, returning it in ARGZ, and the total length in LEN. If a memory allocation error occurs, ENOMEM is returned, otherwise 0. The result can be destroyed using free. */ extern error_t __argz_create (char *__const __argv[], char **__restrict __argz, - size_t *__restrict __len) __THROW; + size_t *__restrict __len); extern error_t argz_create (char *__const __argv[], char **__restrict __argz, - size_t *__restrict __len) __THROW; + size_t *__restrict __len); /* Make a '\0' separated arg vector from a SEP separated list in STRING, returning it in ARGZ, and the total length in LEN. If a @@ -69,65 +80,61 @@ The result can be destroyed using free. */ extern error_t __argz_create_sep (__const char *__restrict __string, int __sep, char **__restrict __argz, - size_t *__restrict __len) __THROW; + size_t *__restrict __len); extern error_t argz_create_sep (__const char *__restrict __string, int __sep, char **__restrict __argz, - size_t *__restrict __len) __THROW; + size_t *__restrict __len); /* Returns the number of strings in ARGZ. */ extern size_t __argz_count (__const char *__argz, size_t __len) - __THROW __attribute_pure__; + __attribute_pure__; extern size_t argz_count (__const char *__argz, size_t __len) - __THROW __attribute_pure__; + __attribute_pure__; /* Puts pointers to each string in ARGZ into ARGV, which must be large enough to hold them all. */ extern void __argz_extract (__const char *__restrict __argz, size_t __len, - char **__restrict __argv) __THROW; + char **__restrict __argv); extern void argz_extract (__const char *__restrict __argz, size_t __len, - char **__restrict __argv) __THROW; + char **__restrict __argv); /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ -extern void __argz_stringify (char *__argz, size_t __len, int __sep) __THROW; -extern void argz_stringify (char *__argz, size_t __len, int __sep) __THROW; +extern void __argz_stringify (char *__argz, size_t __len, int __sep); +extern void argz_stringify (char *__argz, size_t __len, int __sep); /* Append BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN. */ extern error_t __argz_append (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __buf, size_t _buf_len) - __THROW; + __const char *__restrict __buf, size_t _buf_len); extern error_t argz_append (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __buf, size_t __buf_len) - __THROW; + __const char *__restrict __buf, size_t __buf_len); /* Append STR to the argz vector in ARGZ & ARGZ_LEN. */ extern error_t __argz_add (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __str) __THROW; + __const char *__restrict __str); extern error_t argz_add (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __str) __THROW; + __const char *__restrict __str); /* Append SEP separated list in STRING to the argz vector in ARGZ & ARGZ_LEN. */ extern error_t __argz_add_sep (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __string, int __delim) - __THROW; + __const char *__restrict __string, int __delim); extern error_t argz_add_sep (char **__restrict __argz, size_t *__restrict __argz_len, - __const char *__restrict __string, int __delim) - __THROW; + __const char *__restrict __string, int __delim); /* Delete ENTRY from ARGZ & ARGZ_LEN, if it appears there. */ extern void __argz_delete (char **__restrict __argz, size_t *__restrict __argz_len, - char *__restrict __entry) __THROW; + char *__restrict __entry); extern void argz_delete (char **__restrict __argz, size_t *__restrict __argz_len, - char *__restrict __entry) __THROW; + char *__restrict __entry); /* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end. @@ -138,11 +145,11 @@ extern error_t __argz_insert (char **__restrict __argz, size_t *__restrict __argz_len, char *__restrict __before, - __const char *__restrict __entry) __THROW; + __const char *__restrict __entry); extern error_t argz_insert (char **__restrict __argz, size_t *__restrict __argz_len, char *__restrict __before, - __const char *__restrict __entry) __THROW; + __const char *__restrict __entry); /* Replace any occurrences of the string STR in ARGZ with WITH, reallocating ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be @@ -173,33 +180,8 @@ ...; */ extern char *__argz_next (__const char *__restrict __argz, size_t __argz_len, - __const char *__restrict __entry) __THROW; + __const char *__restrict __entry); extern char *argz_next (__const char *__restrict __argz, size_t __argz_len, - __const char *__restrict __entry) __THROW; - -#ifdef __USE_EXTERN_INLINES -extern inline char * -__argz_next (__const char *__argz, size_t __argz_len, - __const char *__entry) -{ - if (__entry) - { - if (__entry < __argz + __argz_len) - __entry = strchr (__entry, '\0') + 1; - - return __entry >= __argz + __argz_len ? (char *) NULL : (char *) __entry; - } - else - return __argz_len > 0 ? (char *) __argz : 0; -} -extern inline char * -argz_next (__const char *__argz, size_t __argz_len, - __const char *__entry) -{ - return __argz_next (__argz, __argz_len, __entry); -} -#endif /* Use extern inlines. */ - -__END_DECLS + __const char *__restrict __entry); #endif /* argz.h */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/configure new/atftp-0.7.4/configure --- old/atftp-0.7.2/configure 2019-04-21 14:46:18.000000000 +0200 +++ new/atftp-0.7.4/configure 2021-02-02 01:05:17.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for atftp 0.7.2. +# Generated by GNU Autoconf 2.69 for atftp 0.7.4. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -577,8 +577,8 @@ # Identity of this package. PACKAGE_NAME='atftp' PACKAGE_TARNAME='atftp' -PACKAGE_VERSION='0.7.2' -PACKAGE_STRING='atftp 0.7.2' +PACKAGE_VERSION='0.7.4' +PACKAGE_STRING='atftp 0.7.4' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -703,6 +703,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -781,6 +782,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1033,6 +1035,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1170,7 +1181,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1283,7 +1294,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures atftp 0.7.2 to adapt to many kinds of systems. +\`configure' configures atftp 0.7.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1323,6 +1334,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1353,7 +1365,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of atftp 0.7.2:";; + short | recursive ) echo "Configuration of atftp 0.7.4:";; esac cat <<\_ACEOF @@ -1449,7 +1461,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -atftp configure 0.7.2 +atftp configure 0.7.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1868,7 +1880,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by atftp $as_me 0.7.2, which was +It was created by atftp $as_me 0.7.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2422,12 +2434,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -2732,7 +2739,7 @@ # Define the identity of the package. PACKAGE='atftp' - VERSION='0.7.2' + VERSION='0.7.4' cat >>confdefs.h <<_ACEOF @@ -5914,7 +5921,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by atftp $as_me 0.7.2, which was +This file was extended by atftp $as_me 0.7.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -5980,7 +5987,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -atftp config.status 0.7.2 +atftp config.status 0.7.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -6793,7 +6800,9 @@ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/configure.ac new/atftp-0.7.4/configure.ac --- old/atftp-0.7.2/configure.ac 2019-04-21 14:21:29.000000000 +0200 +++ new/atftp-0.7.4/configure.ac 2021-02-02 00:52:24.000000000 +0100 @@ -10,7 +10,7 @@ dnl Free Software Foundation; either version 2 of the License, or (at your dnl option) any later version. -AC_INIT([atftp], [0.7.2]) +AC_INIT([atftp], [0.7.4]) AC_CONFIG_SRCDIR([tftp.c]) AM_INIT_AUTOMAKE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/redhat/atftp.spec new/atftp-0.7.4/redhat/atftp.spec --- old/atftp-0.7.2/redhat/atftp.spec 2019-04-21 14:46:51.000000000 +0200 +++ new/atftp-0.7.4/redhat/atftp.spec 2021-02-02 01:05:22.000000000 +0100 @@ -1,7 +1,7 @@ Name: atftp Summary: Advanced Trivial File Transfer Protocol (ATFTP) - TFTP server Group: System Environment/Daemons -Version: 0.7.2 +Version: 0.7.4 Release: 1 Copyright: GPL Vendor: Linux Networx Inc. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/test/.gitignore new/atftp-0.7.4/test/.gitignore --- old/atftp-0.7.2/test/.gitignore 2012-07-19 08:14:48.000000000 +0200 +++ new/atftp-0.7.4/test/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,3 +0,0 @@ -atftpd.log -out.bin -Makefile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/test/Makefile new/atftp-0.7.4/test/Makefile --- old/atftp-0.7.2/test/Makefile 2019-04-21 14:46:51.000000000 +0200 +++ new/atftp-0.7.4/test/Makefile 2021-02-02 01:05:21.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # test/Makefile. Generated from Makefile.in by configure. -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -299,6 +299,7 @@ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -323,12 +324,12 @@ $(TEST_LOG_FLAGS) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/test-driver DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/missing aclocal-1.16 +ACLOCAL = ${SHELL} '/home/martin/swbuild/atftp/atftp.git/missing' aclocal-1.16 AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 -AUTOCONF = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/missing autoconf -AUTOHEADER = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/missing autoheader -AUTOMAKE = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/missing automake-1.16 +AUTOCONF = ${SHELL} '/home/martin/swbuild/atftp/atftp.git/missing' autoconf +AUTOHEADER = ${SHELL} '/home/martin/swbuild/atftp/atftp.git/missing' autoheader +AUTOMAKE = ${SHELL} '/home/martin/swbuild/atftp/atftp.git/missing' automake-1.16 AWK = gawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -349,36 +350,36 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -ISODATE = 2019-04-21 +ISODATE = 2021-02-02 LDFLAGS = LIBOBJS = LIBPCRE = -lpcre LIBPTHREAD = -lpthread LIBREADLINE = -lreadline LIBS = -LIBTERMCAP = -lncurses +LIBTERMCAP = LIBWRAP = -lnsl -lwrap LTLIBOBJS = -MAKEINFO = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/missing makeinfo +MAKEINFO = ${SHELL} '/home/martin/swbuild/atftp/atftp.git/missing' makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = atftp PACKAGE_BUGREPORT = PACKAGE_NAME = atftp -PACKAGE_STRING = atftp 0.7.2 +PACKAGE_STRING = atftp 0.7.4 PACKAGE_TARNAME = atftp PACKAGE_URL = -PACKAGE_VERSION = 0.7.2 +PACKAGE_VERSION = 0.7.4 PATH_SEPARATOR = : PLATFORM = pc-x86_64-linux-gnu SET_MAKE = SHELL = /bin/sh STRIP = -VERSION = 0.7.2 -abs_builddir = /home/martin/swbuild/atftp/git/atftp.git/test -abs_srcdir = /home/martin/swbuild/atftp/git/atftp.git/test -abs_top_builddir = /home/martin/swbuild/atftp/git/atftp.git -abs_top_srcdir = /home/martin/swbuild/atftp/git/atftp.git +VERSION = 0.7.4 +abs_builddir = /home/martin/swbuild/atftp/atftp.git/test +abs_srcdir = /home/martin/swbuild/atftp/atftp.git/test +abs_top_builddir = /home/martin/swbuild/atftp/atftp.git +abs_top_srcdir = /home/martin/swbuild/atftp/atftp.git ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -405,7 +406,7 @@ htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/martin/swbuild/atftp/git/atftp.git/install-sh +install_sh = ${SHELL} /home/martin/swbuild/atftp/atftp.git/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -417,6 +418,7 @@ prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} +runstatedir = ${localstatedir}/run sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com srcdir = . @@ -440,9 +442,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile + $(AUTOMAKE) --foreign test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -574,7 +576,7 @@ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/test/Makefile.in new/atftp-0.7.4/test/Makefile.in --- old/atftp-0.7.2/test/Makefile.in 2019-04-21 14:46:19.000000000 +0200 +++ new/atftp-0.7.4/test/Makefile.in 2021-02-02 01:05:17.000000000 +0100 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -299,6 +299,7 @@ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -417,6 +418,7 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -440,9 +442,9 @@ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu test/Makefile + $(AUTOMAKE) --foreign test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -574,7 +576,7 @@ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/test/test.sh new/atftp-0.7.4/test/test.sh --- old/atftp-0.7.2/test/test.sh 2019-04-21 14:38:02.000000000 +0200 +++ new/atftp-0.7.4/test/test.sh 2021-02-01 23:42:55.000000000 +0100 @@ -2,7 +2,7 @@ # # This script does some testing with atftp server and client # -# +# It needs ~150MB free diskspace in $TEMPDIR # assume we are called in the source tree after the build # so binaries are one dir up @@ -29,7 +29,15 @@ # WANT_INTERACTIVE_TESTS=yes ./test.sh : ${WANT_INTERACTIVE_TESTS:=no} - +# When the Tests have been run, should the files be cleaned up? +# defaults to yes, if you need test output for troubleshooting either set the +# environment variable CLEANUP=0 +# or +# call test.sh with parameter "--nocleanup" (for backward compatibility) +: ${CLEANUP:=1} +if [ "$1" == "--nocleanup" ]; then + CLEANUP=0 +fi ##################################################################################### DIRECTORY=$(mktemp -d ${TEMPDIR}/atftp-test.XXXXXX) @@ -71,72 +79,72 @@ fi function start_server() { - # start a server - echo -n "Starting atftpd server on port $PORT: " - $ATFTPD $SERVER_ARGS > $SERVER_LOG & - if [ $? != 0 ]; then - echo "Error starting server" - exit 1 - fi - sleep 1 - ATFTPD_PID=$! - # test if server process exists - ps -p $ATFTPD_PID >/dev/null 2>&1 - if [ $? != 0 ]; then - echo "server process died" - exit 1 - fi - echo "PID $ATFTPD_PID" + # start a server + echo -n "Starting atftpd server on port $PORT: " + $ATFTPD $SERVER_ARGS > $SERVER_LOG & + if [ $? != 0 ]; then + echo "Error starting server" + exit 1 + fi + sleep 1 + ATFTPD_PID=$! + # test if server process exists + ps -p $ATFTPD_PID >/dev/null 2>&1 + if [ $? != 0 ]; then + echo "server process died" + exit 1 + fi + echo "PID $ATFTPD_PID" } function stop_server() { - echo "Stopping atftpd server" - kill $ATFTPD_PID + echo "Stopping atftpd server" + kill $ATFTPD_PID } function check_file() { - if cmp $1 $2 2>/dev/null ; then - echo "OK" - else - echo "ERROR" - ERROR=1 - fi + if cmp $1 $2 2>/dev/null ; then + echo "OK" + else + echo "ERROR - $1 $2 not equal" + ERROR=1 + fi } function test_get_put() { - local READFILE="$1" - shift - echo -n " get, ${READFILE} ($*)... " - if [ "$1" = "--option" ]; then - $ATFTP "$1" "$2" --get --remote-file ${READFILE} --local-file out.bin $HOST $PORT 2>/dev/null - else - $ATFTP --get --remote-file ${READFILE} --local-file out.bin $HOST $PORT 2>/dev/null - fi - check_file $DIRECTORY/${READFILE} out.bin - echo -n " put, ${READFILE} ($*)... " - if [ "$1" = "--option" ]; then - $ATFTP "$1" "$2" --put --remote-file $WRITE --local-file $DIRECTORY/${READFILE} $HOST $PORT 2>/dev/null - else - $ATFTP --put --remote-file $WRITE --local-file $DIRECTORY/${READFILE} $HOST $PORT 2>/dev/null - fi - # wait a second - # because in some case the server may not have time to close the file - # before the file compare. - sleep 1 - check_file $DIRECTORY/${READFILE} $DIRECTORY/$WRITE - rm -f $DIRECTORY/$WRITE out.bin + local READFILE="$1" + shift + echo -n " get, ${READFILE} ($*)... " + if [ "$1" = "--option" ]; then + $ATFTP "$1" "$2" --get --remote-file ${READFILE} --local-file out.bin $HOST $PORT 2>/dev/null + else + $ATFTP --get --remote-file ${READFILE} --local-file out.bin $HOST $PORT 2>/dev/null + fi + check_file $DIRECTORY/${READFILE} out.bin + echo -n " put, ${READFILE} ($*)... " + if [ "$1" = "--option" ]; then + $ATFTP "$1" "$2" --put --remote-file $WRITE --local-file $DIRECTORY/${READFILE} $HOST $PORT 2>/dev/null + else + $ATFTP --put --remote-file $WRITE --local-file $DIRECTORY/${READFILE} $HOST $PORT 2>/dev/null + fi + # wait a second + # because in some case the server may not have time to close the file + # before the file compare. + sleep 1 + check_file $DIRECTORY/${READFILE} $DIRECTORY/$WRITE + rm -f $DIRECTORY/$WRITE out.bin } function test_blocksize() { - echo -n " block size $1 bytes ... " - $ATFTP --option "blksize $1" --trace --get -r $READ_128K -l /dev/null $HOST $PORT 2> out - if [ $(grep DATA out | wc -l) -eq $(( 128*1024 / $1 + 1)) ]; then - echo "OK" - else - echo "ERROR" - ERROR=1 - fi + echo -n " block size $1 bytes ... " + $ATFTP --option "blksize $1" --trace --get -r $READ_128K -l /dev/null $HOST $PORT 2> out + if [ $(grep DATA out | wc -l) -eq $(( 128*1024 / $1 + 1)) ]; then + echo "OK" + else + echo "ERROR" + ERROR=1 + fi } # make sure we have /tftpboot with some files @@ -144,6 +152,8 @@ echo "create $DIRECTORY before running this test" exit 1 fi +echo "Using directory $DIRECTORY for test files" +echo "Work directory " $(pwd) # files needed READ_0=READ_0.bin @@ -203,82 +213,86 @@ # # testing for invalid file name # +OUTPUTFILE="01-out" echo echo -n "Test detection of non-existing file name ... " -$ATFTP --trace --get -r "thisfiledoesntexist" -l /dev/null $HOST $PORT 2> out -if grep -q "<File not found>" out; then - echo OK +$ATFTP --trace --get -r "thisfiledoesntexist" -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +if grep -q "<File not found>" "$OUTPUTFILE"; then + echo OK else - echo ERROR - ERROR=1 + echo ERROR + ERROR=1 fi # # testing for invalid blocksize # maximum blocksize is 65464 as described in RCF2348 # +OUTPUTFILE="02-out" echo echo "Testing blksize option ..." echo -n " smaller than minimum ... " -$ATFTP --option "blksize 7" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> out -if grep -q "<Failure to negotiate RFC1782 options>" out; then - echo OK +$ATFTP --option "blksize 7" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +if grep -q "<Failure to negotiate RFC1782 options>" "$OUTPUTFILE"; then + echo OK else - echo ERROR - ERROR=1 + echo ERROR + ERROR=1 fi echo -n " bigger than maximum ... " -$ATFTP --option "blksize 65465" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> out -if grep -q "<Failure to negotiate RFC1782 options>" out; then - echo OK +$ATFTP --option "blksize 65465" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +if grep -q "<Failure to negotiate RFC1782 options>" "$OUTPUTFILE"; then + echo OK else - echo ERROR - ERROR=1 + echo ERROR + ERROR=1 fi - # # testing for tsize # +OUTPUTFILE="03-out" echo "" echo -n "Testing tsize option... " -$ATFTP --option "tsize" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> out -TSIZE=$(grep "OACK <tsize:" out | sed -e "s/[^0-9]//g") +$ATFTP --option "tsize" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +TSIZE=$(grep "OACK <tsize:" "$OUTPUTFILE" | sed -e "s/[^0-9]//g") if [ "$TSIZE" != "2048" ]; then - echo "ERROR (server report $TSIZE bytes but it should be 2048)" - ERROR=1 + echo "ERROR (server report $TSIZE bytes but it should be 2048)" + ERROR=1 else - echo "OK" + echo "OK" fi # # testing for timeout # +OUTPUTFILE="04-out" echo "" echo "Testing timeout option limit..." echo -n " minimum ... " -$ATFTP --option "timeout 0" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> out -if grep -q "<Failure to negotiate RFC1782 options>" out; then - echo OK +$ATFTP --option "timeout 0" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +if grep -q "<Failure to negotiate RFC1782 options>" "$OUTPUTFILE"; then + echo OK else - echo ERROR - ERROR=1 + echo ERROR + ERROR=1 fi echo -n " maximum ... " -$ATFTP --option "timeout 256" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> out -if grep -q "<Failure to negotiate RFC1782 options>" out; then - echo OK +$ATFTP --option "timeout 256" --trace --get -r $READ_2K -l /dev/null $HOST $PORT 2> "$OUTPUTFILE" +if grep -q "<Failure to negotiate RFC1782 options>" "$OUTPUTFILE"; then + echo OK else - echo ERROR - ERROR=1 + echo ERROR + ERROR=1 fi # Test the behaviour when the server is not reached # we assume there is no tftp server listening on 127.0.0.77 # Returncode must be 255 +OUTPUTFILE="05-out" echo echo -n "Test returncode after timeout when server is unreachable ... " -$ATFTP --put --local-file "$DIRECTORY/$READ_2K" 127.0.0.77 2>out +$ATFTP --put --local-file "$DIRECTORY/$READ_2K" 127.0.0.77 2>"$OUTPUTFILE" Retval=$? echo -n "Returncode $Retval: " if [ $Retval -eq 255 ]; then @@ -340,53 +354,54 @@ # Test that timeout is well set to 1 sec and works. # we need atftp compiled with debug support to do that # Restart the server with full logging +OUTPUTFILE="06-out" if $ATFTP --help 2>&1 | grep --quiet -- --delay then - stop_server - OLD_ARGS="$SERVER_ARGS" - SERVER_ARGS="$SERVER_ARGS --verbose=7" - start_server - - $ATFTP --option "timeout 1" --delay 200 --get -r $READ_2K -l /dev/null $HOST $PORT 2> /dev/null & - CPID=$! - sleep 1 - kill -s STOP $CPID - echo -n "Testing timeout " - for i in $(seq 6); do + stop_server + OLD_ARGS="$SERVER_ARGS" + SERVER_ARGS="$SERVER_ARGS --verbose=7" + start_server + + $ATFTP --option "timeout 1" --delay 200 --get -r $READ_2K -l /dev/null $HOST $PORT 2> /dev/null & + CPID=$! sleep 1 - echo -n "." - done - kill $CPID - - stop_server - - sleep 1 - grep "timeout: retrying..." $SERVER_LOG | cut -d " " -f 3 > out - count=$(wc -l out | cut -d "o" -f1) - if [ $count != 5 ]; then - ERROR=1 - echo "ERROR" - else - prev=0 - res="OK" - while read line; do - hrs=$(echo $line | cut -d ":" -f 1) - min=$(echo $line | cut -d ":" -f 2) - sec=$(echo $line | cut -d ":" -f 3) - cur=$(( 24*60*10#$hrs + 60*10#$min + 10#$sec )) + kill -s STOP $CPID + echo -n "Testing timeout " + for i in $(seq 6); do + sleep 1 + echo -n "." + done + kill $CPID + + stop_server + + sleep 1 + grep "timeout: retrying..." $SERVER_LOG | cut -d " " -f 3 > "$OUTPUTFILE" + count=$(wc -l "$OUTPUTFILE" | cut -d "o" -f1) + if [ $count != 5 ]; then + ERROR=1 + echo "ERROR" + else + prev=0 + res="OK" + while read line; do + hrs=$(echo $line | cut -d ":" -f 1) + min=$(echo $line | cut -d ":" -f 2) + sec=$(echo $line | cut -d ":" -f 3) + cur=$(( 24*60*10#$hrs + 60*10#$min + 10#$sec )) - if [ $prev -gt 0 ]; then - if [ $(($cur - $prev)) != 1 ]; then - res="ERROR" - ERROR=1 - fi - fi - prev=$cur - done < out - echo " $res" - fi - SERVER_ARGS="$OLD_ARGS" - start_server + if [ $prev -gt 0 ]; then + if [ $(($cur - $prev)) != 1 ]; then + res="ERROR" + ERROR=1 + fi + fi + prev=$cur + done < "$OUTPUTFILE" + echo " $res" + fi + SERVER_ARGS="$OLD_ARGS" + start_server else echo echo "Detailed timeout test could not be done" @@ -404,8 +419,8 @@ #echo "" #echo -n "Testing multicast option " #for i in $(seq 10); do -# echo -n "." -# atftp --blksize=8 --multicast -d --get -r $READ_BIG -l out.$i.bin $HOST $PORT 2> /dev/null& +# echo -n "." +# atftp --blksize=8 --multicast -d --get -r $READ_BIG -l out.$i.bin $HOST $PORT 2> /dev/null& #done #echo "OK" @@ -421,64 +436,80 @@ echo "Testing high server load" echo -n " starting $NBSERVER simultaneous atftp get processes ... " #( for i in $(seq 1 $NBSERVER); do -# ($ATFTP --get --remote-file $READ_1M --local-file /dev/null $HOST $PORT 2> out.$i) & -# echo -n "+" +# ($ATFTP --get --remote-file $READ_1M --local-file /dev/null $HOST $PORT 2> out.$i) & +# echo -n "+" #done ) for i in $(seq 1 $NBSERVER) do - $ATFTP --get --remote-file $READ_1M --local-file /dev/null $HOST $PORT 2> out.$i & + $ATFTP --get --remote-file $READ_1M --local-file /dev/null $HOST $PORT 2> "$DIRECTORY/high-server-load-out.$i" & done echo "done" let CHECKCOUNTER=0 -let MAXCHECKS=30 +let MAXCHECKS=90 while [[ $CHECKCOUNTER -lt $MAXCHECKS ]]; do - PIDCOUNT=$(pidof $ATFTP|wc -w) - if [ $PIDCOUNT -gt 0 ]; then - echo " wait for atftp processes to complete: $PIDCOUNT running" - let CHECKCOUNTER+=1 - sleep 1 - else - let CHECKCOUNTER=$MAXCHECKS+1 - fi + PIDCOUNT=$(pidof $ATFTP|wc -w) + if [ $PIDCOUNT -gt 0 ]; then + echo " wait for atftp processes to complete: $PIDCOUNT running" + let CHECKCOUNTER+=1 + sleep 1 + else + let CHECKCOUNTER=$MAXCHECKS+1 + fi done -error=0; + +# +# high server load test passed, now examine the results +# +>"$DIRECTORY/high-server-load-out.result" for i in $(seq 1 $NBSERVER); do - if grep -q "timeout: retrying..." out.$i; then - error=1; - else - rm out.$i - fi + # merge all output together + cat "$DIRECTORY/high-server-load-out.$i" >>"$DIRECTORY/high-server-load-out.result" done -if [ "$error" -eq "1" ]; then - echo ERROR; - ERROR=1 + +# remove timeout/retry messages, they are no error indicator +grep -v "timeout: retrying..." <"$DIRECTORY/high-server-load-out.result" >"$DIRECTORY/high-server-load-out.clean-result" + +# the remaining output is considered as error messages +error_cnt=$(wc -l <"$DIRECTORY/high-server-load-out.clean-result") + +# print out error summary +if [ "$error_cnt" -gt "0" ]; then + echo "Errors occurred during high server load test, # lines output: $error_cnt" + echo "======================================================" + cat "$DIRECTORY/high-server-load-out.clean-result" + echo "======================================================" + ERROR=1 else - echo OK + echo "High server load test: OK" fi +# remove all empty output files +find "$DIRECTORY" -name "high-server-load-out.*" -size 0 -delete + stop_server echo + # cleanup -if [ "$1" == "--nocleanup" ]; then - echo "No Cleanup, keep files from test in $DIRECTORY" +if [ $CLEANUP -ne 1 ]; then + echo "No cleanup, files from test are left in $DIRECTORY" else - echo "Cleanup test files" - rm -f out - rm -f $SERVER_LOG $DIRECTORY/$READ_0 $DIRECTORY/$READ_511 $DIRECTORY/$READ_512 - rm -f $DIRECTORY/$READ_2K $DIRECTORY/$READ_BIG $DIRECTORY/$READ_128K $DIRECTORY/$READ_1M - rm -f $DIRECTORY/$WRITE - rmdir $DIRECTORY + echo "Cleaning up test files" + rm -f ??-out $SERVER_LOG + cd "$DIRECTORY" + rm -f $READ_0 $READ_511 $READ_512 $READ_2K $READ_BIG $READ_128K $READ_1M $READ_101M $WRITE high-server-load-out.* + cd .. + rmdir "$DIRECTORY" fi echo -n "Overall Test status: " # Exit with proper error status if [ $ERROR -eq 1 ]; then - echo "Errors have occurred" - exit 1 + echo "Errors have occurred" + exit 1 else - echo "OK" - exit 0 + echo "OK" + exit 0 fi # vim: ts=4:sw=4:autoindent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftp.h new/atftp-0.7.4/tftp.h --- old/atftp-0.7.2/tftp.h 2011-03-11 07:51:24.000000000 +0100 +++ new/atftp-0.7.4/tftp.h 2021-01-31 23:59:14.000000000 +0100 @@ -19,6 +19,7 @@ #include <sys/time.h> #include <sys/times.h> +#include <sys/types.h> #include "tftp_def.h" #include "config.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftp_def.c new/atftp-0.7.4/tftp_def.c --- old/atftp-0.7.2/tftp_def.c 2019-04-15 00:38:55.000000000 +0200 +++ new/atftp-0.7.4/tftp_def.c 2021-01-31 23:59:14.000000000 +0100 @@ -180,6 +180,15 @@ return OK; } +int +sockaddr_family_supported(const struct sockaddr_storage *ss) +{ + if (ss->ss_family == AF_INET || ss->ss_family == AF_INET6) + return 1; + else + return 0; +} + char * sockaddr_print_addr(const struct sockaddr_storage *ss, char *buf, size_t len) { @@ -189,7 +198,7 @@ else if (ss->ss_family == AF_INET6) addr = &((const struct sockaddr_in6 *)ss)->sin6_addr; else - assert(!"sockaddr_print: unsupported address family"); + return "sockaddr_print: unsupported address family"; return (char *)inet_ntop(ss->ss_family, addr, buf, len); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftp_def.h new/atftp-0.7.4/tftp_def.h --- old/atftp-0.7.2/tftp_def.h 2019-04-15 00:38:55.000000000 +0200 +++ new/atftp-0.7.4/tftp_def.h 2021-01-31 23:59:14.000000000 +0100 @@ -51,9 +51,10 @@ int timeval_diff(struct timeval *res, struct timeval *t1, struct timeval *t0); int print_eng(double value, char *string, int size, char *format); -inline char *Strncpy(char *to, const char *from, size_t size); +char *Strncpy(char *to, const char *from, size_t size); int Gethostbyname(char *addr, struct hostent *host); +int sockaddr_family_supported(const struct sockaddr_storage *ss); char *sockaddr_print_addr(const struct sockaddr_storage *, char *, size_t); #define SOCKADDR_PRINT_ADDR_LEN INET6_ADDRSTRLEN uint16_t sockaddr_get_port(const struct sockaddr_storage *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftp_io.c new/atftp-0.7.4/tftp_io.c --- old/atftp-0.7.2/tftp_io.c 2019-04-15 00:38:55.000000000 +0200 +++ new/atftp-0.7.4/tftp_io.c 2021-01-31 23:59:14.000000000 +0100 @@ -444,6 +444,7 @@ int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, long block_number, int data_size, int convert, long *prev_block_number, int *temp) { + static long filepos; int bytes_written; int c; char prevchar = *temp; @@ -451,9 +452,14 @@ if (!convert) { /* Simple case, just seek and write */ - if (fseek(fp, (block_number - 1) * data_buffer_size, SEEK_SET) != 0) - return 0; + long position = (block_number - 1)*data_buffer_size; + if (position != filepos) + if (fseek(fp, position, SEEK_SET) != 0) + return 0; + else + filepos = position; bytes_written = fwrite(data_buffer, 1, data_size, fp); + filepos += bytes_written; } else if (block_number != *prev_block_number) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftpd.c new/atftp-0.7.4/tftpd.c --- old/atftp-0.7.2/tftpd.c 2019-04-15 00:38:55.000000000 +0200 +++ new/atftp-0.7.4/tftpd.c 2021-01-31 23:59:14.000000000 +0100 @@ -644,6 +644,11 @@ } #ifdef HAVE_WRAP + if (!abort && !sockaddr_family_supported(&data->client_info->client)) + { + logger(LOG_ERR, "Connection from unsupported network address family refused"); + abort = 1; + } if (!abort) { /* Verify the client has access. We don't look for the name but diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftpd.h new/atftp-0.7.4/tftpd.h --- old/atftp-0.7.2/tftpd.h 2011-03-11 07:51:24.000000000 +0100 +++ new/atftp-0.7.4/tftpd.h 2021-01-31 23:59:14.000000000 +0100 @@ -20,6 +20,7 @@ #include <pthread.h> #include <arpa/tftp.h> #include <arpa/inet.h> +#include <sys/types.h> #include "tftp_io.h" /* @@ -93,7 +94,7 @@ /* * Defined in tftpd_list.c, operation on client structure list. */ -inline void tftpd_clientlist_ready(struct thread_data *thread); +void tftpd_clientlist_ready(struct thread_data *thread); void tftpd_clientlist_remove(struct thread_data *thread, struct client_info *client); void tftpd_clientlist_free(struct thread_data *thread); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/atftp-0.7.2/tftpd_mtftp.c new/atftp-0.7.4/tftpd_mtftp.c --- old/atftp-0.7.2/tftpd_mtftp.c 2019-04-21 14:13:10.000000000 +0200 +++ new/atftp-0.7.4/tftpd_mtftp.c 2021-01-31 23:59:14.000000000 +0100 @@ -393,6 +393,11 @@ &data_size, data->data_buffer); #ifdef HAVE_WRAP + if (!sockaddr_family_supported(&sa)) + { + logger(LOG_ERR, "mtftp: Connection from unsupported network address family refused"); + continue; + } /* Verify the client has access. We don't look for the name but rely only on the IP address for that. */ sockaddr_print_addr(&sa, addr_str, sizeof(addr_str));
