CVS commit: src/usr.bin/sdpquery

2011-06-25 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Jun 25 09:16:52 UTC 2011

Modified Files:
src/usr.bin/sdpquery: print.c

Log Message:
use size_t to satisfy lint


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/sdpquery/print.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/sdpquery/print.c
diff -u src/usr.bin/sdpquery/print.c:1.13 src/usr.bin/sdpquery/print.c:1.14
--- src/usr.bin/sdpquery/print.c:1.13	Fri Jun 24 20:53:56 2011
+++ src/usr.bin/sdpquery/print.c	Sat Jun 25 09:16:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: print.c,v 1.13 2011/06/24 20:53:56 plunky Exp $	*/
+/*	$NetBSD: print.c,v 1.14 2011/06/25 09:16:52 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: print.c,v 1.13 2011/06/24 20:53:56 plunky Exp $);
+__RCSID($NetBSD: print.c,v 1.14 2011/06/25 09:16:52 plunky Exp $);
 
 #include ctype.h
 #include iconv.h
@@ -67,7 +67,7 @@
 static const char *string_vis(int, const char *, size_t);
 
 static void print_hexdump(const char *, const uint8_t *, size_t);
-static bool print_attribute(uint16_t, sdp_data_t *, attr_t *, int);
+static bool print_attribute(uint16_t, sdp_data_t *, attr_t *, size_t);
 static bool print_universal_attribute(uint16_t, sdp_data_t *);
 static bool print_language_attribute(uint16_t, sdp_data_t *);
 static bool print_service_attribute(uint16_t, sdp_data_t *);
@@ -481,7 +481,8 @@
 	while (sdp_get_attr(rec, id, value)) {
 		if (Xflag) {
 			printf(AttributeID 0x%04x:\n, id);
-			print_hexdump( , value.next, value.end - value.next);
+			print_hexdump( , value.next,
+			(size_t)(value.end - value.next));
 		} else if (Rflag) {
 			printf(AttributeID 0x%04x:\n, id);
 			sdp_data_print(value, 4);
@@ -585,9 +586,9 @@
 }
 
 static bool
-print_attribute(uint16_t id, sdp_data_t *value, attr_t *attr, int count)
+print_attribute(uint16_t id, sdp_data_t *value, attr_t *attr, size_t count)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i  count; i++) {
 		if (id == attr[i].id) {



CVS commit: src/usr.sbin/sdpd

2011-06-25 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Sat Jun 25 09:28:45 UTC 2011

Modified Files:
src/usr.sbin/sdpd: main.c

Log Message:
use appropriate types for uid/gid


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sdpd/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sdpd/main.c
diff -u src/usr.sbin/sdpd/main.c:1.7 src/usr.sbin/sdpd/main.c:1.8
--- src/usr.sbin/sdpd/main.c:1.7	Sun Aug 30 19:24:40 2009
+++ src/usr.sbin/sdpd/main.c	Sat Jun 25 09:28:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $	*/
+/*	$NetBSD: main.c,v 1.8 2011/06/25 09:28:45 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
   Copyright (c) 2006 Itronix, Inc.\
   Copyright (c) 2004 Maksim Yevmenkin m_evmen...@yahoo.com.\
   All rights reserved.);
-__RCSID($NetBSD: main.c,v 1.7 2009/08/30 19:24:40 plunky Exp $);
+__RCSID($NetBSD: main.c,v 1.8 2011/06/25 09:28:45 plunky Exp $);
 
 #include errno.h
 #include grp.h
@@ -155,7 +155,8 @@
 static bool
 drop_root(char const *user, char const *group)
 {
-	int	 uid, gid;
+	gid_t	gid;
+	uid_t	uid;
 	char	*ep;
 
 	if ((uid = getuid()) != 0) {



CVS commit: src/crypto/external/bsd/netpgp/dist/src/libmj

2011-06-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jun 25 12:43:03 UTC 2011

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libmj: libmj.3

Log Message:
Quote minus so it does not become a dash.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3
diff -u src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.4 src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.5
--- src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3:1.4	Sat Jun 25 00:37:44 2011
+++ src/crypto/external/bsd/netpgp/dist/src/libmj/libmj.3	Sat Jun 25 12:43:03 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: libmj.3,v 1.4 2011/06/25 00:37:44 agc Exp $
+.\ $NetBSD: libmj.3,v 1.5 2011/06/25 12:43:03 wiz Exp $
 .\
 .\ Copyright (c) 2010 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -217,7 +217,7 @@
 the stdarg fields, that of the string itself, and its length in bytes
 immediately after the string.
 A value of
-.Dv -1
+.Dv \-1
 may be used if the string length is not known.
 .Sh EXAMPLES
 The follow code fragment will make a JSON object



CVS commit: src/share/man/man3

2011-06-25 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sat Jun 25 12:44:37 UTC 2011

Modified Files:
src/share/man/man3: dlfcn.3

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/share/man/man3/dlfcn.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3/dlfcn.3
diff -u src/share/man/man3/dlfcn.3:1.32 src/share/man/man3/dlfcn.3:1.33
--- src/share/man/man3/dlfcn.3:1.32	Sat Jun 25 05:45:11 2011
+++ src/share/man/man3/dlfcn.3	Sat Jun 25 12:44:37 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: dlfcn.3,v 1.32 2011/06/25 05:45:11 nonaka Exp $
+.\	$NetBSD: dlfcn.3,v 1.33 2011/06/25 12:44:37 wiz Exp $
 .\
 .\ Copyright (c) 1998 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd February 13, 2011
+.Dd June 25, 2011
 .Dt DLFCN 3
 .Os
 .Sh NAME



CVS commit: othersrc/external/bsd/mat

2011-06-25 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Sat Jun 25 17:05:35 UTC 2011

Modified Files:
othersrc/external/bsd/mat/dist: frontends.c mat.1 mat.c mat.h matpax.1
othersrc/external/bsd/mat/mat: Makefile

Log Message:
Add a substitution phase via -s '|regexp|replace|' to the tar and pax
frontends to mat(1) and libmat(3).  This allows filenames to be
manipulated on entry to or exit from an archive, so that entries can
be created in the mat archive with generic filenames (such as
@extractiondir@ or similar), which can be manipulated when
extracting archive components accordingly.

The substitution pattern uses the first character of the argument as
the delimiter, which can itself be escaped using the '\\' character,
should anyone be massochistic as to want to use the '/' character to
delimit file and directory names in a substitution pattern. Extended
regular expressions (NOT wildcards, fnmatch or glob patterns) are
used to match file name patterns.

The same archive security and integirty checks are made for archives
when extracting or listing, so it will not be possible to extract any
archive which has been constructed with a component name starting with
a '/', or which contains the /../ pattern.  Should such a pattern be
wanted or needed, (and the big question there is WHY???), then a
generic pattern can be substituted at mat archive creation time, and
the extracting user will explicitly need to specify that pattern at
extraction time.  This is, however, really not advised, and a
different way of creating the mat archive should be found.

Also change the mat(1) (and mattar(1)) man pages to use better and
more real-life examples.

Add tests for the -s functionality.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/mat/dist/frontends.c \
othersrc/external/bsd/mat/dist/mat.c
cvs rdiff -u -r1.7 -r1.8 othersrc/external/bsd/mat/dist/mat.1
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/mat/dist/mat.h
cvs rdiff -u -r1.4 -r1.5 othersrc/external/bsd/mat/dist/matpax.1
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/mat/mat/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/mat/dist/frontends.c
diff -u othersrc/external/bsd/mat/dist/frontends.c:1.2 othersrc/external/bsd/mat/dist/frontends.c:1.3
--- othersrc/external/bsd/mat/dist/frontends.c:1.2	Tue Jun 21 04:21:24 2011
+++ othersrc/external/bsd/mat/dist/frontends.c	Sat Jun 25 17:05:34 2011
@@ -109,6 +109,38 @@
 	return ok;
 }
 
+/* compile the regular expression we have */
+static int
+compile_subst(mat_t *mat, char *arg)
+{
+	char	*mid;
+	char	*s;
+
+	for (s = arg + 1 ; *s  *s != *arg ; s++) {
+		if (*s == '\\') {
+			s += 1;
+		}
+	}
+	(void) snprintf(mat-from, sizeof(mat-from), %.*s,
+		(int)(s - arg) - 1, arg + 1);
+	for (mid = s++ ; *s  *s != *arg ; s++) {
+		if (*s == '\\') {
+			s += 1;
+		}
+	}
+	(void) snprintf(mat-to, sizeof(mat-to), %.*s,
+		(int)(s - mid) - 1, mid + 1);
+	if ((mat-re = calloc(sizeof(regex_t), 1)) == NULL) {
+		(void) fprintf(stderr, bad calloc '%s'\n, mat-from);
+		return 0;
+	}
+	if (regcomp(mat-re, mat-from, REG_EXTENDED) != 0) {
+		(void) fprintf(stderr, bad regexp '%s'\n, mat-from);
+		return 0;
+	}
+	return 1;
+}
+
 /***/
 
 /* tar personality for mat */
@@ -138,7 +170,7 @@
 		(void) snprintf(newarg, sizeof(newarg), -%s, argv[1]);
 		argv[1] = newarg;
 	}
-	while ((i = getopt(argc, argv, C:T:Vacf:ptvx)) != -1) {
+	while ((i = getopt(argc, argv, C:T:Vacf:ps:tvx)) != -1) {
 		switch(i) {
 		case 'C':
 			dir = optarg;
@@ -161,6 +193,11 @@
 		case 'p':
 			mat.preserve = 1;
 			break;
+		case 's':
+			if (!compile_subst(mat, optarg)) {
+return 0;
+			}
+			break;
 		case 't':
 			action = list;
 			break;
@@ -286,7 +323,7 @@
 	ok = 1;
 	action = list;
 	deltemp = 0;
-	while ((i = getopt(argc, argv, C:Vaf:lrwv)) != -1) {
+	while ((i = getopt(argc, argv, C:Vaf:lrs:wv)) != -1) {
 		switch(i) {
 		case 'C':
 			dir = optarg;
@@ -306,6 +343,12 @@
 		case 'r':
 			action = extract;
 			break;
+		case 's':
+			if (!compile_subst(mat, optarg)) {
+(void) fprintf(stderr, bad regexp '%s'\n, optarg);
+return 0;
+			}
+			break;
 		case 'w':
 			action = create;
 			break;
Index: othersrc/external/bsd/mat/dist/mat.c
diff -u othersrc/external/bsd/mat/dist/mat.c:1.2 othersrc/external/bsd/mat/dist/mat.c:1.3
--- othersrc/external/bsd/mat/dist/mat.c:1.2	Tue Jun 21 04:21:24 2011
+++ othersrc/external/bsd/mat/dist/mat.c	Sat Jun 25 17:05:34 2011
@@ -31,6 +31,7 @@
 #include grp.h
 #include inttypes.h
 #include pwd.h
+#include regex.h
 #include sha2.h
 #include stdio.h
 #include stdlib.h
@@ -70,10 +71,11 @@
 
 /* structure used in extracting components from archives */
 typedef struct extract_t {
-	uint64_t	off;		/* offset in archive */
-	int		preserve;	/* preserve file times and owners */

CVS commit: src/external/bsd/fetch/dist/libfetch

2011-06-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 25 17:13:35 UTC 2011

Modified Files:
src/external/bsd/fetch/dist/libfetch: ftp.c

Log Message:
It is a lot nicer to getenv() what you need once and makes the code a lot
more readable.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11 -r1.2 src/external/bsd/fetch/dist/libfetch/ftp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.1.1.11 src/external/bsd/fetch/dist/libfetch/ftp.c:1.2
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.1.1.11	Wed Mar 24 16:51:44 2010
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Sat Jun 25 13:13:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.1.1.11 2010/03/24 20:51:44 joerg Exp $	*/
+/*	$NetBSD: ftp.c,v 1.2 2011/06/25 17:13:34 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -1097,17 +1097,22 @@
 ftp_get_proxy(struct url * url, const char *flags)
 {
 	struct url *purl;
-	char *p;
+	char *p, *fp, *FP, *hp, *HP;
 
 	if (flags != NULL  strchr(flags, 'd') != NULL)
-		return (NULL);
+		return NULL;
 	if (fetch_no_proxy_match(url-host))
-		return (NULL);
-	if (((p = getenv(FTP_PROXY)) || (p = getenv(ftp_proxy)) ||
-		(p = getenv(HTTP_PROXY)) || (p = getenv(http_proxy))) 
+		return NULL;
+
+	FP = getenv(FTP_PROXY);
+	fp = getenv(ftp_proxy);
+	HP = getenv(HTTP_PROXY);
+	hp = getenv(http_proxy);
+
+	if (((p = FP) || (p = fp) || (p = HP) || (p = hp))) 
 	*p  (purl = fetchParseURL(p)) != NULL) {
 		if (!*purl-scheme) {
-			if (getenv(FTP_PROXY) || getenv(ftp_proxy))
+			if (fp || FP)
 strcpy(purl-scheme, SCHEME_FTP);
 			else
 strcpy(purl-scheme, SCHEME_HTTP);
@@ -1116,10 +1121,10 @@
 			purl-port = fetch_default_proxy_port(purl-scheme);
 		if (strcasecmp(purl-scheme, SCHEME_FTP) == 0 ||
 		strcasecmp(purl-scheme, SCHEME_HTTP) == 0)
-			return (purl);
+			return purl;
 		fetchFreeURL(purl);
 	}
-	return (NULL);
+	return NULL;
 }
 
 /*



CVS commit: othersrc/external/bsd/mat/dist

2011-06-25 Thread Thomas Klausner
Module Name:othersrc
Committed By:   wiz
Date:   Sat Jun 25 17:19:56 UTC 2011

Modified Files:
othersrc/external/bsd/mat/dist: mat.1 matpax.1

Log Message:
Spelling.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 othersrc/external/bsd/mat/dist/mat.1
cvs rdiff -u -r1.5 -r1.6 othersrc/external/bsd/mat/dist/matpax.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/mat/dist/mat.1
diff -u othersrc/external/bsd/mat/dist/mat.1:1.8 othersrc/external/bsd/mat/dist/mat.1:1.9
--- othersrc/external/bsd/mat/dist/mat.1:1.8	Sat Jun 25 17:05:34 2011
+++ othersrc/external/bsd/mat/dist/mat.1	Sat Jun 25 17:19:55 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: mat.1,v 1.8 2011/06/25 17:05:34 agc Exp $
+.\ $NetBSD: mat.1,v 1.9 2011/06/25 17:19:55 wiz Exp $
 .\
 .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -91,14 +91,14 @@
 Setuid and setgid bits are only preserved
 if the program is run with an effective
 uid of 0.
-.It Fl s Ar substition
+.It Fl s Ar substitution
 The pathnames on entry or exit to the archive, depending on whether
 the archive is being created or used to extract components, are modified
 using an
 .Dv old
 and
 .Dv new
-subsitution pattern, in a similar manner to
+substitution pattern, in a similar manner to
 .Xr sed 1
 The first non-whitespace character of the pattern is taken to be the delimiter
 for the patterns, which itself can be escaped using the backslash character.

Index: othersrc/external/bsd/mat/dist/matpax.1
diff -u othersrc/external/bsd/mat/dist/matpax.1:1.5 othersrc/external/bsd/mat/dist/matpax.1:1.6
--- othersrc/external/bsd/mat/dist/matpax.1:1.5	Sat Jun 25 17:05:34 2011
+++ othersrc/external/bsd/mat/dist/matpax.1	Sat Jun 25 17:19:55 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: matpax.1,v 1.5 2011/06/25 17:05:34 agc Exp $
+.\ $NetBSD: matpax.1,v 1.6 2011/06/25 17:19:55 wiz Exp $
 .\
 .\ Copyright (c) 2011 Alistair Crooks a...@netbsd.org
 .\ All rights reserved.
@@ -34,7 +34,7 @@
 .Op Fl alrVvw
 .Op Fl C Ar directory
 .Op Fl f Ar archive
-.Op Fl s Ar substition
+.Op Fl s Ar substitution
 .Op Ar file ...
 .Sh DESCRIPTION
 The
@@ -84,14 +84,14 @@
 list the archive
 .It Fl r
 extract the named components from the archive.
-.It Fl s Ar substition
+.It Fl s Ar substitution
 The pathnames on entry or exit to the archive, depending on whether
 the archive is being created or used to extract components, are modified
 using an
 .Dv old
 and
 .Dv new
-subsitution pattern, in a similar manner to
+substitution pattern, in a similar manner to
 .Xr sed 1
 The first non-whitespace character of the pattern is taken to be the delimiter
 for the patterns, which itself can be escaped using the backslash character.



CVS commit: src/external/bsd/fetch/dist/libfetch

2011-06-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 25 20:13:03 UTC 2011

Modified Files:
src/external/bsd/fetch/dist/libfetch: ftp.c

Log Message:
add missing paren


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/fetch/dist/libfetch/ftp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.2 src/external/bsd/fetch/dist/libfetch/ftp.c:1.3
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.2	Sat Jun 25 13:13:34 2011
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Sat Jun 25 16:13:03 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.2 2011/06/25 17:13:34 christos Exp $	*/
+/*	$NetBSD: ftp.c,v 1.3 2011/06/25 20:13:03 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -144,8 +144,8 @@
 	if (sin6-sin6_family != AF_INET6 ||
 	!IN6_IS_ADDR_V4MAPPED(sin6-sin6_addr))
 		return;
-	sin4 = (struct sockaddr_in *)sin6;
-	addr = *(uint32_t *)sin6-sin6_addr.s6_addr[12];
+	sin4 = (struct sockaddr_in *)(void *)sin6;
+	addr = *(uint32_t *)(void *)sin6-sin6_addr.s6_addr[12];
 	port = sin6-sin6_port;
 	memset(sin4, 0, sizeof(struct sockaddr_in));
 	sin4-sin_addr.s_addr = addr;
@@ -1109,7 +1109,7 @@
 	HP = getenv(HTTP_PROXY);
 	hp = getenv(http_proxy);
 
-	if (((p = FP) || (p = fp) || (p = HP) || (p = hp))) 
+	if p = FP) || (p = fp) || (p = HP) || (p = hp))) 
 	*p  (purl = fetchParseURL(p)) != NULL) {
 		if (!*purl-scheme) {
 			if (fp || FP)



CVS commit: src/external/bsd/fetch/dist/libfetch

2011-06-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 25 20:27:02 UTC 2011

Modified Files:
src/external/bsd/fetch/dist/libfetch: common.c file.c ftp.c http.c

Log Message:
delint


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.9 -r1.2 src/external/bsd/fetch/dist/libfetch/common.c
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/bsd/fetch/dist/libfetch/file.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/fetch/dist/libfetch/ftp.c
cvs rdiff -u -r1.1.1.7 -r1.2 src/external/bsd/fetch/dist/libfetch/http.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/fetch/dist/libfetch/common.c
diff -u src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.9 src/external/bsd/fetch/dist/libfetch/common.c:1.2
--- src/external/bsd/fetch/dist/libfetch/common.c:1.1.1.9	Wed Mar 24 16:51:41 2010
+++ src/external/bsd/fetch/dist/libfetch/common.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.1.1.9 2010/03/24 20:51:41 joerg Exp $	*/
+/*	$NetBSD: common.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -539,7 +539,7 @@
 		}
 #ifdef WITH_SSL
 		if (conn-ssl != NULL)
-			rlen = SSL_read(conn-ssl, buf, len);
+			rlen = SSL_read(conn-ssl, buf, (int)len);
 		else
 #endif
 			rlen = read(conn-sd, buf, len);
@@ -588,7 +588,7 @@
 			return (-1);
 		if (len == 0)
 			break;
-		next = memchr(conn-buf + conn-buflen, '\n', len);
+		next = memchr(conn-buf + conn-buflen, '\n', (size_t)len);
 		conn-buflen += len;
 		if (conn-buflen == conn-bufsize  next == NULL) {
 			tmp = conn-buf;
@@ -674,7 +674,7 @@
 		errno = 0;
 #ifdef WITH_SSL
 		if (conn-ssl != NULL)
-			wlen = SSL_write(conn-ssl, buf, len);
+			wlen = SSL_write(conn-ssl, buf, (int)len);
 		else
 #endif
 #ifndef MSG_NOSIGNAL

Index: src/external/bsd/fetch/dist/libfetch/file.c
diff -u src/external/bsd/fetch/dist/libfetch/file.c:1.1.1.6 src/external/bsd/fetch/dist/libfetch/file.c:1.2
--- src/external/bsd/fetch/dist/libfetch/file.c:1.1.1.6	Thu Oct 15 08:59:59 2009
+++ src/external/bsd/fetch/dist/libfetch/file.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.c,v 1.1.1.6 2009/10/15 12:59:59 joerg Exp $	*/
+/*	$NetBSD: file.c,v 1.2 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009 Joerg Sonnenberger jo...@netbsd.org
@@ -204,7 +204,8 @@
 }
 
 int
-fetchStatFile(struct url *u, struct url_stat *us, const char *flags)
+/*ARGSUSED*/
+fetchStatFile(struct url *u, struct url_stat *us, const char *flags __unused)
 {
 	char *path;
 	int fd, rv;
@@ -229,7 +230,9 @@
 }
 
 int
-fetchListFile(struct url_list *ue, struct url *u, const char *pattern, const char *flags)
+/*ARGSUSED*/
+fetchListFile(struct url_list *ue, struct url *u, const char *pattern,
+const char *flags __unused)
 {
 	char *path;
 	struct dirent *de;

Index: src/external/bsd/fetch/dist/libfetch/ftp.c
diff -u src/external/bsd/fetch/dist/libfetch/ftp.c:1.3 src/external/bsd/fetch/dist/libfetch/ftp.c:1.4
--- src/external/bsd/fetch/dist/libfetch/ftp.c:1.3	Sat Jun 25 16:13:03 2011
+++ src/external/bsd/fetch/dist/libfetch/ftp.c	Sat Jun 25 16:27:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp.c,v 1.3 2011/06/25 20:13:03 christos Exp $	*/
+/*	$NetBSD: ftp.c,v 1.4 2011/06/25 20:27:01 christos Exp $	*/
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008, 2009, 2010 Joerg Sonnenberger jo...@netbsd.org
@@ -202,7 +202,7 @@
 	va_list ap;
 	size_t len;
 	char *msg;
-	int r;
+	ssize_t r;
 
 	va_start(ap, fmt);
 	len = vasprintf(msg, fmt, ap);
@@ -229,7 +229,7 @@
  * Return a pointer to the filename part of a path
  */
 static const char *
-ftp_filename(const char *file, int *len, int *type, int subdir)
+ftp_filename(const char *file, size_t *len, int *type, int subdir)
 {
 	const char *s;
 
@@ -256,6 +256,7 @@
 {
 	char *src, *dst, *end;
 	int q;
+	size_t len;
 
 	if (conn-err != FTP_WORKING_DIRECTORY 
 	conn-err != FTP_FILE_ACTION_OK)
@@ -264,7 +265,8 @@
 	src = conn-buf + 4;
 	if (src = end || *src++ != '')
 		return (FTP_PROTOCOL_ERROR);
-	*pwd = malloc(end - src + 1);
+	len = end - src + 1;
+	*pwd = malloc(len);
 	if (*pwd == NULL)
 		return (FTP_PROTOCOL_ERROR);
 	for (q = 0, dst = *pwd; src  end; ++src) {
@@ -295,7 +297,8 @@
 {
 	const char *beg, *end;
 	char *pwd, *dst;
-	int e, i, len;
+	int e;
+	size_t i, len;
 
 	if (*path != '/') {
 		ftp_seterr(501);
@@ -342,7 +345,7 @@
 		len = strlen(pwd);
 
 		/* Look for a common prefix between PWD and dir to fetch. */
-		for (i = 0; i = len  i = end - dst; ++i)
+		for (i = 0; i = len  i = (size_t)(end - dst); ++i)
 			if (pwd[i] != dst[i])
 break;
 		/* Keep going up a dir until we have a matching prefix. */
@@ -409,6 +412,7 @@
 	case 0:
 	case 's':
 		mode = 'S';
+		/*FALLTHROUGH*/
 	case 'S':
 		break;
 	default:
@@