Hello community, here is the log from the commit of package tftp checked in at Thu Dec 7 21:31:01 CET 2006. -------- --- tftp/tftp.changes 2006-10-20 19:38:22.000000000 +0200 +++ /mounts/work_src_done/STABLE/tftp/tftp.changes 2006-12-07 04:11:12.000000000 +0100 @@ -1,0 +2,8 @@ +Thu Dec 7 04:09:55 CET 2006 - mrueckert@suse.de + +- update to version 0.44: + - Allow the client to specify a range of local port numbers, just + like the server can. + - Fix sending SIGHUP to update the regular expression table. + +------------------------------------------------------------------- @@ -4 +12 @@ -- update to version 0.4.3 +- update to version 0.43: Old: ---- tftp-hpa-0.43.tar.bz2 New: ---- tftp-hpa-0.44.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ tftp.spec ++++++ --- /var/tmp/diff_new_pack.S5OK0R/_old 2006-12-07 21:30:24.000000000 +0100 +++ /var/tmp/diff_new_pack.S5OK0R/_new 2006-12-07 21:30:24.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package tftp (Version 0.43) +# spec file for package tftp (Version 0.44) # # Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -17,7 +17,7 @@ Group: Productivity/Networking/Ftp/Clients Requires: inet-daemon netcfg Autoreqprov: on -Version: 0.43 +Version: 0.44 Release: 1 Summary: Trivial File Transfer Protocol (TFTP) Source: tftp-hpa-%{version}.tar.bz2 @@ -71,8 +71,13 @@ %config(noreplace) /etc/xinetd.d/tftp %changelog -n tftp +* Thu Dec 07 2006 - mrueckert@suse.de +- update to version 0.44: + - Allow the client to specify a range of local port numbers, just + like the server can. + - Fix sending SIGHUP to update the regular expression table. * Fri Oct 20 2006 - mrueckert@suse.de -- update to version 0.4.3 +- update to version 0.43: - Fix double-free error on ^c in client. - Try to deal with clients that send TFTP requests to broadcasts (apparently some recent Sun boxes do this instead of using the ++++++ tftp-hpa-0.43.tar.bz2 -> tftp-hpa-0.44.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/CHANGES new/tftp-hpa-0.44/CHANGES --- old/tftp-hpa-0.43/CHANGES 2006-10-05 23:23:00.000000000 +0200 +++ new/tftp-hpa-0.44/CHANGES 2006-12-05 23:39:41.000000000 +0100 @@ -1,3 +1,10 @@ +Changes in 0.44: + Allow the client to specify a range of local port numbers, + just like the server can. + + Fix sending SIGHUP to update the regular expression table. + + Changes in 0.43: Fix double-free error on ^c in client. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/common/tftpsubs.c new/tftp-hpa-0.44/common/tftpsubs.c --- old/tftp-hpa-0.43/common/tftpsubs.c 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/common/tftpsubs.c 2006-12-05 23:39:41.000000000 +0100 @@ -272,3 +272,41 @@ return pktcount; /* Return packets drained */ } + + +int pick_port_bind(int sockfd, struct sockaddr_in *myaddr, unsigned int port_range_from, unsigned int port_range_to) +{ + unsigned int port, firstport; + int port_range = 0; + + if (port_range_from != 0 && port_range_to != 0) { + port_range = 1; + } + + firstport = port_range + ? port_range_from + rand() % (port_range_to-port_range_from+1) + : 0; + + port = firstport; + + do { + myaddr->sin_port = htons(port); + + if (bind(sockfd, (struct sockaddr *)myaddr, sizeof *myaddr) < 0) { + /* Some versions of Linux return EINVAL instead of EADDRINUSE */ + if ( !(port_range && (errno == EINVAL || errno == EADDRINUSE)) ) + return -1; + + /* Normally, we shouldn't have to loop, but some situations involving + aborted transfers make it possible. */ + } else { + return 0; + } + + port++; + if ( port > port_range_to ) + port = port_range_from; + } while ( port != firstport ); + + return -1; +} diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/common/tftpsubs.h new/tftp-hpa-0.44/common/tftpsubs.h --- old/tftp-hpa-0.43/common/tftpsubs.h 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/common/tftpsubs.h 2006-12-05 23:39:41.000000000 +0100 @@ -74,3 +74,6 @@ void (*bsd_signal(int, void (*)(int)))(int); #endif + + +int pick_port_bind(int sockfd, struct sockaddr_in *myaddr, unsigned int from, unsigned int to); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/release.sh new/tftp-hpa-0.44/release.sh --- old/tftp-hpa-0.43/release.sh 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/release.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -#!/bin/sh -xe -# -# Script for generating a release -# - -PACKAGE=tftp-hpa - -if [ -z "$1" ]; then - echo "Usage: $0 release-id" 1>&2 - exit 1 -fi - -release="$1" -releasetag=$PACKAGE-$release -releasedir=$PACKAGE-$release - -GIT_DIR=`cd "${GIT_DIR-.git}" && pwd` -export GIT_DIR - -if [ x"$release" = x'test' ]; then - release=`cat version` - releasetag=HEAD - releasedir=$PACKAGE-$release -else - echo $release > version.new - if ! cmp -s version version.new ; then - mv -f version.new version - cg-commit -m 'Update version for release' version - else - rm -f version.new - fi - rm -f "$GIT_DIR"/refs/tags/$releasetag - cg-tag $releasetag -fi - -here=`pwd` - -tmpdir=/var/tmp/release.$$ -rm -rf $tmpdir -mkdir -p $tmpdir -cd $tmpdir -cg-export -r $releasetag $releasedir -cd $releasedir -make release -rm -f release.sh -cd .. -tar cvvf $releasedir.tar $releasedir -gzip -9 $releasedir.tar -mv -f $releasedir.tar.gz $here/.. -cd .. -rm -rf $tmpdir diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/tftp/main.c new/tftp-hpa-0.44/tftp/main.c --- old/tftp-hpa-0.43/tftp/main.c 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/tftp/main.c 2006-12-05 23:39:41.000000000 +0100 @@ -102,6 +102,9 @@ sigjmp_buf toplevel; void intr(int); struct servent *sp; +int portrange = 0; +unsigned int portrange_from = 0; +unsigned int portrange_to = 0; void get (int, char **); void help (int, char **); @@ -241,6 +244,16 @@ case 'c': iscmd = 1; break; + case 'R': + if ( ++arg >= argc ) + usage(EX_USAGE); + if ( sscanf(argv[arg], "%u:%u", &portrange_from, &portrange_to) != 2 || + portrange_from > portrange_to || portrange_to > 65535 ) { + fprintf(stderr, "Bad port range: %s\n", argv[arg]); + exit(EX_USAGE); + } + portrange = 1; + break; case 'h': default: usage(*optx == 'h' ? 0 : EX_USAGE); @@ -276,7 +289,7 @@ } bzero((char *)&s_in, sizeof (s_in)); s_in.sin_family = AF_INET; - if (bind(f, (struct sockaddr *)&s_in, sizeof (s_in)) < 0) { + if (pick_port_bind(f, &s_in, portrange_from, portrange_to)) { perror("tftp: bind"); exit(EX_OSERR); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/tftp.spec new/tftp-hpa-0.44/tftp.spec --- old/tftp-hpa-0.43/tftp.spec 2006-10-05 23:23:15.000000000 +0200 +++ new/tftp-hpa-0.44/tftp.spec 2006-12-05 23:39:44.000000000 +0100 @@ -1,6 +1,6 @@ Summary: The client for the Trivial File Transfer Protocol (TFTP). Name: tftp -Version: 0.43 +Version: 0.44 Release: 1 License: BSD Group: Applications/Internet diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/tftpd/tftpd.c new/tftp-hpa-0.44/tftpd/tftpd.c --- old/tftp-hpa-0.43/tftpd/tftpd.c 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/tftpd/tftpd.c 2006-12-05 23:39:41.000000000 +0100 @@ -273,38 +273,6 @@ } } -static int -pick_port_bind(int sockfd, struct sockaddr_in *myaddr) -{ - unsigned int port, firstport; - - firstport = portrange - ? portrange_from + rand() % (portrange_to-portrange_from+1) - : 0; - - port = firstport; - - do { - myaddr->sin_port = htons(port); - - if (bind(sockfd, (struct sockaddr *)myaddr, sizeof *myaddr) < 0) { - /* Some versions of Linux return EINVAL instead of EADDRINUSE */ - if ( !(portrange && (errno == EINVAL || errno == EADDRINUSE)) ) - return -1; - - /* Normally, we shouldn't have to loop, but some situations involving - aborted transfers make it possible. */ - } else { - return 0; - } - - port++; - if ( port > portrange_to ) - port = portrange_from; - } while ( port != firstport ); - - return -1; -} int main(int argc, char **argv) @@ -587,7 +555,7 @@ if ( caught_sighup ) { caught_sighup = 0; if ( standalone ) { -#ifdef HAVE_REGEX +#ifdef WITH_REGEX if ( rewrite_file ) { freerules(rewrite_rules); rewrite_rules = read_remap_rules(rewrite_file); @@ -750,7 +718,7 @@ from.sin_family = AF_INET; /* Process the request... */ - if (pick_port_bind(peer, &myaddr) < 0) { + if (pick_port_bind(peer, &myaddr, portrange_from, portrange_to) < 0) { syslog(LOG_ERR, "bind: %m"); exit(EX_IOERR); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/tftp-hpa-0.43/version new/tftp-hpa-0.44/version --- old/tftp-hpa-0.43/version 2006-10-05 23:23:01.000000000 +0200 +++ new/tftp-hpa-0.44/version 2006-12-05 23:39:41.000000000 +0100 @@ -1 +1 @@ -0.43 +0.44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org