CVS commit: src/usr.sbin/inetd

2017-02-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Feb 15 02:48:31 UTC 2017

Modified Files:
src/usr.sbin/inetd: inetd.c

Log Message:
Increase buffer size reported to strlcpy() to be one larger than the
length of the string we copy in so that there is space for the '\0'.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/usr.sbin/inetd/inetd.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/inetd/inetd.c
diff -u src/usr.sbin/inetd/inetd.c:1.122 src/usr.sbin/inetd/inetd.c:1.123
--- src/usr.sbin/inetd/inetd.c:1.122	Sat Apr  5 23:36:10 2014
+++ src/usr.sbin/inetd/inetd.c	Wed Feb 15 02:48:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $	*/
+/*	$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)inetd.c	8.4 (Berkeley) 4/13/94";
 #else
-__RCSID("$NetBSD: inetd.c,v 1.122 2014/04/05 23:36:10 khorben Exp $");
+__RCSID("$NetBSD: inetd.c,v 1.123 2017/02/15 02:48:31 elric Exp $");
 #endif
 #endif /* not lint */
 
@@ -850,7 +850,7 @@ config(void)
 			}
 			(void)unlink(sep->se_service);
 			strlcpy(sep->se_ctrladdr_un.sun_path,
-			sep->se_service, n);
+			sep->se_service, n + 1);
 			sep->se_ctrladdr_un.sun_family = AF_LOCAL;
 			sep->se_ctrladdr_size = (int)(n +
 			sizeof(sep->se_ctrladdr_un) -



CVS commit: src/libexec/httpd

2016-01-02 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sat Jan  2 18:40:13 UTC 2016

Modified Files:
src/libexec/httpd: bozohttpd.c bozohttpd.h

Log Message:
Add the concept of ``reply headers'', that is a SIMPLEQ of headers that
will be included in the HTTP reply.  We define this as we are about to
add an authentication method that may need to have a conversation with
the client.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.43 -r1.44 src/libexec/httpd/bozohttpd.h

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.77 src/libexec/httpd/bozohttpd.c:1.78
--- src/libexec/httpd/bozohttpd.c:1.77	Thu Dec 31 04:58:43 2015
+++ src/libexec/httpd/bozohttpd.c	Sat Jan  2 18:40:13 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.77 2015/12/31 04:58:43 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.78 2016/01/02 18:40:13 elric Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -347,6 +347,13 @@ bozo_clean_request(bozo_httpreq_t *reque
 		free(ohdr);
 		ohdr = hdr;
 	}
+	for (hdr = SIMPLEQ_FIRST(>hr_replheaders); hdr;
+	hdr = SIMPLEQ_NEXT(hdr, h_next)) {
+		free(hdr->h_value);
+		free(hdr->h_header);
+		free(ohdr);
+		ohdr = hdr;
+	}
 	free(ohdr);
 
 	free(request);
@@ -363,20 +370,33 @@ alarmer(int sig)
 }
 
 /*
+ * a list of header quirks: currently, a list of headers that
+ * can't be folded into a single line.
+ */
+const char *header_quirks[] = { "WWW-Authenticate", NULL };
+
+/*
  * add or merge this header (val: str) into the requests list
  */
 static bozoheaders_t *
-addmerge_header(bozo_httpreq_t *request, char *val,
-		char *str, ssize_t len)
+addmerge_header(bozo_httpreq_t *request, struct qheaders *headers,
+		const char *val, const char *str, ssize_t len)
 {
 	struct	bozohttpd_t *httpd = request->hr_httpd;
-	struct	bozoheaders *hdr;
+	struct bozoheaders	 *hdr = NULL;
+	const char		**quirk;
 
 	USE_ARG(len);
-	/* do we exist already? */
-	SIMPLEQ_FOREACH(hdr, >hr_headers, h_next) {
-		if (strcasecmp(val, hdr->h_header) == 0)
+	for (quirk = header_quirks; *quirk; quirk++)
+		if (strcasecmp(*quirk, val) == 0)
 			break;
+
+	if (*quirk == NULL) {
+		/* do we exist already? */
+		SIMPLEQ_FOREACH(hdr, headers, h_next) {
+			if (strcasecmp(val, hdr->h_header) == 0)
+break;
+		}
 	}
 
 	if (hdr) {
@@ -396,13 +416,30 @@ addmerge_header(bozo_httpreq_t *request,
 		else
 			hdr->h_value = bozostrdup(httpd, request, " ");
 
-		SIMPLEQ_INSERT_TAIL(>hr_headers, hdr, h_next);
+		SIMPLEQ_INSERT_TAIL(headers, hdr, h_next);
 		request->hr_nheaders++;
 	}
 
 	return hdr;
 }
 
+bozoheaders_t *
+addmerge_reqheader(bozo_httpreq_t *request, const char *val, const char *str,
+		   ssize_t len)
+{
+
+	return addmerge_header(request, >hr_headers, val, str, len);
+}
+
+bozoheaders_t *
+addmerge_replheader(bozo_httpreq_t *request, const char *val, const char *str,
+		ssize_t len)
+{
+
+	return addmerge_header(request, >hr_replheaders,
+	val, str, len);
+}
+
 /*
  * as the prototype string is not constant (eg, "HTTP/1.1" is equivalent
  * to "HTTP/001.01"), we MUST parse this.
@@ -538,6 +575,7 @@ bozo_read_request(bozohttpd_t *httpd)
 	request->hr_virthostname = NULL;
 	request->hr_file = NULL;
 	request->hr_oldfile = NULL;
+	SIMPLEQ_INIT(>hr_replheaders);
 	bozo_auth_init(request);
 
 	slen = sizeof(ss);
@@ -673,7 +711,7 @@ bozo_read_request(bozohttpd_t *httpd)
 			if (bozo_auth_check_headers(request, val, str, len))
 goto next_header;
 
-			hdr = addmerge_header(request, val, str, len);
+			hdr = addmerge_reqheader(request, val, str, len);
 
 			if (strcasecmp(hdr->h_header, "content-type") == 0)
 request->hr_content_type = hdr->h_value;
@@ -1680,6 +1718,12 @@ bozo_print_header(bozo_httpreq_t *reques
 	bozohttpd_t *httpd = request->hr_httpd;
 	off_t len;
 	char	date[40];
+	bozoheaders_t *hdr;
+
+	SIMPLEQ_FOREACH(hdr, >hr_replheaders, h_next) {
+		bozo_printf(httpd, "%s: %s\r\n", hdr->h_header,
+hdr->h_value);
+	}
 
 	bozo_printf(httpd, "Date: %s\r\n", bozo_http_date(date, sizeof(date)));
 	bozo_printf(httpd, "Server: %s\r\n", httpd->server_software);
@@ -1901,6 +1945,7 @@ bozo_http_error(bozohttpd_t *httpd, int 
 	const char *proto = (request && request->hr_proto) ?
 request->hr_proto : httpd->consts.http_11;
 	int	size;
+	bozoheaders_t *hdr;
 
 	debug((httpd, DEBUG_FAT, "bozo_http_error %d: %s", code, msg));
 	if (header == NULL || reason == NULL) {
@@ -1963,8 +2008,14 @@ bozo_http_error(bozohttpd_t *httpd, int 
 		size = 0;
 
 	bozo_printf(httpd, "%s %s\r\n", proto, header);
-	if (request)
+
+	if (request) {
 		bozo_auth_check_401(request, code);
+		SIMPLEQ_FOREACH(hdr, >hr_replheaders, h_next) {
+			bozo_printf(httpd, "%s: %s\r\n", hdr->h_header,
+	hdr->h_value);
+		}
+	}
 
 	bozo_printf(httpd, "Content-Type: text/html\r\n");
 	

CVS commit: src/libexec/httpd

2016-01-02 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sat Jan  2 20:35:59 UTC 2016

Modified Files:
src/libexec/httpd: bozohttpd.c

Log Message:
Fix bug in cleanup of reply headers.


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/libexec/httpd/bozohttpd.c

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

Modified files:

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.78 src/libexec/httpd/bozohttpd.c:1.79
--- src/libexec/httpd/bozohttpd.c:1.78	Sat Jan  2 18:40:13 2016
+++ src/libexec/httpd/bozohttpd.c	Sat Jan  2 20:35:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.78 2016/01/02 18:40:13 elric Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.79 2016/01/02 20:35:59 elric Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -347,6 +347,8 @@ bozo_clean_request(bozo_httpreq_t *reque
 		free(ohdr);
 		ohdr = hdr;
 	}
+	free(ohdr);
+	ohdr = NULL;
 	for (hdr = SIMPLEQ_FIRST(>hr_replheaders); hdr;
 	hdr = SIMPLEQ_NEXT(hdr, h_next)) {
 		free(hdr->h_value);



CVS commit: src/bin/hostname

2014-02-13 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Feb 13 12:00:29 UTC 2014

Modified Files:
src/bin/hostname: hostname.1 hostname.c

Log Message:
Remove options added in 1.18, commitid: UhxHPgtT2Pzeg4Yw due to some
level of controversy about their inclusion.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/bin/hostname/hostname.1
cvs rdiff -u -r1.20 -r1.21 src/bin/hostname/hostname.c

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

Modified files:

Index: src/bin/hostname/hostname.1
diff -u src/bin/hostname/hostname.1:1.19 src/bin/hostname/hostname.1:1.20
--- src/bin/hostname/hostname.1:1.19	Fri Jul 19 11:19:23 2013
+++ src/bin/hostname/hostname.1	Thu Feb 13 12:00:29 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: hostname.1,v 1.19 2013/07/19 11:19:23 wiz Exp $
+.\	$NetBSD: hostname.1,v 1.20 2014/02/13 12:00:29 elric Exp $
 .\
 .\ Copyright (c) 1983, 1988, 1990, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)hostname.1	8.2 (Berkeley) 4/28/95
 .\
-.Dd July 19, 2013
+.Dd April 28, 1995
 .Dt HOSTNAME 1
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd set or print name of current host system
 .Sh SYNOPSIS
 .Nm
-.Op Fl AadfIis
+.Op Fl s
 .Op Ar name-of-host
 .Sh DESCRIPTION
 .Nm
@@ -50,36 +50,14 @@ time.
 .Pp
 Options:
 .Bl -tag -width flag
-.It Fl A
-Display the FQDN of each address on all interfaces.
-.It Fl a
-Display alias name(s) of the host.
-.It Fl d
-Display the DNS domain.
-.It Fl f
-Display the FQDN for the hostname.
-.It Fl I
-Display each IP address on all interfaces.
-.It Fl i
-Display the IP address(es) for the hostname.
 .It Fl s
-Display the short hostname.
+Trims off any domain information from the printed
+name.
 .El
-.Sh NOTES
-With the exception of
-.Fl I
-and
-.Fl s ,
-the other options will retrieve their results from the resolver.
 .Sh SEE ALSO
 .Xr domainname 1 ,
-.Xr getaddrinfo 3 ,
-.Xr gethostbyname 3 ,
 .Xr gethostname 3 ,
-.Xr getifaddrs 3 ,
-.Xr getnameinfo 3 ,
-.Xr sethostname 3 ,
-.Xr hosts 5
+.Xr sethostname 3
 .Sh HISTORY
 The
 .Nm

Index: src/bin/hostname/hostname.c
diff -u src/bin/hostname/hostname.c:1.20 src/bin/hostname/hostname.c:1.21
--- src/bin/hostname/hostname.c:1.20	Fri Jul 19 15:53:00 2013
+++ src/bin/hostname/hostname.c	Thu Feb 13 12:00:29 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: hostname.c,v 1.20 2013/07/19 15:53:00 christos Exp $ */
+/* $NetBSD: hostname.c,v 1.21 2014/02/13 12:00:29 elric Exp $ */
 
 /*
  * Copyright (c) 1988, 1993
@@ -39,19 +39,13 @@ __COPYRIGHT(@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = @(#)hostname.c	8.2 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: hostname.c,v 1.20 2013/07/19 15:53:00 christos Exp $);
+__RCSID($NetBSD: hostname.c,v 1.21 2014/02/13 12:00:29 elric Exp $);
 #endif
 #endif /* not lint */
 
 #include sys/param.h
-#include sys/socket.h
-
-#include net/if.h
-#include netinet/in.h
 
 #include err.h
-#include ifaddrs.h
-#include netdb.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -62,36 +56,13 @@ __dead static void usage(void);
 int
 main(int argc, char *argv[])
 {
-	int ch, Aflag, aflag, dflag, Iflag, iflag, fflag, sflag, i;
+	int ch, sflag;
 	char *p, hostname[MAXHOSTNAMELEN + 1];
-	struct addrinfo hints, *ainfos, *ai;
-	struct hostent *hent;
-	struct ifaddrs *ifa, *ifp;
-	struct sockaddr_in6 *sin6;
-	char buf[MAX(MAXHOSTNAMELEN + 1, INET6_ADDRSTRLEN)];
 
 	setprogname(argv[0]);
-	Aflag = aflag = dflag = Iflag = iflag = fflag = sflag = 0;
-	while ((ch = getopt(argc, argv, AadIifs)) != -1)
+	sflag = 0;
+	while ((ch = getopt(argc, argv, s)) != -1)
 		switch (ch) {
-		case 'A':
-			Aflag = 1;
-			break;
-		case 'a':
-			aflag = 1;
-			break;
-		case 'd':
-			dflag = 1;
-			break;
-		case 'I':
-			Iflag = 1;
-			break;
-		case 'i':
-			iflag = 1;
-			break;
-		case 'f':
-			fflag = 1;
-			break;
 		case 's':
 			sflag = 1;
 			break;
@@ -108,90 +79,13 @@ main(int argc, char *argv[])
 	if (*argv) {
 		if (sethostname(*argv, strlen(*argv)))
 			err(1, sethostname);
-	} else if (Aflag || Iflag) {
-		if (getifaddrs(ifa) == -1)
-			err(1, getifaddrs);
-		for (ifp = ifa; ifp; ifp = ifp-ifa_next) {
-			if (ifp-ifa_addr == NULL ||
-			ifp-ifa_flags  IFF_LOOPBACK ||
-			!(ifp-ifa_flags  IFF_UP))
-continue;
-
-			switch(ifp-ifa_addr-sa_family) {
-			case AF_INET:
-break;
-			case AF_INET6:
-/* Skip link local addresses */
-sin6 = (struct sockaddr_in6 *)ifp-ifa_addr;
-if (IN6_IS_ADDR_LINKLOCAL(sin6-sin6_addr) ||
-IN6_IS_ADDR_MC_LINKLOCAL(sin6-sin6_addr))
-	continue;
-break;
-			default:
-/* We only translate IPv4 or IPv6 addresses */
-continue;
-			}
-			i = getnameinfo(ifp-ifa_addr, ifp-ifa_addr-sa_len,
-			buf, sizeof(buf), NULL, 0,
-			Iflag ? NI_NUMERICHOST: NI_NAMEREQD);
-			if (i) {
-if (Iflag  i != EAI_NONAME)
-	errx(1, getnameinfo: %s,
-	gai_strerror(i));
-			} else
-printf(%s\n, buf);
-		}
-		

CVS commit: src/lib/libc/sys

2013-08-02 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Aug  2 14:10:46 UTC 2013

Modified Files:
src/lib/libc/sys: accept.2

Log Message:
Update accept(2) to indicate that paccept honours SOCK_NOSIGPIPE in its
flags argument.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/sys/accept.2

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

Modified files:

Index: src/lib/libc/sys/accept.2
diff -u src/lib/libc/sys/accept.2:1.29 src/lib/libc/sys/accept.2:1.30
--- src/lib/libc/sys/accept.2:1.29	Mon Mar 19 09:34:36 2012
+++ src/lib/libc/sys/accept.2	Fri Aug  2 14:10:46 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: accept.2,v 1.29 2012/03/19 09:34:36 plunky Exp $
+.\	$NetBSD: accept.2,v 1.30 2013/08/02 14:10:46 elric Exp $
 .\
 .\ Copyright (c) 1983, 1990, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -147,6 +147,8 @@ on the returned file descriptor:
 Set the close on exec property.
 .It Dv SOCK_NONBLOCK
 Sets non-blocking I/O.
+.It Dv SOCK_NOSIGPIPE
+Return EPIPE instead of raising SIGPIPE.
 .El
 .Pp
 It can also temporarily replace the signal mask of the calling thread if



CVS commit: src/crypto/external/bsd/libsaslc/dist/src

2013-05-16 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu May 16 13:02:12 UTC 2013

Modified Files:
src/crypto/external/bsd/libsaslc/dist/src: mech_gssapi.c

Log Message:
AUTHCID is optional for the GSSAPI mechanism.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c

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/libsaslc/dist/src/mech_gssapi.c
diff -u src/crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c:1.6 src/crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c:1.7
--- src/crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c:1.6	Sun Feb 20 01:59:46 2011
+++ src/crypto/external/bsd/libsaslc/dist/src/mech_gssapi.c	Thu May 16 13:02:12 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mech_gssapi.c,v 1.6 2011/02/20 01:59:46 christos Exp $ */
+/* $NetBSD: mech_gssapi.c,v 1.7 2013/05/16 13:02:12 elric Exp $ */
 
 /* Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -35,7 +35,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: mech_gssapi.c,v 1.6 2011/02/20 01:59:46 christos Exp $);
+__RCSID($NetBSD: mech_gssapi.c,v 1.7 2013/05/16 13:02:12 elric Exp $);
 
 #include assert.h
 #include errno.h
@@ -582,21 +582,18 @@ wrap_output_token(saslc_sess_t *sess, gs
 	/* through fourth octets containing in network byte order the   */
 	/* maximum size output_message the client is able to receive, and   */
 	/* the remaining octets containing the authorization identity.  The */
-	/* client passes the data to GSS_Wrap with conf_flag set to FALSE,  */
-	/* and responds with the generated output_message.  The client can  */
-	/* then consider the server authenticated.  */
+	/* authorization identity is optional in mechanisms where it is */
+	/* encoded in the exchange such as GSSAPI.  The client passes the   */
+	/* data to GSS_Wrap with conf_flag set to FALSE, and responds with  */
+	/* the generated output_message.  The client can then consider the  */
+	/* server authenticated.*/
 	//
 
 	ms = sess-mech_sess;
 
-	if ((authcid = saslc_sess_getprop(sess, SASLC_GSSAPI_AUTHCID))
-	== NULL) {
-		saslc__error_set(ERR(sess), ERROR_MECH,
-		authcid is required for an authentication);
-		return -1;
-	}
+	authcid = saslc_sess_getprop(sess, SASLC_GSSAPI_AUTHCID);
 
-	len = asprintf(input_value, qmax%s, authcid);
+	len = asprintf(input_value, qmax%s, authcid ? authcid : );
 	if (len == -1) {
 		saslc__error_set_errno(ERR(sess), ERROR_NOMEM);
 		return -1;



CVS commit: src/crypto/external/bsd/libsaslc/dist/man

2013-05-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Tue May 14 15:33:21 UTC 2013

Modified Files:
src/crypto/external/bsd/libsaslc/dist/man: libsaslc.3

Log Message:
principals have principles.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \
src/crypto/external/bsd/libsaslc/dist/man/libsaslc.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/libsaslc/dist/man/libsaslc.3
diff -u src/crypto/external/bsd/libsaslc/dist/man/libsaslc.3:1.14 src/crypto/external/bsd/libsaslc/dist/man/libsaslc.3:1.15
--- src/crypto/external/bsd/libsaslc/dist/man/libsaslc.3:1.14	Fri Sep 23 16:22:00 2011
+++ src/crypto/external/bsd/libsaslc/dist/man/libsaslc.3	Tue May 14 15:33:21 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: libsaslc.3,v 1.14 2011/09/23 16:22:00 wiz Exp $
+.\	$NetBSD: libsaslc.3,v 1.15 2013/05/14 15:33:21 elric Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -682,7 +682,7 @@ to the file
 .Pa /etc/saslc.d/postfix/mech/GSSAPI.conf
 so that the
 .Em postfix
-principle will be used for authentication.
+principal will be used for authentication.
 Enable
 .Em SASL
 in the smtp client.



CVS commit: src/lib/libc/sys

2013-04-23 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Tue Apr 23 23:39:13 UTC 2013

Modified Files:
src/lib/libc/sys: pipe.2

Log Message:
For pipe2(2), EINVAL won't be returned if the flag is O_NOSIGPIPE.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/sys/pipe.2

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

Modified files:

Index: src/lib/libc/sys/pipe.2
diff -u src/lib/libc/sys/pipe.2:1.28 src/lib/libc/sys/pipe.2:1.29
--- src/lib/libc/sys/pipe.2:1.28	Wed Jan 25 00:28:35 2012
+++ src/lib/libc/sys/pipe.2	Tue Apr 23 23:39:13 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: pipe.2,v 1.28 2012/01/25 00:28:35 christos Exp $
+.\	$NetBSD: pipe.2,v 1.29 2013/04/23 23:39:13 elric Exp $
 .\
 .\ Copyright (c) 1980, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -135,7 +135,8 @@ will also fail if:
 .It Bq Er EINVAL
 .Fa flags
 is other than
-.Dv O_NONBLOCK
+.Dv O_NONBLOCK ,
+.Dv O_NOSIGPIPE
 or
 .Dv O_CLOEXEC .
 .El



CVS commit: src/sys/dev

2012-05-29 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Tue May 29 10:20:34 UTC 2012

Modified Files:
src/sys/dev: dksubr.c

Log Message:
Fix 32/64 bit int truncation issue.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/dksubr.c

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

Modified files:

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.44 src/sys/dev/dksubr.c:1.45
--- src/sys/dev/dksubr.c:1.44	Fri May 25 14:25:39 2012
+++ src/sys/dev/dksubr.c	Tue May 29 10:20:33 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.44 2012/05/25 14:25:39 elric Exp $ */
+/* $NetBSD: dksubr.c,v 1.45 2012/05/29 10:20:33 elric Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.44 2012/05/25 14:25:39 elric Exp $);
+__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.45 2012/05/29 10:20:33 elric Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -635,9 +635,7 @@ dk_set_properties(struct dk_intf *di, st
 
 	geom = prop_dictionary_create();
 
-	prop_dictionary_set_uint64(geom, sectors-per-unit,
-	dksc-sc_geom.pdg_nsectors * dksc-sc_geom.pdg_ntracks *
-	dksc-sc_geom.pdg_ncylinders);
+	prop_dictionary_set_uint64(geom, sectors-per-unit, dksc-sc_size);
 
 	prop_dictionary_set_uint32(geom, sector-size,
 	dksc-sc_geom.pdg_secsize);



CVS commit: src/sys/dev

2012-05-25 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri May 25 10:53:46 UTC 2012

Modified Files:
src/sys/dev: cgd.c cgdvar.h dksubr.c dkvar.h

Log Message:
Modify dksubr.c to add a function that sets the disk properties in
the drvctl framework.  And call this new functionality from cgd(4),
the consumer of dksubr.c.  We do this to allow gpt(8) to be able
to label cgd(4) disks.  We also add in some DIOCGSECTORSIZE logic
and we ensure that the WEDGE ioctls are not called on either
uninitialised disks or disks which have not been opened for write
access.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/cgd.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/cgdvar.h
cvs rdiff -u -r1.42 -r1.43 src/sys/dev/dksubr.c
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/dkvar.h

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

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.76 src/sys/dev/cgd.c:1.77
--- src/sys/dev/cgd.c:1.76	Sun Nov 13 23:03:24 2011
+++ src/sys/dev/cgd.c	Fri May 25 10:53:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.76 2011/11/13 23:03:24 christos Exp $ */
+/* $NetBSD: cgd.c,v 1.77 2012/05/25 10:53:46 elric Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cgd.c,v 1.76 2011/11/13 23:03:24 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: cgd.c,v 1.77 2012/05/25 10:53:46 elric Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -185,9 +185,9 @@ cgd_attach(device_t parent, device_t sel
 {
 	struct cgd_softc *sc = device_private(self);
 
-	sc-sc_dev = self;
 	simple_lock_init(sc-sc_slock);
-	dk_sc_init(sc-sc_dksc, sc, device_xname(sc-sc_dev));
+	dk_sc_init(sc-sc_dksc, device_xname(self));
+	sc-sc_dksc.sc_dev = self;
 	disk_init(sc-sc_dksc.sc_dkdev, sc-sc_dksc.sc_xname, cgddkdriver);
 
 	 if (!pmf_device_register(self, NULL, NULL))
@@ -278,8 +278,8 @@ cgdclose(dev_t dev, int flags, int fmt, 
 		return error;
 
 	if ((dksc-sc_flags  DKF_INITED) == 0) {
-		if ((error = cgd_destroy(cs-sc_dev)) != 0) {
-			aprint_error_dev(cs-sc_dev,
+		if ((error = cgd_destroy(cs-sc_dksc.sc_dev)) != 0) {
+			aprint_error_dev(dksc-sc_dev,
 			unable to detach instance\n);
 			return error;
 		}
@@ -336,7 +336,7 @@ cgdsize(dev_t dev)
 static void *
 cgd_getdata(struct dk_softc *dksc, unsigned long size)
 {
-	struct	cgd_softc *cs =dksc-sc_osc;
+	struct	cgd_softc *cs = (struct cgd_softc *)dksc;
 	void *	data = NULL;
 
 	simple_lock(cs-sc_slock);
@@ -355,7 +355,7 @@ cgd_getdata(struct dk_softc *dksc, unsig
 static void
 cgd_putdata(struct dk_softc *dksc, void *data)
 {
-	struct	cgd_softc *cs =dksc-sc_osc;
+	struct	cgd_softc *cs = (struct cgd_softc *)dksc;
 
 	if (data == cs-sc_data) {
 		simple_lock(cs-sc_slock);
@@ -369,7 +369,7 @@ cgd_putdata(struct dk_softc *dksc, void 
 static int
 cgdstart(struct dk_softc *dksc, struct buf *bp)
 {
-	struct	cgd_softc *cs = dksc-sc_osc;
+	struct	cgd_softc *cs = (struct cgd_softc *)dksc;
 	struct	buf *nbp;
 	void *	addr;
 	void *	newaddr;
@@ -681,6 +681,8 @@ cgd_ioctl_set(struct cgd_softc *cs, void
 
 	cs-sc_dksc.sc_flags |= DKF_INITED;
 
+	dk_set_properties(di, cs-sc_dksc);
+
 	/* Attach the disk. */
 	disk_attach(cs-sc_dksc.sc_dkdev);
 

Index: src/sys/dev/cgdvar.h
diff -u src/sys/dev/cgdvar.h:1.14 src/sys/dev/cgdvar.h:1.15
--- src/sys/dev/cgdvar.h:1.14	Tue Jan 12 21:08:09 2010
+++ src/sys/dev/cgdvar.h	Fri May 25 10:53:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdvar.h,v 1.14 2010/01/12 21:08:09 dyoung Exp $ */
+/* $NetBSD: cgdvar.h,v 1.15 2012/05/25 10:53:46 elric Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -69,7 +69,6 @@ struct cryptdata {
 };
 
 struct cgd_softc {
-	device_t		sc_dev;
 	struct dk_softc		 sc_dksc;	/* generic disk interface */
 	struct cryptinfo	*sc_crypt;	/* the alg/key/etc */
 	struct vnode		*sc_tvn;	/* target device's vnode */

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.42 src/sys/dev/dksubr.c:1.43
--- src/sys/dev/dksubr.c:1.42	Fri Nov 19 06:44:39 2010
+++ src/sys/dev/dksubr.c	Fri May 25 10:53:46 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.42 2010/11/19 06:44:39 dholland Exp $ */
+/* $NetBSD: dksubr.c,v 1.43 2012/05/25 10:53:46 elric Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.42 2010/11/19 06:44:39 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.43 2012/05/25 10:53:46 elric Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -48,7 +48,9 @@ __KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1
 
 #include dev/dkvar.h
 
-int	dkdebug = 0;
+int	dkdebug = 0xff;
+
+#define DEBUG 1
 
 #ifdef DEBUG
 #define DKDB_FOLLOW	0x1
@@ -70,11 +72,10 @@ int	dkdebug = 0;
 static void	dk_makedisklabel(struct dk_intf *, struct dk_softc *);
 
 void
-dk_sc_init(struct dk_softc *dksc, void *osc, const char *xname)

CVS commit: src/sys/dev

2012-05-25 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri May 25 14:25:39 UTC 2012

Modified Files:
src/sys/dev: dksubr.c

Log Message:
Revert a few lines of accidental commit.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/dksubr.c

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

Modified files:

Index: src/sys/dev/dksubr.c
diff -u src/sys/dev/dksubr.c:1.43 src/sys/dev/dksubr.c:1.44
--- src/sys/dev/dksubr.c:1.43	Fri May 25 10:53:46 2012
+++ src/sys/dev/dksubr.c	Fri May 25 14:25:39 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.43 2012/05/25 10:53:46 elric Exp $ */
+/* $NetBSD: dksubr.c,v 1.44 2012/05/25 14:25:39 elric Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.43 2012/05/25 10:53:46 elric Exp $);
+__KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1.44 2012/05/25 14:25:39 elric Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -48,9 +48,7 @@ __KERNEL_RCSID(0, $NetBSD: dksubr.c,v 1
 
 #include dev/dkvar.h
 
-int	dkdebug = 0xff;
-
-#define DEBUG 1
+int	dkdebug = 0;
 
 #ifdef DEBUG
 #define DKDB_FOLLOW	0x1



CVS commit: src/sys/arch/xen/xen

2012-05-25 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri May 25 15:03:38 UTC 2012

Modified Files:
src/sys/arch/xen/xen: xbd_xenbus.c

Log Message:
Update xdb_xenbus.c to new usage of routines in dksubr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/xen/xen/xbd_xenbus.c

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

Modified files:

Index: src/sys/arch/xen/xen/xbd_xenbus.c
diff -u src/sys/arch/xen/xen/xbd_xenbus.c:1.56 src/sys/arch/xen/xen/xbd_xenbus.c:1.57
--- src/sys/arch/xen/xen/xbd_xenbus.c:1.56	Wed Feb 22 16:53:46 2012
+++ src/sys/arch/xen/xen/xbd_xenbus.c	Fri May 25 15:03:38 2012
@@ -1,4 +1,4 @@
-/*  $NetBSD: xbd_xenbus.c,v 1.56 2012/02/22 16:53:46 jakllsch Exp $  */
+/*  $NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: xbd_xenbus.c,v 1.56 2012/02/22 16:53:46 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: xbd_xenbus.c,v 1.57 2012/05/25 15:03:38 elric Exp $);
 
 #include opt_xen.h
 
@@ -122,9 +122,7 @@ struct xbd_req {
 #define req_sync	u.req_sync
 
 struct xbd_xenbus_softc {
-	device_t sc_dev;
-	struct dk_softc sc_dksc;
-	struct dk_intf *sc_di;
+	struct dk_softc sc_dksc;	/* Must be first in this struct */
 	struct xenbus_device *sc_xbusd;
 
 	blkif_front_ring_t sc_ring;
@@ -212,7 +210,7 @@ static struct dk_intf dkintf_esdi = {
 	xbdclose,
 	xbdstrategy,
 	xbdstart,
-};
+}, *di = dkintf_esdi;
 
 static struct dkdriver xbddkdriver = {
 .d_strategy = xbdstrategy,
@@ -251,7 +249,8 @@ xbd_xenbus_attach(device_t parent, devic
 	config_pending_incr();
 	aprint_normal(: Xen Virtual Block Device Interface\n);
 
-	sc-sc_dev = self;
+	dk_sc_init(sc-sc_dksc, device_xname(self));
+	sc-sc_dksc.sc_dev = self;
 
 #ifdef XBD_DEBUG
 	printf(path: %s\n, xa-xa_xbusd-xbusd_path);
@@ -278,9 +277,7 @@ xbd_xenbus_attach(device_t parent, devic
 	sc-sc_xbusd = xa-xa_xbusd;
 	sc-sc_xbusd-xbusd_otherend_changed = xbd_backend_changed;
 
-	dk_sc_init(sc-sc_dksc, sc, device_xname(self));
 	disk_init(sc-sc_dksc.sc_dkdev, device_xname(self), xbddkdriver);
-	sc-sc_di = dkintf_esdi;
 	/* initialize free requests list */
 	SLIST_INIT(sc-sc_xbdreq_head);
 	for (i = 0; i  XBD_RING_SIZE; i++) {
@@ -521,7 +518,7 @@ static void xbd_backend_changed(void *ar
 	char buf[9];
 	int s;
 	DPRINTF((%s: new backend state %d\n,
-	device_xname(sc-sc_dev), new_state));
+	device_xname(sc-sc_dksc.sc_dev), new_state));
 
 	switch (new_state) {
 	case XenbusStateUnknown:
@@ -571,9 +568,9 @@ static void xbd_backend_changed(void *ar
 		sc-sc_backend_status = BLKIF_STATE_CONNECTED;
 
 		/* try to read the disklabel */
-		dk_getdisklabel(sc-sc_di, sc-sc_dksc, 0 /* XXX ? */);
+		dk_getdisklabel(di, sc-sc_dksc, 0 /* XXX ? */);
 		format_bytes(buf, sizeof(buf), sc-sc_sectors * sc-sc_secsize);
-		aprint_verbose_dev(sc-sc_dev,
+		aprint_verbose_dev(sc-sc_dksc.sc_dev,
 %s, %d bytes/sect x % PRIu64  sectors\n,
 buf, (int)pdg-pdg_secsize, sc-sc_xbdsize);
 		/* Discover wedges on this disk. */
@@ -593,7 +590,7 @@ static void xbd_backend_changed(void *ar
 		pdg-pdg_ncylinders);
 		prop_dictionary_set(disk_info, geometry, geom);
 		prop_object_release(geom);
-		prop_dictionary_set(device_properties(sc-sc_dev),
+		prop_dictionary_set(device_properties(sc-sc_dksc.sc_dev),
 		disk-info, disk_info);
 		/*
 		 * Don't release disk_info here; we keep a reference to it.
@@ -623,24 +620,28 @@ xbd_connect(struct xbd_xenbus_softc *sc)
 	sc-sc_xbusd-xbusd_path, virtual-device, sc-sc_handle, 10);
 	if (err)
 		panic(%s: can't read number from %s/virtual-device\n, 
-		device_xname(sc-sc_dev), sc-sc_xbusd-xbusd_otherend);
+		device_xname(sc-sc_dksc.sc_dev),
+		sc-sc_xbusd-xbusd_otherend);
 	err = xenbus_read_ull(NULL,
 	sc-sc_xbusd-xbusd_otherend, sectors, sectors, 10);
 	if (err)
 		panic(%s: can't read number from %s/sectors\n, 
-		device_xname(sc-sc_dev), sc-sc_xbusd-xbusd_otherend);
+		device_xname(sc-sc_dksc.sc_dev),
+		sc-sc_xbusd-xbusd_otherend);
 	sc-sc_sectors = sectors;
 
 	err = xenbus_read_ul(NULL,
 	sc-sc_xbusd-xbusd_otherend, info, sc-sc_info, 10);
 	if (err)
 		panic(%s: can't read number from %s/info\n, 
-		device_xname(sc-sc_dev), sc-sc_xbusd-xbusd_otherend);
+		device_xname(sc-sc_dksc.sc_dev),
+		sc-sc_xbusd-xbusd_otherend);
 	err = xenbus_read_ul(NULL,
 	sc-sc_xbusd-xbusd_otherend, sector-size, sc-sc_secsize, 10);
 	if (err)
 		panic(%s: can't read number from %s/sector-size\n, 
-		device_xname(sc-sc_dev), sc-sc_xbusd-xbusd_otherend);
+		device_xname(sc-sc_dksc.sc_dev),
+		sc-sc_xbusd-xbusd_otherend);
 
 	err = xenbus_read_ul(NULL, sc-sc_xbusd-xbusd_otherend,
 	feature-flush-cache, cache_flush, 10);
@@ -663,7 +664,7 @@ xbd_handler(void *arg)
 	int more_to_do;
 	int seg;
 
-	DPRINTF((xbd_handler(%s)\n, 

CVS commit: src/libexec/httpd

2012-02-20 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Mon Feb 20 08:40:46 UTC 2012

Modified Files:
src/libexec/httpd: ssl-bozo.c

Log Message:
Use a ``certificate chain file'' rather than a ``certificate file'' so
that bozohttpd can be used with non-toplevel certs.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/libexec/httpd/ssl-bozo.c

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

Modified files:

Index: src/libexec/httpd/ssl-bozo.c
diff -u src/libexec/httpd/ssl-bozo.c:1.13 src/libexec/httpd/ssl-bozo.c:1.14
--- src/libexec/httpd/ssl-bozo.c:1.13	Fri Nov 18 09:51:31 2011
+++ src/libexec/httpd/ssl-bozo.c	Mon Feb 20 08:40:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ssl-bozo.c,v 1.13 2011/11/18 09:51:31 mrg Exp $	*/
+/*	$NetBSD: ssl-bozo.c,v 1.14 2012/02/20 08:40:46 elric Exp $	*/
 
 /*	$eterna: ssl-bozo.c,v 1.15 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -176,8 +176,8 @@ bozo_ssl_init(bozohttpd_t *httpd)
 		bozo_ssl_err(httpd, EXIT_FAILURE,
 		SSL context creation failed);
 
-	if (1 != SSL_CTX_use_certificate_file(sslinfo-ssl_context,
-	sslinfo-certificate_file, SSL_FILETYPE_PEM))
+	if (1 != SSL_CTX_use_certificate_chain_file(sslinfo-ssl_context,
+	sslinfo-certificate_file))
 		bozo_ssl_err(httpd, EXIT_FAILURE,
 		Unable to use certificate file '%s',
 		sslinfo-certificate_file);



CVS commit: src/libexec/httpd

2012-02-20 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Mon Feb 20 09:26:56 UTC 2012

Modified Files:
src/libexec/httpd: bozohttpd.8 bozohttpd.c bozohttpd.h

Log Message:
Check in very basic compressed file support.  httpd will now serve
a precompressed .gz file if it exists, the client claims to support
gzip and the request is not ranged.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/libexec/httpd/bozohttpd.8
cvs rdiff -u -r1.30 -r1.31 src/libexec/httpd/bozohttpd.c
cvs rdiff -u -r1.20 -r1.21 src/libexec/httpd/bozohttpd.h

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

Modified files:

Index: src/libexec/httpd/bozohttpd.8
diff -u src/libexec/httpd/bozohttpd.8:1.32 src/libexec/httpd/bozohttpd.8:1.33
--- src/libexec/httpd/bozohttpd.8:1.32	Fri Nov 18 09:51:31 2011
+++ src/libexec/httpd/bozohttpd.8	Mon Feb 20 09:26:56 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: bozohttpd.8,v 1.32 2011/11/18 09:51:31 mrg Exp $
+.\	$NetBSD: bozohttpd.8,v 1.33 2012/02/20 09:26:56 elric Exp $
 .\
 .\	$eterna: bozohttpd.8,v 1.101 2011/11/18 01:25:11 mrg Exp $
 .\
@@ -408,6 +408,13 @@ To disable SSL SUPPORT compile
 with
 .Dq -DNO_SSL_SUPPORT
 on the compiler command line.
+.Ss COMPRESSION
+.Nm
+supports a very basic form compression.
+.Nm
+will serve the requested file postpended with ``.gz'' if
+it exists, it is readable, the client requested gzip compression, and
+the client did not make a ranged request.
 .Sh FILES
 .Nm
 looks for a couple of special files in directories that allow certain features

Index: src/libexec/httpd/bozohttpd.c
diff -u src/libexec/httpd/bozohttpd.c:1.30 src/libexec/httpd/bozohttpd.c:1.31
--- src/libexec/httpd/bozohttpd.c:1.30	Fri Nov 18 09:51:31 2011
+++ src/libexec/httpd/bozohttpd.c	Mon Feb 20 09:26:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.c,v 1.30 2011/11/18 09:51:31 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.c,v 1.31 2012/02/20 09:26:56 elric Exp $	*/
 
 /*	$eterna: bozohttpd.c,v 1.178 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -696,6 +696,9 @@ bozo_read_request(bozohttpd_t *httpd)
 			else if (strcasecmp(hdr-h_header,
 	if-modified-since) == 0)
 request-hr_if_modified_since = hdr-h_value;
+			else if (strcasecmp(hdr-h_header,
+	accept-encoding) == 0)
+request-hr_accept_encoding = hdr-h_value;
 
 			debug((httpd, DEBUG_FAT, adding header %s: %s,
 			hdr-h_header, hdr-h_value));
@@ -1350,6 +1353,53 @@ bad_done:
 }
 
 /*
+ * can_gzip checks if the request supports and prefers gzip encoding.
+ *
+ * XXX: we do not consider the associated q with gzip in making our
+ *  decision which is broken.
+ */
+
+static int
+can_gzip(bozo_httpreq_t *request)
+{
+	const char	*pos;
+	const char	*tmp;
+	size_t		 len;
+
+	/* First we decide if the request can be gzipped at all. */
+
+	/* not if we already are encoded... */
+	tmp = bozo_content_encoding(request, request-hr_file);
+	if (tmp  *tmp)
+		return 0;
+
+	/* not if we are not asking for the whole file... */
+	if (request-hr_last_byte_pos != -1 || request-hr_have_range)
+		return 0;
+
+	/* Then we determine if gzip is on the cards. */
+
+	for (pos = request-hr_accept_encoding; pos  *pos; pos += len) {
+		while (*pos == ' ')
+			pos++;
+
+		len = strcspn(pos, ;,);
+
+		if ((len == 4  strncasecmp(gzip, pos, 4) == 0) ||
+		(len == 6  strncasecmp(x-gzip, pos, 6) == 0))
+			return 1;
+
+		if (pos[len] == ';')
+			len += strcspn(pos[len], ,);
+
+		if (pos[len])
+			len++;
+	}
+
+	return 0;
+}
+
+/*
  * bozo_process_request does the following:
  *	- check the request is valid
  *	- process cgi-bin if necessary
@@ -1374,9 +1424,21 @@ bozo_process_request(bozo_httpreq_t *req
 	if (transform_request(request, isindex) == 0)
 		return;
 
+	fd = -1;
+	encoding = NULL;
+	if (can_gzip(request)) {
+		asprintf(file, %s.gz, request-hr_file);
+		fd = open(file, O_RDONLY);
+		if (fd = 0)
+			encoding = gzip;
+		free(file);
+	}
+
 	file = request-hr_file;
 
-	fd = open(file, O_RDONLY);
+	if (fd  0)
+		fd = open(file, O_RDONLY);
+
 	if (fd  0) {
 		debug((httpd, DEBUG_FAT, open failed: %s, strerror(errno)));
 		if (errno == EPERM)
@@ -1432,7 +1494,8 @@ bozo_process_request(bozo_httpreq_t *req
 
 	if (request-hr_proto != httpd-consts.http_09) {
 		type = bozo_content_type(request, file);
-		encoding = bozo_content_encoding(request, file);
+		if (!encoding)
+			encoding = bozo_content_encoding(request, file);
 
 		bozo_print_header(request, sb, type, encoding);
 		bozo_printf(httpd, \r\n);

Index: src/libexec/httpd/bozohttpd.h
diff -u src/libexec/httpd/bozohttpd.h:1.20 src/libexec/httpd/bozohttpd.h:1.21
--- src/libexec/httpd/bozohttpd.h:1.20	Fri Nov 18 09:51:31 2011
+++ src/libexec/httpd/bozohttpd.h	Mon Feb 20 09:26:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bozohttpd.h,v 1.20 2011/11/18 09:51:31 mrg Exp $	*/
+/*	$NetBSD: bozohttpd.h,v 1.21 2012/02/20 09:26:56 elric Exp $	*/
 
 /*	$eterna: bozohttpd.h,v 1.39 2011/11/18 09:21:15 mrg Exp $	*/
 
@@ -128,6 +128,7 @@ typedef struct 

CVS commit: src/sys/dev/pci

2011-10-08 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sat Oct  8 09:15:09 UTC 2011

Modified Files:
src/sys/dev/pci: if_iwnreg.h

Log Message:
Update from OpenBSD merging in 1.111 and 1.112 with log messages:

1.112   Differential gain calibration makes the 6005 firmware crap
out, so skip it for now until we figure out why.  This
probably means the device won't function optimally, but
that's better than not functioning at all.  Makes my Intel
Centrinto Advanced-N 6205 work quite well.

1.111   The 6005 and 6050-based parts need DC calibration turned
on, otherwise the firmware will crap out, at least on the
6005.  First step to getting my Intel Centrino Advanced-N
6205 to work.

Both are commited by kette...@openbsd.org.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/pci/if_iwnreg.h

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

Modified files:

Index: src/sys/dev/pci/if_iwnreg.h
diff -u src/sys/dev/pci/if_iwnreg.h:1.9 src/sys/dev/pci/if_iwnreg.h:1.10
--- src/sys/dev/pci/if_iwnreg.h:1.9	Sun May 15 13:56:20 2011
+++ src/sys/dev/pci/if_iwnreg.h	Sat Oct  8 09:15:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwnreg.h,v 1.9 2011/05/15 13:56:20 christos Exp $	*/
+/*	$NetBSD: if_iwnreg.h,v 1.10 2011/10/08 09:15:08 elric Exp $	*/
 /*	$OpenBSD: if_iwnreg.h,v 1.40 2010/05/05 19:41:57 damien Exp $	*/
 
 /*-
@@ -732,6 +732,7 @@ struct iwn5000_wimax_coex {
 struct iwn5000_calib_elem {
 	uint32_t	enable;
 	uint32_t	start;
+#define IWN5000_CALIB_DC	(1  1)
 	uint32_t	send;
 	uint32_t	apply;
 	uint32_t	reserved;



CVS commit: src/sys/dev/pci

2011-10-08 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sat Oct  8 11:07:09 UTC 2011

Modified Files:
src/sys/dev/pci: if_iwn.c

Log Message:
Use aprint_error_dev().


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.60 src/sys/dev/pci/if_iwn.c:1.61
--- src/sys/dev/pci/if_iwn.c:1.60	Sat Oct  8 10:21:16 2011
+++ src/sys/dev/pci/if_iwn.c	Sat Oct  8 11:07:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.60 2011/10/08 10:21:16 mbalmer Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.60 2011/10/08 10:21:16 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.61 2011/10/08 11:07:09 elric Exp $);
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -4126,8 +4126,8 @@ iwn_config(struct iwn_softc *sc)
 		/* Configure runtime DC calibration. */
 		error = iwn5000_runtime_calib(sc);
 		if (error != 0) {
-			printf(%s: could not configure runtime calibration\n,
-			device_xname(sc-sc_dev));
+			aprint_error_dev(sc-sc_dev,
+			could not configure runtime calibration\n);
 			return error;
 		}
 	}



CVS commit: src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 10:28:36 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et: Makefile

Log Message:
Change the location of version.h from the old Heimdal srcs to the
new srcs.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile

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/heimdal/lib/libcom_err/compile_et/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.2 src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.3
--- src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.2	Fri Apr 15 19:41:11 2011
+++ src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile	Sun Aug 28 10:28:35 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
+# $NetBSD: Makefile,v 1.3 2011/08/28 10:28:35 elric Exp $
 
 NOMAN=		# defined
 
@@ -37,7 +37,7 @@
 
 DPSRCS=		print_version.h
 
-make-print-version.lo: ${NETBSDSRCDIR}/include/heimdal/version.h
+make-print-version.lo: ${HEIMBASE}/include/version.h
 
 make-print-version: make-print-version.lo
 	${HOST_CC} ${HOST_LDFLAGS} -o ${.TARGET} ${.ALLSRC}



CVS commit: src/crypto/external/bsd/heimdal/lib/libvers

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 11:20:16 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libvers: Makefile

Log Message:
Change the location of version.h from the old Heimdal srcs to the
new srcs.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/lib/libvers/Makefile

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/heimdal/lib/libvers/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libvers/Makefile:1.1	Wed Apr 13 19:16:56 2011
+++ src/crypto/external/bsd/heimdal/lib/libvers/Makefile	Sun Aug 28 11:20:16 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:56 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/08/28 11:20:16 elric Exp $
 
 NOLINKLIB=	# defined
 NOPIC=		# defined
@@ -16,9 +16,9 @@
 SRCS=		print_version.c
 DPSRCS=		print_version.h
  
-HOST_CPPFLAGS+=	-I${NETBSDSRCDIR}/include/heimdal -DHAVE_CONFIG_H
+HOST_CPPFLAGS+=	-I${HEIMBASE}/include -DHAVE_CONFIG_H
 
-make-print-version.lo: ${NETBSDSRCDIR}/include/heimdal/version.h
+make-print-version.lo: ${HEIMBASE}/include/version.h
 
 make-print-version: make-print-version.lo
 	${HOST_CC} ${HOST_LDFLAGS} -o ${.TARGET} ${.ALLSRC}



CVS commit: src/sys/dev/pci

2011-08-28 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Aug 28 16:33:52 UTC 2011

Modified Files:
src/sys/dev/pci: if_iwn.c

Log Message:
Revert prior inadvertent checkin.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/if_iwn.c

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

Modified files:

Index: src/sys/dev/pci/if_iwn.c
diff -u src/sys/dev/pci/if_iwn.c:1.57 src/sys/dev/pci/if_iwn.c:1.58
--- src/sys/dev/pci/if_iwn.c:1.57	Sun Aug 28 16:26:29 2011
+++ src/sys/dev/pci/if_iwn.c	Sun Aug 28 16:33:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_iwn.c,v 1.57 2011/08/28 16:26:29 elric Exp $	*/
+/*	$NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $	*/
 /*	$OpenBSD: if_iwn.c,v 1.96 2010/05/13 09:25:03 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  * adapters.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.57 2011/08/28 16:26:29 elric Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_iwn.c,v 1.58 2011/08/28 16:33:51 elric Exp $);
 
 #define IWN_USE_RBUF	/* Use local storage for RX */
 #undef IWN_HWCRYPTO	/* XXX does not even compile yet */
@@ -305,7 +305,7 @@
 #ifdef IWN_DEBUG
 #define DPRINTF(x)	do { if (iwn_debug  0) printf x; } while (0)
 #define DPRINTFN(n, x)	do { if (iwn_debug = (n)) printf x; } while (0)
-int iwn_debug = 100;
+int iwn_debug = 0;
 #else
 #define DPRINTF(x)
 #define DPRINTFN(n, x)



CVS commit: src/crypto/external/bsd/heimdal/lib

2011-08-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Aug 25 00:25:47 UTC 2011

Removed Files:
src/crypto/external/bsd/heimdal/lib: Makefile.inc

Log Message:
This file should not have been imported.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r0 src/crypto/external/bsd/heimdal/lib/Makefile.inc

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



CVS commit: src/crypto/external/bsd/heimdal/dist/kdc

2011-08-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Tue Aug 16 01:14:58 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kdc: kerberos5.c

Log Message:
We shouldn't cast client_time to (intmax_t) because it is a char * not
an integer.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c

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/heimdal/dist/kdc/kerberos5.c
diff -u src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.2 src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.3
--- src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c:1.2	Mon Aug 15 21:00:49 2011
+++ src/crypto/external/bsd/heimdal/dist/kdc/kerberos5.c	Tue Aug 16 01:14:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kerberos5.c,v 1.2 2011/08/15 21:00:49 christos Exp $	*/
+/*	$NetBSD: kerberos5.c,v 1.3 2011/08/16 01:14:57 elric Exp $	*/
 
 /*
  * Copyright (c) 1997-2007 Kungliga Tekniska Högskolan
@@ -1266,7 +1266,7 @@
  		kdc_log(context, config, 0,
 			Too large time skew, 
 			client time %s is out by %jd  %jd seconds -- %s,
-			(intmax_t)client_time,
+			client_time,
 			imaxabs(kdc_time - p.patimestamp),
 			context-max_skew,
 			client_name);



CVS commit: src/doc

2011-05-11 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed May 11 10:11:11 UTC 2011

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Heimdal has been upgraded to 1.5pre1.


To generate a diff of this commit:
cvs rdiff -u -r1.836 -r1.837 src/doc/3RDPARTY
cvs rdiff -u -r1.1546 -r1.1547 src/doc/CHANGES

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.836 src/doc/3RDPARTY:1.837
--- src/doc/3RDPARTY:1.836	Wed May 11 09:37:52 2011
+++ src/doc/3RDPARTY	Wed May 11 10:11:11 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.836 2011/05/11 09:37:52 tron Exp $
+#	$NetBSD: 3RDPARTY,v 1.837 2011/05/11 10:11:11 elric Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -419,8 +419,8 @@
 for import.
 
 Package:	heimdal
-Version:	1.1
-Current Vers:	1.2.1
+Version:	1.5pre1
+Current Vers:	1.5pre1
 Maintainer:	Heimdal heim...@pdc.kth.se
 Archive Site:	ftp://ftp.pdc.kth.se/pub/heimdal/src/
 Home Page:	http://www.pdc.kth.se/heimdal/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1546 src/doc/CHANGES:1.1547
--- src/doc/CHANGES:1.1546	Wed May 11 09:37:52 2011
+++ src/doc/CHANGES	Wed May 11 10:11:11 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1546 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1547 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -997,6 +997,7 @@
 	sparc64: Add EDID (Extended Display Identification Data) reading,
 		and video mode setting support, to ffb(4). [jdc 20110408]
 	kernel: Bug fixes and improvements to POSIX semaphore. [rmind 20110411]
+	kerberos(8): Upgrade to Heimdal-1.5pre1. [elric 20110416]
 	kernel: Support for Darwin, Mach, IRIX and PECOFF emulation was
 		retired. [joerg 20110426]
 	balloon(4): Balloon driver now enabled for all Xen kernels.



CVS commit: src/crypto/external/bsd/openssh/dist

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 14:01:46 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: auth-krb5.c gss-serv-krb5.c
sshconnect1.c sshconnect2.c

Log Message:
Stop using functions that are marked as deprecated in Heimdal.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/auth-krb5.c \
src/crypto/external/bsd/openssh/dist/sshconnect1.c
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c
cvs rdiff -u -r1.6 -r1.7 src/crypto/external/bsd/openssh/dist/sshconnect2.c

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/openssh/dist/auth-krb5.c
diff -u src/crypto/external/bsd/openssh/dist/auth-krb5.c:1.2 src/crypto/external/bsd/openssh/dist/auth-krb5.c:1.3
--- src/crypto/external/bsd/openssh/dist/auth-krb5.c:1.2	Sun Jun  7 22:38:46 2009
+++ src/crypto/external/bsd/openssh/dist/auth-krb5.c	Sun Apr 24 14:01:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth-krb5.c,v 1.2 2009/06/07 22:38:46 christos Exp $	*/
+/*	$NetBSD: auth-krb5.c,v 1.3 2011/04/24 14:01:46 elric Exp $	*/
 /* $OpenBSD: auth-krb5.c,v 1.19 2006/08/03 03:34:41 deraadt Exp $ */
 /*
  *Kerberos v5 authentication and ticket-passing routines.
@@ -30,7 +30,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: auth-krb5.c,v 1.2 2009/06/07 22:38:46 christos Exp $);
+__RCSID($NetBSD: auth-krb5.c,v 1.3 2011/04/24 14:01:46 elric Exp $);
 #include sys/types.h
 #include pwd.h
 #include stdarg.h
@@ -80,6 +80,7 @@
 	krb5_principal server;
 	krb5_ticket *ticket;
 	int fd, ret;
+	const char *errtxt;
 
 	ret = 0;
 	server = NULL;
@@ -143,10 +144,14 @@
 	}
 
 	if (problem) {
+		errtxt = NULL;
 		if (authctxt-krb5_ctx != NULL)
-			debug(Kerberos v5 authentication failed: %s,
-			krb5_get_err_text(authctxt-krb5_ctx, problem));
-		else
+			errtxt = krb5_get_error_message(authctxt-krb5_ctx,
+			problem);
+		if (errtxt != NULL) {
+			debug(Kerberos v5 authentication failed: %s, errtxt);
+			krb5_free_error_message(authctxt-krb5_ctx, errtxt);
+		} else
 			debug(Kerberos v5 authentication failed: %d,
 			problem);
 	}
@@ -160,13 +165,14 @@
 	krb5_error_code problem;
 	krb5_ccache ccache = NULL;
 	char *pname;
+	const char *errtxt;
 
 	if (authctxt-pw == NULL || authctxt-krb5_user == NULL)
 		return (0);
 
 	temporarily_use_uid(authctxt-pw);
 
-	problem = krb5_cc_gen_new(authctxt-krb5_ctx, krb5_fcc_ops, ccache);
+	problem = krb5_cc_new_unique(authctxt-krb5_ctx, FILE, NULL, ccache);
 	if (problem)
 		goto fail;
 
@@ -201,9 +207,14 @@
 	return (1);
 
  fail:
-	if (problem)
-		debug(Kerberos v5 TGT passing failed: %s,
-		krb5_get_err_text(authctxt-krb5_ctx, problem));
+	if (problem) {
+		errtxt = krb5_get_error_message(authctxt-krb5_ctx, problem);
+		if (errtxt != NULL) {
+			debug(Kerberos v5 TGT passing failed: %s, errtxt);
+			krb5_free_error_message(authctxt-krb5_ctx, errtxt);
+		} else
+			debug(Kerberos v5 TGT passing failed: %d, problem);
+	}
 	if (ccache)
 		krb5_cc_destroy(authctxt-krb5_ctx, ccache);
 
@@ -218,6 +229,7 @@
 {
 	krb5_error_code problem;
 	krb5_ccache ccache = NULL;
+	const char *errtxt;
 
 	temporarily_use_uid(authctxt-pw);
 
@@ -230,7 +242,8 @@
 	if (problem)
 		goto out;
 
-	problem = krb5_cc_gen_new(authctxt-krb5_ctx, krb5_mcc_ops, ccache);
+	problem = krb5_cc_new_unique(authctxt-krb5_ctx, MEMORY, NULL,
+	ccache);
 	if (problem)
 		goto out;
 
@@ -249,7 +262,7 @@
 	if (problem)
 		goto out;
 
-	problem = krb5_cc_gen_new(authctxt-krb5_ctx, krb5_fcc_ops,
+	problem = krb5_cc_new_unique(authctxt-krb5_ctx, FILE, NULL,
 	authctxt-krb5_fwd_ccache);
 	if (problem)
 		goto out;
@@ -271,10 +284,15 @@
 		if (ccache)
 			krb5_cc_destroy(authctxt-krb5_ctx, ccache);
 
+		errtxt = NULL;
 		if (authctxt-krb5_ctx != NULL)
+			errtxt = krb5_get_error_message(authctxt-krb5_ctx,
+			problem);
+		if (errtxt != NULL) {
 			debug(Kerberos password authentication failed: %s,
-			krb5_get_err_text(authctxt-krb5_ctx, problem));
-		else
+			errtxt);
+			krb5_free_error_message(authctxt-krb5_ctx, errtxt);
+		} else
 			debug(Kerberos password authentication failed: %d,
 			problem);
 
Index: src/crypto/external/bsd/openssh/dist/sshconnect1.c
diff -u src/crypto/external/bsd/openssh/dist/sshconnect1.c:1.2 src/crypto/external/bsd/openssh/dist/sshconnect1.c:1.3
--- src/crypto/external/bsd/openssh/dist/sshconnect1.c:1.2	Sun Jun  7 22:38:47 2009
+++ src/crypto/external/bsd/openssh/dist/sshconnect1.c	Sun Apr 24 14:01:46 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sshconnect1.c,v 1.2 2009/06/07 22:38:47 christos Exp $	*/
+/*	$NetBSD: sshconnect1.c,v 1.3 2011/04/24 14:01:46 elric Exp $	*/
 /* $OpenBSD: sshconnect1.c,v 1.70 2006/11/06 21:25:28 markus Exp $ */
 /*
  * Author: Tatu Ylonen y...@cs.hut.fi
@@ -15,7 +15,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: sshconnect1.c,v 1.2 2009/06/07 22:38:47 christos 

CVS commit: src/crypto/external/bsd/openssh

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 14:09:39 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh: Makefile.inc
src/crypto/external/bsd/openssh/dist: session.c

Log Message:
Stop using -I/usr/include/gssapi and -I/usr/include/krb5.  We must in this
case find kafs.h as krb5/kafs.h.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/crypto/external/bsd/openssh/dist/session.c

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/openssh/Makefile.inc
diff -u src/crypto/external/bsd/openssh/Makefile.inc:1.2 src/crypto/external/bsd/openssh/Makefile.inc:1.3
--- src/crypto/external/bsd/openssh/Makefile.inc:1.2	Sun Nov 21 19:19:21 2010
+++ src/crypto/external/bsd/openssh/Makefile.inc	Sun Apr 24 14:09:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.2 2010/11/21 19:19:21 adam Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2011/04/24 14:09:39 elric Exp $
 
 WARNS?=	1	# XXX -Wshadow -Wcast-qual
 
@@ -23,8 +23,8 @@
 .endif	# USE_PAM == no
 
 .if (${USE_KERBEROS} != no)
-CPPFLAGS+=-DGSSAPI -I${DESTDIR}/usr/include/gssapi
-CPPFLAGS+=-DKRB5 -I${DESTDIR}/usr/include/krb5 -DHEIMDAL
+CPPFLAGS+=-DGSSAPI
+CPPFLAGS+=-DKRB5 -DHEIMDAL
 .endif
 
 .if (${USE_LDAP} != no)

Index: src/crypto/external/bsd/openssh/dist/session.c
diff -u src/crypto/external/bsd/openssh/dist/session.c:1.5 src/crypto/external/bsd/openssh/dist/session.c:1.6
--- src/crypto/external/bsd/openssh/dist/session.c:1.5	Sun Nov 21 18:59:04 2010
+++ src/crypto/external/bsd/openssh/dist/session.c	Sun Apr 24 14:09:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: session.c,v 1.5 2010/11/21 18:59:04 adam Exp $	*/
+/*	$NetBSD: session.c,v 1.6 2011/04/24 14:09:39 elric Exp $	*/
 /* $OpenBSD: session.c,v 1.256 2010/06/25 07:20:04 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen y...@cs.hut.fi, Espoo, Finland
@@ -35,7 +35,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: session.c,v 1.5 2010/11/21 18:59:04 adam Exp $);
+__RCSID($NetBSD: session.c,v 1.6 2011/04/24 14:09:39 elric Exp $);
 #include sys/types.h
 #include sys/wait.h
 #include sys/un.h
@@ -88,7 +88,7 @@
 #include sftp.h
 
 #ifdef KRB5
-#include kafs.h
+#include krb5/kafs.h
 #endif
 
 #define IS_INTERNAL_SFTP(c) \



CVS commit: src/lib/libpam/modules/pam_krb5

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 18:48:05 UTC 2011

Modified Files:
src/lib/libpam/modules/pam_krb5: pam_krb5.c

Log Message:
Remove use of functions marked as deprecated in Heimdal.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libpam/modules/pam_krb5/pam_krb5.c

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

Modified files:

Index: src/lib/libpam/modules/pam_krb5/pam_krb5.c
diff -u src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.23 src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.24
--- src/lib/libpam/modules/pam_krb5/pam_krb5.c:1.23	Sat Apr  2 10:22:09 2011
+++ src/lib/libpam/modules/pam_krb5/pam_krb5.c	Sun Apr 24 18:48:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_krb5.c,v 1.23 2011/04/02 10:22:09 mbalmer Exp $	*/
+/*	$NetBSD: pam_krb5.c,v 1.24 2011/04/24 18:48:04 elric Exp $	*/
 
 /*-
  * This pam_krb5 module contains code that is:
@@ -53,7 +53,7 @@
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_krb5/pam_krb5.c,v 1.22 2005/01/24 16:49:50 rwatson Exp $);
 #else
-__RCSID($NetBSD: pam_krb5.c,v 1.23 2011/04/02 10:22:09 mbalmer Exp $);
+__RCSID($NetBSD: pam_krb5.c,v 1.24 2011/04/24 18:48:04 elric Exp $);
 #endif
 
 #include sys/types.h
@@ -83,6 +83,7 @@
 #define	COMPAT_HEIMDAL
 /* #define	COMPAT_MIT */
 
+static void	log_krb5(krb5_context, const char *, krb5_error_code);
 static int	verify_krb_v5_tgt(krb5_context, krb5_ccache, char *, int);
 static void	cleanup_cache(pam_handle_t *, void *, int);
 static const	char *compat_princ_component(krb5_context, krb5_principal, int);
@@ -111,7 +112,7 @@
 	krb5_creds creds;
 	krb5_principal princ;
 	krb5_ccache ccache;
-	krb5_get_init_creds_opt opts;
+	krb5_get_init_creds_opt *opts = NULL;
 	struct passwd *pwd, pwres;
 	int retval;
 	const void *ccache_data;
@@ -150,10 +151,14 @@
 
 	PAM_LOG(Context initialised);
 
-	krb5_get_init_creds_opt_init(opts);
+	krbret = krb5_get_init_creds_opt_alloc(pam_context, opts);
+	if (krbret != 0) {
+		PAM_VERBOSE_ERROR(Kerberos 5 error);
+		return (PAM_SERVICE_ERR);
+	}
 
 	if (openpam_get_option(pamh, PAM_OPT_FORWARDABLE))
-		krb5_get_init_creds_opt_set_forwardable(opts, 1);
+		krb5_get_init_creds_opt_set_forwardable(opts, 1);
 
 	if ((rtime = openpam_get_option(pamh, PAM_OPT_RENEWABLE)) != NULL) {
 		krb5_deltat renew;
@@ -169,7 +174,7 @@
 		else
 			rtime = 1 month;
 		renew = parse_time(rtime, s);
-		krb5_get_init_creds_opt_set_renew_life(opts, renew);
+		krb5_get_init_creds_opt_set_renew_life(opts, renew);
 	}
 
 
@@ -196,8 +201,7 @@
 	krbret = krb5_parse_name(pam_context, principal, princ);
 	free(principal);
 	if (krbret != 0) {
-		PAM_LOG(Error krb5_parse_name(): %s,
-		krb5_get_err_text(pam_context, krbret));
+		log_krb5(pam_context, Error krb5_parse_name(): %s, krbret);
 		PAM_VERBOSE_ERROR(Kerberos 5 error);
 		retval = PAM_SERVICE_ERR;
 		goto cleanup3;
@@ -208,8 +212,7 @@
 	/* Now convert the principal name into something human readable */
 	krbret = krb5_unparse_name(pam_context, princ, princ_name);
 	if (krbret != 0) {
-		PAM_LOG(Error krb5_unparse_name(): %s,
-		krb5_get_err_text(pam_context, krbret));
+		log_krb5(pam_context, Error krb5_unparse_name(): %s, krbret);
 		PAM_VERBOSE_ERROR(Kerberos 5 error);
 		retval = PAM_SERVICE_ERR;
 		goto cleanup2;
@@ -233,8 +236,8 @@
 		sizeof(luser), luser);
 		if (krbret != 0) {
 			PAM_VERBOSE_ERROR(Kerberos 5 error);
-			PAM_LOG(Error krb5_aname_to_localname(): %s,
-			krb5_get_err_text(pam_context, krbret));
+			log_krb5(pam_context,
+			Error krb5_aname_to_localname(): %s, krbret);
 			retval = PAM_USER_UNKNOWN;
 			goto cleanup2;
 		}
@@ -257,11 +260,11 @@
 	/* Get a TGT */
 	memset(creds, 0, sizeof(krb5_creds));
 	krbret = krb5_get_init_creds_password(pam_context, creds, princ,
-	pass, NULL, pamh, 0, NULL, opts);
+	pass, NULL, pamh, 0, NULL, opts);
 	if (krbret != 0) {
 		PAM_VERBOSE_ERROR(Kerberos 5 error);
-		PAM_LOG(Error krb5_get_init_creds_password(): %s,
-		krb5_get_err_text(pam_context, krbret));
+		log_krb5(pam_context,
+		Error krb5_get_init_creds_password(): %s, krbret);
 		retval = PAM_AUTH_ERR;
 		goto cleanup2;
 	}
@@ -269,27 +272,24 @@
 	PAM_LOG(Got TGT);
 
 	/* Generate a temporary cache */
-	krbret = krb5_cc_gen_new(pam_context, krb5_mcc_ops, ccache);
+	krbret = krb5_cc_new_unique(pam_context, MEMORY, NULL, ccache);
 	if (krbret != 0) {
 		PAM_VERBOSE_ERROR(Kerberos 5 error);
-		PAM_LOG(Error krb5_cc_gen_new(): %s,
-		krb5_get_err_text(pam_context, krbret));
+		log_krb5(pam_context, Error krb5_cc_gen_new(): %s, krbret);
 		retval = PAM_SERVICE_ERR;
 		goto cleanup;
 	}
 	krbret = krb5_cc_initialize(pam_context, ccache, princ);
 	if (krbret != 0) {
 		PAM_VERBOSE_ERROR(Kerberos 5 error);
-		PAM_LOG(Error krb5_cc_initialize(): %s,
-		krb5_get_err_text(pam_context, krbret));
+		log_krb5(pam_context, Error krb5_cc_initialize(): %s, krbret);
 		retval = PAM_SERVICE_ERR;
 		

CVS commit: src/lib/libpam/modules/pam_ksu

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 18:53:55 UTC 2011

Modified Files:
src/lib/libpam/modules/pam_ksu: pam_ksu.c

Log Message:
Stop using functions that are marked as deprecated in Heimdal.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libpam/modules/pam_ksu/pam_ksu.c

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

Modified files:

Index: src/lib/libpam/modules/pam_ksu/pam_ksu.c
diff -u src/lib/libpam/modules/pam_ksu/pam_ksu.c:1.3 src/lib/libpam/modules/pam_ksu/pam_ksu.c:1.4
--- src/lib/libpam/modules/pam_ksu/pam_ksu.c:1.3	Sun Mar  8 19:38:03 2009
+++ src/lib/libpam/modules/pam_ksu/pam_ksu.c	Sun Apr 24 18:53:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pam_ksu.c,v 1.3 2009/03/08 19:38:03 christos Exp $	*/
+/*	$NetBSD: pam_ksu.c,v 1.4 2011/04/24 18:53:55 elric Exp $	*/
 
 /*-
  * Copyright (c) 2002 Jacques A. Vidrine nec...@freebsd.org
@@ -29,7 +29,7 @@
 #ifdef __FreeBSD__
 __FBSDID($FreeBSD: src/lib/libpam/modules/pam_ksu/pam_ksu.c,v 1.5 2004/02/10 10:13:21 des Exp $);
 #else
-__RCSID($NetBSD: pam_ksu.c,v 1.3 2009/03/08 19:38:03 christos Exp $);
+__RCSID($NetBSD: pam_ksu.c,v 1.4 2011/04/24 18:53:55 elric Exp $);
 #endif
 
 #include sys/param.h
@@ -51,6 +51,7 @@
 
 #define PASSWORD_PROMPT	%s's password:
 
+static void	log_krb5(krb5_context, const char *, krb5_error_code);
 static long	get_su_principal(krb5_context, const char *, const char *,
 		char **, krb5_principal *);
 static int	auth_krb5(pam_handle_t *, krb5_context, const char *,
@@ -78,8 +79,7 @@
 	PAM_LOG(Got ruser: %s, (const char *)ruser);
 	rv = krb5_init_context(context);
 	if (rv != 0) {
-		PAM_LOG(krb5_init_context failed: %s,
-			krb5_get_err_text(context, rv));
+		log_krb5(context, krb5_init_context failed: %s, rv);
 		return (PAM_SERVICE_ERR);
 	}
 	rv = get_su_principal(context, user, ruser, su_principal_name, su_principal);
@@ -120,14 +120,18 @@
 krb5_principal su_principal)
 {
 	krb5_creds	 creds;
-	krb5_get_init_creds_opt gic_opt;
+	krb5_get_init_creds_opt *gic_opt;
 	krb5_verify_init_creds_opt vic_opt;
 	const char	*pass;
 	char		 prompt[80];
 	long		 rv;
 	int		 pamret;
 
-	krb5_get_init_creds_opt_init(gic_opt);
+	rv = krb5_get_init_creds_opt_alloc(context, gic_opt);
+	if (rv != 0) {
+		log_krb5(context, krb5_get_init_creds_opt_alloc: %s, rv);
+		return (PAM_SERVICE_ERR);
+	}
 	krb5_verify_init_creds_opt_init(vic_opt);
 	if (su_principal_name != NULL)
 		(void)snprintf(prompt, sizeof(prompt), PASSWORD_PROMPT,
@@ -141,10 +145,9 @@
 	if (pamret != PAM_SUCCESS)
 		return (pamret);
 	rv = krb5_get_init_creds_password(context, creds, su_principal,
-	pass, NULL, NULL, 0, NULL, gic_opt);
+	pass, NULL, NULL, 0, NULL, gic_opt);
 	if (rv != 0) {
-		PAM_LOG(krb5_get_init_creds_password: %s,
-			krb5_get_err_text(context, rv));
+		log_krb5(context, krb5_get_init_creds_password: %s, rv);
 		return (PAM_AUTH_ERR);
 	}
 	krb5_verify_init_creds_opt_set_ap_req_nofail(vic_opt, 1);
@@ -152,13 +155,26 @@
 	vic_opt);
 	krb5_free_cred_contents(context, creds);
 	if (rv != 0) {
-		PAM_LOG(krb5_verify_init_creds: %s,
-		   krb5_get_err_text(context, rv));
+		log_krb5(context, krb5_verify_init_creds: %s, rv);
 		return (PAM_AUTH_ERR);
 	}
 	return (PAM_SUCCESS);
 }
 
+static void
+log_krb5(krb5_context ctx, const char *fmt, krb5_error_code err)
+{
+	const char	*errtxt;
+ 
+errtxt = krb5_get_error_message(ctx, err);
+	if (errtxt != NULL) {
+		PAM_LOG(fmt, errtxt);
+		krb5_free_error_message(ctx, errtxt);
+	} else {
+		PAM_LOG(fmt, unknown);
+	}
+}
+
 /* Determine the target principal given the current user and the target user.
  *   context   -- An initialized krb5_context.
  *   target_user   -- The target username.
@@ -183,6 +199,7 @@
 	char		*principal_name, *ccname, *p;
 	long		 rv;
 	uid_t		 euid, ruid;
+	const char	*errtxt;
 
 	*su_principal = NULL;
 	default_principal = NULL;
@@ -227,8 +244,7 @@
 	rv = krb5_unparse_name(context, default_principal, principal_name);
 	krb5_free_principal(context, default_principal);
 	if (rv != 0) {
-		PAM_LOG(krb5_unparse_name: %s,
-		krb5_get_err_text(context, rv));
+		log_krb5(context, krb5_unparse_name: %s, rv);
 		return (rv);
 	}
 	PAM_LOG(Default principal name: %s, principal_name);
@@ -250,8 +266,15 @@
 		return (errno);
 	rv = krb5_parse_name(context, *su_principal_name, default_principal);
 	if (rv != 0) {
-		PAM_LOG(krb5_parse_name `%s': %s, *su_principal_name,
-		krb5_get_err_text(context, rv));
+		errtxt = krb5_get_error_message(context, rv);
+		if (errtxt != NULL) {
+			PAM_LOG(krb5_parse_name `%s': %s, *su_principal_name,
+			errtxt);
+			krb5_free_error_message(context, errtxt);
+		} else {
+			PAM_LOG(krb5_parse_name `%s': %ld, *su_principal_name,
+			rv);
+		}
 		free(*su_principal_name);
 		return (rv);
 	}



CVS commit: src/lib/libtelnet

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 19:00:32 UTC 2011

Modified Files:
src/lib/libtelnet: kerberos5.c

Log Message:
Stop using functions that are deprecated in Heimdal.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/lib/libtelnet/kerberos5.c

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

Modified files:

Index: src/lib/libtelnet/kerberos5.c
diff -u src/lib/libtelnet/kerberos5.c:1.17 src/lib/libtelnet/kerberos5.c:1.18
--- src/lib/libtelnet/kerberos5.c:1.17	Wed Mar 22 16:32:39 2006
+++ src/lib/libtelnet/kerberos5.c	Sun Apr 24 19:00:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kerberos5.c,v 1.17 2006/03/22 16:32:39 christos Exp $	*/
+/*	$NetBSD: kerberos5.c,v 1.18 2011/04/24 19:00:31 elric Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -74,6 +74,7 @@
 
 int require_hwpreauth;
 
+const char *get_krb5_err_text(krb5_context, krb5_error_code);
 void kerberos5_forward(Authenticator *);
 
 static unsigned char str_data[1024] = {IAC, SB, TELOPT_AUTHENTICATION, 0,
@@ -125,6 +126,22 @@
 	return (telnet_net_write(str_data, p - str_data));
 }
 
+const char *
+get_krb5_err_text(krb5_context ctx, krb5_error_code ret)
+{
+	static const char	*str = NULL;
+
+	if (str)
+		krb5_free_error_message(ctx, str);
+
+	str = krb5_get_error_message(ctx, ret);
+
+	if (str != NULL)
+		return str;
+
+	return unknown;
+}
+
 int
 kerberos5_init(Authenticator *ap, int server)
 {
@@ -180,7 +197,7 @@
 		if (auth_debug_mode) {
 			printf(
 			Kerberos V5: could not get default ccache: %s\r\n,
-			krb5_get_err_text(telnet_context, ret));
+			get_krb5_err_text(telnet_context, ret));
 		}
 		return (0);
 	}
@@ -196,7 +213,7 @@
 		if (auth_debug_mode) {
 			printf(
 			Kerberos V5: krb5_auth_con_init failed: %s\r\n,
-			krb5_get_err_text(telnet_context, ret));
+			get_krb5_err_text(telnet_context, ret));
 		}
 		return (0);
 	}
@@ -206,7 +223,7 @@
 		if (auth_debug_mode) {
 			printf(Kerberos V5: 
 			krb5_auth_con_setaddrs_from_fd failed: %s\r\n,
-			krb5_get_err_text(telnet_context, ret));
+			get_krb5_err_text(telnet_context, ret));
 		}
 		return (0);
 	}
@@ -222,7 +239,7 @@
 	if (ret) {
 		if (1 || auth_debug_mode) {
 			printf(Kerberos V5: mk_req failed (%s)\r\n,
-			krb5_get_err_text(telnet_context, ret));
+			get_krb5_err_text(telnet_context, ret));
 		}
 		return (0);
 	}
@@ -269,7 +286,7 @@
 			auth_finished(ap, AUTH_REJECT);
 			if (auth_debug_mode)
 printf(Kerberos V5: krb5_auth_con_init failed (%s)\r\n,
-krb5_get_err_text(telnet_context, ret));
+get_krb5_err_text(telnet_context, ret));
 			return;
 		}
 		ret = krb5_auth_con_setaddrs_from_fd(telnet_context,
@@ -280,7 +297,7 @@
 			if (auth_debug_mode)
 printf(Kerberos V5: 
 krb5_auth_con_setaddrs_from_fd failed (%s)\r\n,
-krb5_get_err_text(telnet_context, ret));
+get_krb5_err_text(telnet_context, ret));
 			return;
 		}
 		ret = krb5_sock_to_principal(telnet_context, 0, host,
@@ -291,7 +308,7 @@
 			if (auth_debug_mode)
 printf(Kerberos V5: 
 krb5_sock_to_principal failed (%s)\r\n,
-krb5_get_err_text(telnet_context, ret));
+get_krb5_err_text(telnet_context, ret));
 			return;
 		}
 		ret = krb5_rd_req(telnet_context, auth_context, auth,
@@ -303,7 +320,7 @@
 
 			asprintf(errbuf,
 			Read req failed: %s,
-			krb5_get_err_text(telnet_context, ret));
+			get_krb5_err_text(telnet_context, ret));
 			Data(ap, KRB_REJECT, errbuf, -1);
 			if (auth_debug_mode)
 printf(%s\r\n, errbuf);
@@ -321,7 +338,7 @@
 			if (ret) {
 char *errbuf;
 asprintf(errbuf, Bad checksum: %s,
-krb5_get_err_text(telnet_context, ret));
+get_krb5_err_text(telnet_context, ret));
 Data(ap, KRB_REJECT, errbuf, -1);
 if (auth_debug_mode)
 	printf(%s\r\n, errbuf);
@@ -338,7 +355,7 @@
 			if (auth_debug_mode)
 printf(Kerberos V5: 
 krb5_auth_con_getremotesubkey failed (%s)\r\n,
-krb5_get_err_text(telnet_context, ret));
+get_krb5_err_text(telnet_context, ret));
 			return;
 		}
 		if (key_block == NULL) {
@@ -352,7 +369,7 @@
 			if (auth_debug_mode)
 printf(Kerberos V5: 
    krb5_auth_con_getkey failed (%s)\r\n,
-   krb5_get_err_text(telnet_context, ret));
+   get_krb5_err_text(telnet_context, ret));
 			return;
 		}
 		if (key_block == NULL) {
@@ -373,7 +390,7 @@
 if (auth_debug_mode)
 	printf(Kerberos V5: 
 	krb5_mk_rep failed (%s)\r\n,
-	krb5_get_err_text(telnet_context,
+	get_krb5_err_text(telnet_context,
 	ret));
 krb5_free_keyblock(telnet_context, key_block);
 return;
@@ -440,7 +457,7 @@
 			if (ret) {
 if (auth_debug_mode)
 	printf(Kerberos V5: could not get ccache: %s\r\n,
-	krb5_get_err_text(telnet_context,
+	get_krb5_err_text(telnet_context,
 	ret));
 break;
 			}
@@ -449,7 +466,7 @@
 			if (ret) {

CVS commit: src/lib/libtelnet

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 19:00:56 UTC 2011

Modified Files:
src/lib/libtelnet: Makefile

Log Message:
We no longer need to -I/usr/include/krb5.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/lib/libtelnet/Makefile

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

Modified files:

Index: src/lib/libtelnet/Makefile
diff -u src/lib/libtelnet/Makefile:1.31 src/lib/libtelnet/Makefile:1.32
--- src/lib/libtelnet/Makefile:1.31	Fri Aug 29 00:02:22 2008
+++ src/lib/libtelnet/Makefile	Sun Apr 24 19:00:56 2011
@@ -1,5 +1,5 @@
 #	from: @(#)Makefile	8.2 (Berkeley) 12/15/93
-#	$NetBSD: Makefile,v 1.31 2008/08/29 00:02:22 gmcgarry Exp $
+#	$NetBSD: Makefile,v 1.32 2011/04/24 19:00:56 elric Exp $
 
 USE_FORT?= yes	# network protocol library
 
@@ -22,7 +22,6 @@
 
 SRCS+=	kerberos5.c
 CPPFLAGS+= -DKRB5
-CPPFLAGS+= -I${DESTDIR}/usr/include/krb5
 .endif
 
 .if ${USE_PAM} != no  ${MKCRYPTO} != no



CVS commit: src/usr.bin/passwd

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 21:16:44 UTC 2011

Modified Files:
src/usr.bin/passwd: krb5_passwd.c

Log Message:
Stop using functions deprecated by Heimdal.  Also, if krb5_init_context()
fails, we can't use Kerberos functions to grab error strings, we
resort to strerror(3) which is what Heimdal's deprecated function
does in this case.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.bin/passwd/krb5_passwd.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/passwd/krb5_passwd.c
diff -u src/usr.bin/passwd/krb5_passwd.c:1.18 src/usr.bin/passwd/krb5_passwd.c:1.19
--- src/usr.bin/passwd/krb5_passwd.c:1.18	Sat Apr 18 09:04:34 2009
+++ src/usr.bin/passwd/krb5_passwd.c	Sun Apr 24 21:16:43 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: krb5_passwd.c,v 1.18 2009/04/18 09:04:34 mlelstv Exp $ */
+/* $NetBSD: krb5_passwd.c,v 1.19 2011/04/24 21:16:43 elric Exp $ */
 
 /*
  * Copyright (c) 2000, 2005 The NetBSD Foundation, Inc.
@@ -68,13 +68,14 @@
 {
 	krb5_context context;
 	krb5_error_code ret;
-	krb5_get_init_creds_opt opt;
+	krb5_get_init_creds_opt *opt;
 	krb5_principal principal;
 	krb5_creds cred;
 	int result_code;
 	krb5_data result_code_string, result_string;
 	char pwbuf[BUFSIZ];
 	int ch;
+	const char *errtxt;
 
 	while ((ch = getopt(argc, argv, 5ku:)) != -1) {
 		switch (ch) {
@@ -125,21 +126,34 @@
 	if (ret != 0) {
 		if (ret == ENXIO)
 			errx(1, Kerberos 5 not in use.);
-		warnx(Unable to initialize Kerberos 5: %s,
-		krb5_get_err_text(context, ret));
-		goto bad;
+		errx(1, Unable to initialize Kerberos 5: %s, strerror(ret));
 	}
 
-	krb5_get_init_creds_opt_init(opt);
+	ret = krb5_get_init_creds_opt_alloc(context, opt);
+	if (ret) {
+		errtxt = krb5_get_error_message(context, ret);
+		if (errtxt != NULL) {
+			warnx(failed to allocate opts: %s, errtxt);
+			krb5_free_error_message(context, errtxt);
+		} else {
+			warnx(failed to allocate opts: %d, ret);
+		}
+		goto bad;
+	}
 
-	krb5_get_init_creds_opt_set_tkt_life(opt, 300L);
-	krb5_get_init_creds_opt_set_forwardable(opt, FALSE);
-	krb5_get_init_creds_opt_set_proxiable(opt, FALSE);
+	krb5_get_init_creds_opt_set_tkt_life(opt, 300L);
+	krb5_get_init_creds_opt_set_forwardable(opt, FALSE);
+	krb5_get_init_creds_opt_set_proxiable(opt, FALSE);
 
 	ret = krb5_parse_name(context, username, principal);
 	if (ret) {
-		warnx(failed to parse principal: %s, 
-		krb5_get_err_text(context, ret));
+		errtxt = krb5_get_error_message(context, ret);
+		if (errtxt != NULL) {
+			warnx(failed to parse principal: %s, errtxt);
+			krb5_free_error_message(context, errtxt);
+		} else {
+			warnx(failed to parse principal: %d, ret);
+		}
 		goto bad;
 	}
 
@@ -151,7 +165,7 @@
 	   NULL,
 	   0L,
 	   kadmin/changepw,
-	   opt);
+	   opt);
 
 
 	switch (ret) {
@@ -168,8 +182,13 @@
 		goto bad;
 
 	default:
-		warnx(failed to get credentials: %s, 
-		krb5_get_err_text(context, ret));
+		errtxt = krb5_get_error_message(context, ret);
+		if (errtxt != NULL) {
+			warnx(failed to get credentials: %s, errtxt);
+			krb5_free_error_message(context, errtxt);
+		} else {
+			warnx(failed to get credentials: %d, ret);
+		}
 		goto bad;
  	}
 
@@ -186,8 +205,13 @@
 result_code_string,
 result_string);
 	if (ret) {
-		warnx(unable to set password: %s,
-		krb5_get_err_text(context, ret));
+		errtxt = krb5_get_error_message(context, ret);
+		if (errtxt != NULL) {
+			warnx(unable to set password: %s, errtxt);
+			krb5_free_error_message(context, errtxt);
+		} else {
+			warnx(unable to set password: %d, ret);
+		}
 		goto bad;
 	}
 
@@ -271,11 +295,17 @@
 int result_code;
 krb5_data result_code_string, result_string;
 char pwbuf[BUFSIZ];
+const char *errtxt;
 
 ret = krb5_init_context (context);
 if (ret) {
-	warnx(failed kerberos initialisation: %s, 
-	  krb5_get_err_text(context, ret));
+	errtxt = krb5_get_error_message(context, ret);
+	if (errtxt != NULL) {
+	warnx(failed kerberos initialisation: %s, errtxt);
+	krb5_free_error_message(context, errtxt);
+	} else {
+	warnx(failed kerberos initialisation: %d, ret);
+	}
 	return 1;
 }
 
@@ -288,8 +318,13 @@
 if(username != NULL) {
 ret = krb5_parse_name (context, username, principal);
 if (ret) {
-	warnx(failed to parse principal: %s, 
-		  krb5_get_err_text(context, ret));
+	errtxt = krb5_get_error_message(context, ret);
+	if (errtxt != NULL) {
+		warnx(failed to parse principal: %s, errtxt);
+		krb5_free_error_message(context, errtxt);
+	} else {
+		warnx(failed to parse principal: %d, ret);
+	}
 	return 1;
 	}
 } else
@@ -317,8 +352,13 @@
 	return 1;
 break;
 default:
-	warnx(failed to get credentials: %s, 
-	  krb5_get_err_text(context, ret));
+	errtxt = krb5_get_error_message(context, ret);
+	if (errtxt != NULL) {
+	

CVS commit: src/libexec/telnetd

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 21:18:24 UTC 2011

Modified Files:
src/libexec/telnetd: telnetd.c

Log Message:
#include com_err.h - #include krb5/com_err.h.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/libexec/telnetd/telnetd.c

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

Modified files:

Index: src/libexec/telnetd/telnetd.c
diff -u src/libexec/telnetd/telnetd.c:1.51 src/libexec/telnetd/telnetd.c:1.52
--- src/libexec/telnetd/telnetd.c:1.51	Sun Jul 20 01:09:07 2008
+++ src/libexec/telnetd/telnetd.c	Sun Apr 24 21:18:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: telnetd.c,v 1.51 2008/07/20 01:09:07 lukem Exp $	*/
+/*	$NetBSD: telnetd.c,v 1.52 2011/04/24 21:18:24 elric Exp $	*/
 
 /*
  * Copyright (C) 1997 and 1998 WIDE Project.
@@ -65,7 +65,7 @@
 #if 0
 static char sccsid[] = @(#)telnetd.c	8.4 (Berkeley) 5/30/95;
 #else
-__RCSID($NetBSD: telnetd.c,v 1.51 2008/07/20 01:09:07 lukem Exp $);
+__RCSID($NetBSD: telnetd.c,v 1.52 2011/04/24 21:18:24 elric Exp $);
 #endif
 #endif /* not lint */
 
@@ -83,7 +83,7 @@
 #define	Authenticator	k5_Authenticator
 #include krb5.h
 #undef	Authenticator
-#include com_err.h
+#include krb5/com_err.h
 #endif
 
 #ifdef AUTHENTICATION



CVS commit: src

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 21:42:06 UTC 2011

Modified Files:
src/libexec/ftpd: Makefile
src/libexec/telnetd: Makefile
src/usr.bin/login: Makefile
src/usr.bin/passwd: Makefile
src/usr.bin/su: Makefile
src/usr.bin/telnet: Makefile

Log Message:
We no longer need -I/usr/include/krb5.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/libexec/ftpd/Makefile
cvs rdiff -u -r1.47 -r1.48 src/libexec/telnetd/Makefile
cvs rdiff -u -r1.51 -r1.52 src/usr.bin/login/Makefile
cvs rdiff -u -r1.41 -r1.42 src/usr.bin/passwd/Makefile
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/su/Makefile
cvs rdiff -u -r1.44 -r1.45 src/usr.bin/telnet/Makefile

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

Modified files:

Index: src/libexec/ftpd/Makefile
diff -u src/libexec/ftpd/Makefile:1.60 src/libexec/ftpd/Makefile:1.61
--- src/libexec/ftpd/Makefile:1.60	Sun Mar 15 07:48:36 2009
+++ src/libexec/ftpd/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.60 2009/03/15 07:48:36 lukem Exp $
+#	$NetBSD: Makefile,v 1.61 2011/04/24 21:42:06 elric Exp $
 #	@(#)Makefile	8.2 (Berkeley) 4/4/94
 
 .include bsd.own.mk
@@ -43,7 +43,6 @@
 #
 #SRCS+=	k5login.c
 #CPPFLAGS+=-DKERBEROS5
-#CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
 #DPADD+=	${LIBKRB5} ${LIBASN1}
 #LDADD+= -lkrb5 -lasn1
 #

Index: src/libexec/telnetd/Makefile
diff -u src/libexec/telnetd/Makefile:1.47 src/libexec/telnetd/Makefile:1.48
--- src/libexec/telnetd/Makefile:1.47	Fri Apr 15 18:05:45 2011
+++ src/libexec/telnetd/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.47 2011/04/15 18:05:45 elric Exp $
+#	$NetBSD: Makefile,v 1.48 2011/04/24 21:42:06 elric Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 12/15/93
 
 WARNS?=	2		# XXX: const issues in sys_term.c
@@ -21,7 +21,6 @@
 LIBTELNETDIR!=	cd ${.CURDIR}/../../lib/libtelnet; ${PRINTOBJDIR}
 
 .if (${USE_KERBEROS} != no)
-CPPFLAGS+=-I${DESTDIR}/usr/include/krb5
 CPPFLAGS+=-DKRB5 -DAUTHENTICATION -DENCRYPTION
 LDADD+= -lkrb5 -lasn1 -lcrypto -lcrypt
 DPADD+=	${LIBKRB5} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT}

Index: src/usr.bin/login/Makefile
diff -u src/usr.bin/login/Makefile:1.51 src/usr.bin/login/Makefile:1.52
--- src/usr.bin/login/Makefile:1.51	Tue Dec 29 19:26:13 2009
+++ src/usr.bin/login/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.51 2009/12/29 19:26:13 christos Exp $
+#	$NetBSD: Makefile,v 1.52 2011/04/24 21:42:06 elric Exp $
 #	@(#)Makefile	8.1 (Berkeley) 7/19/93
 
 WARNS?=	2	# XXX -Wcast-qual issues
@@ -24,7 +24,7 @@
 
 .if (${USE_KERBEROS} != no)
 SRCS+= k5login.c
-CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
+CPPFLAGS+=-DKERBEROS5
 DPADD+=	${LIBKRB5} ${LIBASN1}
 LDADD+= -lkrb5 -lasn1
 

Index: src/usr.bin/passwd/Makefile
diff -u src/usr.bin/passwd/Makefile:1.41 src/usr.bin/passwd/Makefile:1.42
--- src/usr.bin/passwd/Makefile:1.41	Mon May 28 12:06:29 2007
+++ src/usr.bin/passwd/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.41 2007/05/28 12:06:29 tls Exp $
+#	$NetBSD: Makefile,v 1.42 2011/04/24 21:42:06 elric Exp $
 #	from: @(#)Makefile8.3 (Berkeley) 4/2/94
 
 .include bsd.own.mk
@@ -26,7 +26,7 @@
 BINMODE=4555
 
 .if (${USE_KERBEROS} != no)
-CPPFLAGS+= -DKERBEROS5 -I${DESTDIR}/usr/include/krb5
+CPPFLAGS+= -DKERBEROS5
 SRCS+=	krb5_passwd.c
 
 DPADD+=	${LIBKRB5} ${LIBCRYPTO} ${LIBASN1} ${LIBCOM_ERR} ${LIBROKEN} ${LIBCRYPT}

Index: src/usr.bin/su/Makefile
diff -u src/usr.bin/su/Makefile:1.49 src/usr.bin/su/Makefile:1.50
--- src/usr.bin/su/Makefile:1.49	Sun Apr  6 09:54:37 2008
+++ src/usr.bin/su/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2008/04/06 09:54:37 lukem Exp $
+#	$NetBSD: Makefile,v 1.50 2011/04/24 21:42:06 elric Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 7/19/93
 
 .include bsd.own.mk
@@ -45,7 +45,7 @@
 LDADD+= -lkafs
 .endif
 
-CPPFLAGS+=-DKERBEROS5 -I${DESTDIR}/usr/include/krb5
+CPPFLAGS+=-DKERBEROS5
 DPADD+=	${LIBKRB5} ${LIBASN1}
 LDADD+= -lkrb5 -lasn1
 

Index: src/usr.bin/telnet/Makefile
diff -u src/usr.bin/telnet/Makefile:1.44 src/usr.bin/telnet/Makefile:1.45
--- src/usr.bin/telnet/Makefile:1.44	Wed Feb  3 15:34:46 2010
+++ src/usr.bin/telnet/Makefile	Sun Apr 24 21:42:06 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2010/02/03 15:34:46 roy Exp $
+#	$NetBSD: Makefile,v 1.45 2011/04/24 21:42:06 elric Exp $
 #
 # Copyright (c) 1990 The Regents of the University of California.
 # All rights reserved.
@@ -63,7 +63,6 @@
 LIBTELNETDIR!=	cd ${.CURDIR}/../../lib/libtelnet; ${PRINTOBJDIR}
 
 .if (${USE_KERBEROS} != no)
-CPPFLAGS+=-I${DESTDIR}/usr/include/krb5
 CPPFLAGS+=-DKRB5 -DFORWARD -DAUTHENTICATION -DENCRYPTION
 LDADD+= -lkrb5 -lasn1 -lcrypto -lcrypt
 DPADD+=	${LIBKRB5} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT}



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-24 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sun Apr 24 22:24:14 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: krb5-types.h

Log Message:
Remove the definition of various X_DEPRECATED as userland has been fixed
to stop using functions defined as deprecated by Heimdal.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/heimdal/include/krb5-types.h

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/heimdal/include/krb5-types.h
diff -u src/crypto/external/bsd/heimdal/include/krb5-types.h:1.4 src/crypto/external/bsd/heimdal/include/krb5-types.h:1.5
--- src/crypto/external/bsd/heimdal/include/krb5-types.h:1.4	Fri Apr 15 14:41:11 2011
+++ src/crypto/external/bsd/heimdal/include/krb5-types.h	Sun Apr 24 22:24:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: krb5-types.h,v 1.4 2011/04/15 14:41:11 elric Exp $	*/
+/*	$NetBSD: krb5-types.h,v 1.5 2011/04/24 22:24:14 elric Exp $	*/
 
 #ifndef __krb5_types_h__
 #define __krb5_types_h__
@@ -14,10 +14,6 @@
 
 typedef int krb5_socket_t;
 
-#define HEIMDAL_DEPRECATED
-#define GSSAPI_DEPRECATED
-#define KRB5_DEPRECATED
-
 #ifndef HEIMDAL_DEPRECATED
 #if defined(__GNUC__)  ((__GNUC__  3) || ((__GNUC__ == 3)  (__GNUC_MINOR__ = 1 )))
 #define HEIMDAL_DEPRECATED __attribute__((deprecated))



CVS commit: src/crypto/external/bsd

2011-04-20 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Apr 20 08:36:08 UTC 2011

Modified Files:
src/crypto/external/bsd: Makefile

Log Message:
openssh and libsaslc depend on heimdal, so we need to wait for it to be
built.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/crypto/external/bsd/Makefile

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/Makefile
diff -u src/crypto/external/bsd/Makefile:1.10 src/crypto/external/bsd/Makefile:1.11
--- src/crypto/external/bsd/Makefile:1.10	Fri Apr 15 18:05:42 2011
+++ src/crypto/external/bsd/Makefile	Wed Apr 20 08:36:07 2011
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.10 2011/04/15 18:05:42 elric Exp $
+#	$NetBSD: Makefile,v 1.11 2011/04/20 08:36:07 elric Exp $
 
 .include bsd.own.mk
 
 .if (${MKCRYPTO} != no)
-SUBDIR+= openssl .WAIT heimdal netpgp openssh libsaslc
+SUBDIR+= openssl .WAIT heimdal netpgp .WAIT openssh libsaslc
 .endif
 
 .include bsd.subdir.mk



CVS commit: src/crypto/external/bsd/heimdal

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 12:16:31 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal: Makefile.rules.inc

Log Message:
Quick makefile bits that will use a version-script.map file if it exists
when building libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/Makefile.rules.inc

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/heimdal/Makefile.rules.inc
diff -u src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.1 src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.2
--- src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.1	Wed Apr 13 19:16:44 2011
+++ src/crypto/external/bsd/heimdal/Makefile.rules.inc	Fri Apr 15 12:16:31 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rules.inc,v 1.1 2011/04/13 19:16:44 elric Exp $
+# $NetBSD: Makefile.rules.inc,v 1.2 2011/04/15 12:16:31 elric Exp $
 
 SRCS+= ${HEIMSRCS:N*.et:N*.in:N*.asn1}
 
@@ -90,3 +90,9 @@
 .if defined(PROG)  defined(OBJS)
 OBJS.${PROG} += ${OBJS}
 .endif
+
+.if defined(LIB)  exists(version-script.map)
+version-script.map:
+
+LDFLAGS.lib${LIB} += -Wl,--version-script=${version-script.map:P}
+.endif



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 12:18:22 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: krb5-types.h

Log Message:
For the duration of the import and upgrade, we eliminate the marking of
older interfaces as deprecated as this breaks the build and we want to
commit the changes in logical chunks.  We will revert this commit later.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/include/krb5-types.h

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/heimdal/include/krb5-types.h
diff -u src/crypto/external/bsd/heimdal/include/krb5-types.h:1.1 src/crypto/external/bsd/heimdal/include/krb5-types.h:1.2
--- src/crypto/external/bsd/heimdal/include/krb5-types.h:1.1	Wed Apr 13 19:03:58 2011
+++ src/crypto/external/bsd/heimdal/include/krb5-types.h	Fri Apr 15 12:18:22 2011
@@ -1,5 +1,5 @@
 /* krb5-types.h -- this file was generated for x86_64-unknown-netbsd5.99.41 by
-   $Id: krb5-types.h,v 1.1 2011/04/13 19:03:58 elric Exp $ */
+   $Id: krb5-types.h,v 1.2 2011/04/15 12:18:22 elric Exp $ */
 
 #ifndef __krb5_types_h__
 #define __krb5_types_h__
@@ -15,6 +15,8 @@
 
 typedef int krb5_socket_t;
 
+#define HEIMDAL_DEPRECATED
+
 #ifndef HEIMDAL_DEPRECATED
 #if defined(__GNUC__)  ((__GNUC__  3) || ((__GNUC__ == 3)  (__GNUC_MINOR__ = 1 )))
 #define HEIMDAL_DEPRECATED __attribute__((deprecated))



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 12:19:20 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: krb5-types.h

Log Message:
Fix $Id$ - $NetBSD$ in our own include.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/include/krb5-types.h

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/heimdal/include/krb5-types.h
diff -u src/crypto/external/bsd/heimdal/include/krb5-types.h:1.2 src/crypto/external/bsd/heimdal/include/krb5-types.h:1.3
--- src/crypto/external/bsd/heimdal/include/krb5-types.h:1.2	Fri Apr 15 12:18:22 2011
+++ src/crypto/external/bsd/heimdal/include/krb5-types.h	Fri Apr 15 12:19:20 2011
@@ -1,5 +1,4 @@
-/* krb5-types.h -- this file was generated for x86_64-unknown-netbsd5.99.41 by
-   $Id: krb5-types.h,v 1.2 2011/04/15 12:18:22 elric Exp $ */
+/*	$NetBSD: krb5-types.h,v 1.3 2011/04/15 12:19:20 elric Exp $	*/
 
 #ifndef __krb5_types_h__
 #define __krb5_types_h__



CVS commit: src/crypto/external/bsd/heimdal

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 14:39:33 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal: Makefile.rules.inc
src/crypto/external/bsd/heimdal/lib/libkadm5clnt: Makefile

Log Message:
Need a variable to disable using an existent version-script.map as
dist/lib/kadm5 contains one but builds two libs only one of which
uses it.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/Makefile.rules.inc
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile

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/heimdal/Makefile.rules.inc
diff -u src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.2 src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.3
--- src/crypto/external/bsd/heimdal/Makefile.rules.inc:1.2	Fri Apr 15 12:16:31 2011
+++ src/crypto/external/bsd/heimdal/Makefile.rules.inc	Fri Apr 15 14:39:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.rules.inc,v 1.2 2011/04/15 12:16:31 elric Exp $
+# $NetBSD: Makefile.rules.inc,v 1.3 2011/04/15 14:39:32 elric Exp $
 
 SRCS+= ${HEIMSRCS:N*.et:N*.in:N*.asn1}
 
@@ -91,7 +91,7 @@
 OBJS.${PROG} += ${OBJS}
 .endif
 
-.if defined(LIB)  exists(version-script.map)
+.if defined(LIB)  exists(version-script.map)  !defined(NO_VERSION_SCRIPT)
 version-script.map:
 
 LDFLAGS.lib${LIB} += -Wl,--version-script=${version-script.map:P}

Index: src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile:1.1	Wed Apr 13 19:16:52 2011
+++ src/crypto/external/bsd/heimdal/lib/libkadm5clnt/Makefile	Fri Apr 15 14:39:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:52 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/04/15 14:39:32 elric Exp $
 
 USE_FORT?= yes	# network protocol library
 
@@ -37,6 +37,7 @@
 	rename_c.c	\
 	send_recv.c
 
+NO_VERSION_SCRIPT=
 
 INCSDIR=	/usr/include/kadm5
 INCS=		admin.h			\



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 14:41:11 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: krb5-types.h

Log Message:
Also define GSSAPI_DEPRECATED and KRB5_DEPRECATED as NULL to complete the
work of the prior check in.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/crypto/external/bsd/heimdal/include/krb5-types.h

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/heimdal/include/krb5-types.h
diff -u src/crypto/external/bsd/heimdal/include/krb5-types.h:1.3 src/crypto/external/bsd/heimdal/include/krb5-types.h:1.4
--- src/crypto/external/bsd/heimdal/include/krb5-types.h:1.3	Fri Apr 15 12:19:20 2011
+++ src/crypto/external/bsd/heimdal/include/krb5-types.h	Fri Apr 15 14:41:11 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: krb5-types.h,v 1.3 2011/04/15 12:19:20 elric Exp $	*/
+/*	$NetBSD: krb5-types.h,v 1.4 2011/04/15 14:41:11 elric Exp $	*/
 
 #ifndef __krb5_types_h__
 #define __krb5_types_h__
@@ -15,6 +15,8 @@
 typedef int krb5_socket_t;
 
 #define HEIMDAL_DEPRECATED
+#define GSSAPI_DEPRECATED
+#define KRB5_DEPRECATED
 
 #ifndef HEIMDAL_DEPRECATED
 #if defined(__GNUC__)  ((__GNUC__  3) || ((__GNUC__ == 3)  (__GNUC_MINOR__ = 1 )))



CVS commit: src/crypto/external/bsd/openssh/dist

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 14:51:22 UTC 2011

Modified Files:
src/crypto/external/bsd/openssh/dist: gss-serv-krb5.c

Log Message:
On reasonably modern versions of Heimdal, you should not include krb5.h
to get the krb5 GSS functions.  gssapi/gssapi_krb5.h should be included.

[this is necesary for the next Heimdal upgrade as krb5.h inclusion is no
longer effective.]


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c

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/openssh/dist/gss-serv-krb5.c
diff -u src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c:1.2 src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c:1.3
--- src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c:1.2	Sun Jun  7 22:38:46 2009
+++ src/crypto/external/bsd/openssh/dist/gss-serv-krb5.c	Fri Apr 15 14:51:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gss-serv-krb5.c,v 1.2 2009/06/07 22:38:46 christos Exp $	*/
+/*	$NetBSD: gss-serv-krb5.c,v 1.3 2011/04/15 14:51:22 elric Exp $	*/
 /* $OpenBSD: gss-serv-krb5.c,v 1.7 2006/08/03 03:34:42 deraadt Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include includes.h
-__RCSID($NetBSD: gss-serv-krb5.c,v 1.2 2009/06/07 22:38:46 christos Exp $);
+__RCSID($NetBSD: gss-serv-krb5.c,v 1.3 2011/04/15 14:51:22 elric Exp $);
 #ifdef GSSAPI
 #ifdef KRB5
 
@@ -48,7 +48,7 @@
 extern ServerOptions options;
 
 #ifdef HEIMDAL
-# include krb5.h
+# include gssapi/gssapi_krb5.h
 #else
 # ifdef HAVE_GSSAPI_KRB5_H
 #  include gssapi_krb5.h



CVS commit: src/crypto/external/bsd/heimdal/lib

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 19:41:11 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile: Makefile
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et: Makefile
src/crypto/external/bsd/heimdal/lib/libsl/slc: Makefile

Log Message:
I forgot to fix this.  .BEGIN: is not appropriate for the creation of
these symlinks as during the make obj phase it would attempt to create
them in the current directory.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile

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/heimdal/lib/libasn1/asn1_compile/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile/Makefile:1.1	Wed Apr 13 19:16:48 2011
+++ src/crypto/external/bsd/heimdal/lib/libasn1/asn1_compile/Makefile	Fri Apr 15 19:41:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:48 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
 
 NOLINT=		# defined
 NOMAN=		# defined
@@ -74,7 +74,7 @@
 
 CLEANFILES+=	print_version.h make-print-version make-print-version.lo
 
-.BEGIN:
+beforedepend:
 	[ -h krb5 ] || ln -sf . krb5
 	ln -sf ${HEIMBASE}/include/der-protos.h
 	ln -sf ${HEIMBASE}/include/roken.h

Index: src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile:1.1	Wed Apr 13 19:16:49 2011
+++ src/crypto/external/bsd/heimdal/lib/libcom_err/compile_et/Makefile	Fri Apr 15 19:41:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:49 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
 
 NOMAN=		# defined
 
@@ -47,7 +47,7 @@
 
 CLEANFILES+=	print_version.h make-print-version make-print-version.lo
 
-.BEGIN:
+beforedepend:
 	[ -h krb5 ] || ln -sf . krb5
 	ln -sf ${HEIMBASE}/include/roken.h
 	ln -sf ${HEIMBASE}/dist/lib/roken/roken-common.h

Index: src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.1	Wed Apr 13 19:16:55 2011
+++ src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile	Fri Apr 15 19:41:11 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:55 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
 
 NOMAN=		# defined
 
@@ -36,7 +36,7 @@
 
 .NOPATH: print_version.h make-print-version
 
-.BEGIN:
+beforedepend:
 	[ -h krb5 ] || ln -sf . krb5
 	ln -sf ${HEIMBASE}/include/roken.h
 	ln -sf ${HEIMBASE}/dist/lib/roken/roken-common.h



CVS commit: src/crypto/external/bsd/heimdal/lib/libipc

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 20:56:52 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libipc: Makefile

Log Message:
Define an empty libinstall:: target instead of the prior methodology
which doesn't necessarily work everywhere.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/lib/libipc/Makefile

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/heimdal/lib/libipc/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libipc/Makefile:1.1 src/crypto/external/bsd/heimdal/lib/libipc/Makefile:1.2
--- src/crypto/external/bsd/heimdal/lib/libipc/Makefile:1.1	Wed Apr 13 19:16:52 2011
+++ src/crypto/external/bsd/heimdal/lib/libipc/Makefile	Fri Apr 15 20:56:51 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2011/04/13 19:16:52 elric Exp $
+# $NetBSD: Makefile,v 1.2 2011/04/15 20:56:51 elric Exp $
 
 NOLINT=		# defined
 
@@ -12,11 +12,11 @@
 LIBDPLIBS+=	util ${NETBSDSRCDIR}/lib/libutil \
 		crypt ${NETBSDSRCDIR}/lib/libcrypt
 
-INSTALL=/usr/bin/true
-
 SRCS= common.c client.c server.c
 
 HOST_CPPFLAGS+=	-I${HEIMBASE}/include -DHAVE_CONFIG_H
 
+libinstall::
+
 .include ${HEIMBASE}/Makefile.rules.inc
 .include bsd.lib.mk



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 21:01:22 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: config.h

Log Message:
We need to include nbtool_config.h when we build tools.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/include/config.h

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/heimdal/include/config.h
diff -u src/crypto/external/bsd/heimdal/include/config.h:1.1 src/crypto/external/bsd/heimdal/include/config.h:1.2
--- src/crypto/external/bsd/heimdal/include/config.h:1.1	Wed Apr 13 19:03:58 2011
+++ src/crypto/external/bsd/heimdal/include/config.h	Fri Apr 15 21:01:22 2011
@@ -1,11 +1,15 @@
 /* include/config.h.  Generated from config.h.in by configure.  */
 /* include/config.h.in.  Generated from configure.ac by autoheader.  */
 
+#if HAVE_NBTOOL_CONFIG_H
+#include nbtool_config.h
+#endif
+
 #ifndef RCSID
 #define RCSID(msg) \
 static /**/const char *const rcsid[] = { (const char *)rcsid, @(#) msg }
 #endif
-
+ 
 /* Maximum values on all known systems */
 #define MaxHostNameLen (64+4)
 #define MaxPathLen (1024+4)



CVS commit: src/crypto/external/bsd/heimdal/lib/libsl/slc

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 21:02:47 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/lib/libsl/slc: Makefile

Log Message:
No need to -lfl -ly.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile

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/heimdal/lib/libsl/slc/Makefile
diff -u src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.2 src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.3
--- src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile:1.2	Fri Apr 15 19:41:11 2011
+++ src/crypto/external/bsd/heimdal/lib/libsl/slc/Makefile	Fri Apr 15 21:02:47 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2011/04/15 19:41:11 elric Exp $
+# $NetBSD: Makefile,v 1.3 2011/04/15 21:02:47 elric Exp $
 
 NOMAN=		# defined
 
@@ -14,8 +14,6 @@
 
 YHEADER=	# defined
 
-LDADD=-lfl -ly
-
 HOST_CPPFLAGS+= -I.			\
 	-I${HEIMBASE}/include		\
 	-I${HEIMBASE}/include/krb5	\



CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-15 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Fri Apr 15 21:03:51 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/include: roken.h

Log Message:
Randomness isn't terribly necessary when we are building tools.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/include/roken.h

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/heimdal/include/roken.h
diff -u src/crypto/external/bsd/heimdal/include/roken.h:1.2 src/crypto/external/bsd/heimdal/include/roken.h:1.3
--- src/crypto/external/bsd/heimdal/include/roken.h:1.2	Thu Apr 14 18:12:08 2011
+++ src/crypto/external/bsd/heimdal/include/roken.h	Fri Apr 15 21:03:51 2011
@@ -291,7 +291,11 @@
 
 
 
+#ifdef HAVE_NBTOOL_CONFIG_H
+#define rk_random() 0
+#else
 #define rk_random() arc4random()
+#endif
 
 
 



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/krb5

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:00:30 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/krb5: auth_context.c salt.c

Log Message:
Copy coverity alloc comments from old location.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/krb5/auth_context.c \
src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c

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/heimdal/dist/lib/krb5/auth_context.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/krb5/auth_context.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/krb5/auth_context.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/krb5/auth_context.c:1.1.1.1	Wed Apr 13 18:15:31 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/krb5/auth_context.c	Thu Apr 14 18:00:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: auth_context.c,v 1.1.1.1 2011/04/13 18:15:31 elric Exp $	*/
+/*	$NetBSD: auth_context.c,v 1.2 2011/04/14 18:00:30 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
@@ -264,6 +264,7 @@
 return 0;
 }
 
+/* coverity[+alloc : arg-*2] */
 static krb5_error_code
 copy_key(krb5_context context,
 	 krb5_keyblock *in,
@@ -291,6 +292,7 @@
 return copy_key(context, auth_context-local_subkey, keyblock);
 }
 
+/* coverity[+alloc : arg-*2] */ 
 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
 krb5_auth_con_getremotesubkey(krb5_context context,
 			  krb5_auth_context auth_context,
Index: src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c:1.1.1.1	Wed Apr 13 18:15:37 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/krb5/salt.c	Thu Apr 14 18:00:30 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: salt.c,v 1.1.1.1 2011/04/13 18:15:37 elric Exp $	*/
+/*	$NetBSD: salt.c,v 1.2 2011/04/14 18:00:30 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan
@@ -35,6 +35,7 @@
 
 #include krb5_locl.h
 
+/* coverity[+alloc : arg-*3] */
 KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL
 krb5_salttype_to_string (krb5_context context,
 			 krb5_enctype etype,



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/krb5

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:02:08 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/krb5: context.c

Log Message:
Turn on the hack which disables Kerberos if there is no /etc/krb5.conf.
We should review this logic and come up with a better way to do this as
now that there are DNS SRV RRs for locating KDCs, the lack of a config
does not imply that Kerberos should be turned off.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c

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/heimdal/dist/lib/krb5/context.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c:1.1.1.1	Wed Apr 13 18:15:32 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/krb5/context.c	Thu Apr 14 18:02:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: context.c,v 1.1.1.1 2011/04/13 18:15:32 elric Exp $	*/
+/*	$NetBSD: context.c,v 1.2 2011/04/14 18:02:07 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2010 Kungliga Tekniska Högskolan
@@ -612,7 +612,7 @@
 	}
 	filenames++;
 }
-#if 0
+#if 1
 /* with this enabled and if there are no config files, Kerberos is
considererd disabled */
 if(tmp == NULL)



CVS commit: src/crypto/external/bsd/heimdal

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:12:08 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/roken: get_window_size.c
getarg.c roken.h.in
src/crypto/external/bsd/heimdal/include: roken.h

Log Message:
Replicate changes to get_window_size() made in previous location:

revision 1.7
date: 2010/01/24 16:45:57;  author: christos;  state: Exp;
make the window size function return the lines and columns
variables separately instead of depending on the existance
of struct winsize. Technically I should bump the library
version or version the symbol, but nothing seems to use
this outside the library!


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/roken/get_window_size.c \
src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c \
src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in
cvs rdiff -u -r1.1 -r1.2 src/crypto/external/bsd/heimdal/include/roken.h

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/heimdal/dist/lib/roken/get_window_size.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/roken/get_window_size.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/roken/get_window_size.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/roken/get_window_size.c:1.1.1.1	Wed Apr 13 18:15:41 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/roken/get_window_size.c	Thu Apr 14 18:12:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: get_window_size.c,v 1.1.1.1 2011/04/13 18:15:41 elric Exp $	*/
+/*	$NetBSD: get_window_size.c,v 1.2 2011/04/14 18:12:08 elric Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1997, 1998 Kungliga Tekniska Högskolan
@@ -60,32 +60,46 @@
 #include krb5/roken.h
 
 ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
-get_window_size(int fd, struct winsize *wp)
+get_window_size(int fd, int *lines, int *columns)
 {
-int ret = -1;
-
-memset(wp, 0, sizeof(*wp));
+int ret;
+char *s;
 
 #if defined(TIOCGWINSZ)
-ret = ioctl(fd, TIOCGWINSZ, wp);
+{
+	struct winsize ws;
+	ret = ioctl(fd, TIOCGWINSZ, ws);
+	if (ret != -1) {
+	if (lines)
+		*lines = ws.ws_row;
+	if (columns)
+		*columns = ws.ws_col;
+	return 0;
+	}
+}
 #elif defined(TIOCGSIZE)
 {
 	struct ttysize ts;
 	
 	ret = ioctl(fd, TIOCGSIZE, ts);
-	if(ret == 0) {
-	wp-ws_row = ts.ts_lines;
-	wp-ws_col = ts.ts_cols;
-	}
+	if (ret != -1) {
+	if (lines)
+		*lines = ts.ws_lines;
+	if (columns)
+		*columns = ts.ts_cols;
+	return 0;
+ 	}
 }
 #elif defined(HAVE__SCRSIZE)
 {
 	int dst[2];
-	
-	_scrsize(dst);
-	wp-ws_row = dst[1];
-	wp-ws_col = dst[0];
-	ret = 0;
+ 	
+ 	_scrsize(dst);
+	if (lines)
+	*lines = dst[1];
+	if (columns)
+	*columns = dst[0];
+	return 0;
 }
 #elif defined(_WIN32)
 {
@@ -102,14 +116,17 @@
 }
 }
 #endif
-if (ret != 0) {
-char *s;
-if((s = getenv(COLUMNS)))
-	wp-ws_col = atoi(s);
-	if((s = getenv(LINES)))
-	wp-ws_row = atoi(s);
-	if(wp-ws_col  0  wp-ws_row  0)
-	ret = 0;
+if (columns) {
+	if ((s = getenv(COLUMNS)))
+	*columns = atoi(s);
+	else
+	return -1;
+}
+if (lines) {
+	if ((s = getenv(LINES)))
+	*lines = atoi(s);
+	else
+	return -1;
 }
-return ret;
+return 0;
 }
Index: src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c:1.1.1.1	Wed Apr 13 18:15:41 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/roken/getarg.c	Thu Apr 14 18:12:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: getarg.c,v 1.1.1.1 2011/04/13 18:15:41 elric Exp $	*/
+/*	$NetBSD: getarg.c,v 1.2 2011/04/14 18:12:08 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
@@ -230,7 +230,6 @@
 size_t i, max_len = 0;
 char buf[128];
 int col = 0, columns;
-struct winsize ws;
 
 if (progname == NULL)
 	progname = getprogname();
@@ -242,9 +241,7 @@
 	mandoc_template(args, num_args, progname, extra_string, i18n);
 	return;
 }
-if(get_window_size(2, ws) == 0)
-	columns = ws.ws_col;
-else
+if(get_window_size(2, NULL, columns) == -1)
 	columns = 80;
 col = 0;
 col += fprintf (stderr, %s: %s, usage, progname);
Index: src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in
diff -u src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in:1.1.1.1	Wed Apr 13 18:15:42 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/roken/roken.h.in	Thu Apr 14 18:12:08 2011
@@ -759,7 +759,7 @@
 };
 #endif
 
-ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL get_window_size(int fd, 

CVS commit: src/crypto/external/bsd/heimdal

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:16:21 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal: heimdal2netbsd

Log Message:
Also take the $'s out from around $Id.*$ as well as $Id.* $.  This change
was required because there are many unexanded $Id$'s in Heimdal when you
git clone.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/crypto/external/bsd/heimdal/heimdal2netbsd

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/heimdal/heimdal2netbsd
diff -u src/crypto/external/bsd/heimdal/heimdal2netbsd:1.2 src/crypto/external/bsd/heimdal/heimdal2netbsd:1.3
--- src/crypto/external/bsd/heimdal/heimdal2netbsd:1.2	Wed Apr 13 22:16:52 2011
+++ src/crypto/external/bsd/heimdal/heimdal2netbsd	Thu Apr 14 18:16:21 2011
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: heimdal2netbsd,v 1.2 2011/04/13 22:16:52 christos Exp $
+#	$NetBSD: heimdal2netbsd,v 1.3 2011/04/14 18:16:21 elric Exp $
 #
 # Copyright (c) 2011 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -198,7 +198,7 @@
 	-e 's/\$\(Author.*\) \$/\1/' \
 	-e 's/\$\(Date.*\) \$/\1/' \
 	-e 's/\$\(Header.*\) \$/\1/' \
-	-e 's/\$\(Id.*\) \$/\1/' \
+	-e 's/\$\(Id.*\)\$/\1/' \
 	-e 's/\$\(Locker.*\) \$/\1/' \
 	-e 's/\$\(Log.*\) \$/\1/' \
 	-e 's/\$\(Name.*\) \$/\1/' \



CVS commit: src/crypto/external/bsd/heimdal/dist/kpasswd

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:18:16 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kpasswd: kpasswdd.c

Log Message:
Turn inetd support back on.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.c

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/heimdal/dist/kpasswd/kpasswdd.c
diff -u src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.c:1.2
--- src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.c:1.1.1.1	Wed Apr 13 18:14:38 2011
+++ src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.c	Thu Apr 14 18:18:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kpasswdd.c,v 1.1.1.1 2011/04/13 18:14:38 elric Exp $	*/
+/*	$NetBSD: kpasswdd.c,v 1.2 2011/04/14 18:18:16 elric Exp $	*/
 
 /*
  * Copyright (c) 1997-2005 Kungliga Tekniska Högskolan
@@ -34,7 +34,7 @@
  */
 
 #include kpasswd_locl.h
-__RCSID($NetBSD: kpasswdd.c,v 1.1.1.1 2011/04/13 18:14:38 elric Exp $);
+__RCSID($NetBSD: kpasswdd.c,v 1.2 2011/04/14 18:18:16 elric Exp $);
 
 #include kadm5/admin.h
 #ifdef HAVE_SYS_UN_H
@@ -623,6 +623,34 @@
 krb5_auth_con_free (context, auth_context);
 }
 
+#ifdef INETD_SUPPORT
+/*
+ * XXX this code relies on getsockname() returning a valid local
+ * address for a connected DGRAM socket. This is true for most, but
+ * probably not all systems. For some systems, this could be done
+ * cleaner by using the IP_RECVDSTADDR option + recvmsg().
+ */
+static int
+get_local_addr(struct sockaddr *remote, int remlen,
+	   struct sockaddr *local, socklen_t *loclen)
+{
+	int s, ret;
+
+	s = socket(remote-sa_family, SOCK_DGRAM, 0);
+	if (s  0)
+		return -1;
+
+	if (connect(s, remote, remlen)  0) {
+		close(s);
+		return -1;
+	}
+
+	ret = getsockname(s, local, loclen);
+	close(s);
+	return ret;
+}
+#endif
+
 static int
 doit (krb5_keytab keytab, int port)
 {
@@ -631,15 +659,30 @@
 int maxfd;
 krb5_realm *realms;
 krb5_addresses addrs;
+krb5_address *my_addrp;
 unsigned n, i;
 fd_set real_fdset;
 struct sockaddr_storage __ss;
 struct sockaddr *sa = (struct sockaddr *)__ss;
+#ifdef INETD_SUPPORT
+int fdz;
+int from_inetd;
+socklen_t fromlen;
+krb5_address my_addr;
+struct sockaddr_storage __local;
+struct sockaddr *localsa = (struct sockaddr *)__local;
+#endif
 
 ret = krb5_get_default_realms(context, realms);
 if (ret)
 	krb5_err (context, 1, ret, krb5_get_default_realms);
 
+#ifdef INETD_SUPPORT
+fromlen = sizeof __ss;
+from_inetd = (getsockname(0, sa, fromlen) == 0);
+
+if (!from_inetd) {
+#endif
 if (explicit_addresses.len) {
 	addrs = explicit_addresses;
 } else {
@@ -678,6 +721,16 @@
 	krb5_errx (context, 1, fd too large);
 	FD_SET(sockets[i], real_fdset);
 }
+#ifdef INETD_SUPPORT
+} else {
+n = 1;
+maxfd = 0;
+	fdz = 0;
+sockets = fdz;
+FD_ZERO(real_fdset);
+FD_SET(0, real_fdset);
+}
+#endif
 if (maxfd == -1)
 	krb5_errx (context, 1, No sockets!);
 
@@ -705,19 +758,48 @@
 		else
 			krb5_err (context, 1, errno, recvfrom);
 		}
+#ifdef INETD_SUPPORT
+		if (from_inetd) {
+			socklen_t loclen = sizeof(__local);
+			int ret2;
+
+			ret2 = get_local_addr(sa, addrlen, localsa, loclen);
+			if (ret2  0)
+krb5_errx (context, errno, get_local_addr);
+			ret2 = krb5_sockaddr2address(context, localsa,
+			my_addr);
+			if (ret2)
+krb5_errx (context, ret2,
+krb5_sockaddr2address);
+			my_addrp = my_addr;
+		} else
+#endif
+		my_addrp = addrs.val[i];
 
 		process (realms, keytab, sockets[i],
-			 addrs.val[i],
+			 my_addrp,
 			 sa, addrlen,
 			 buf, ret);
+#ifdef INETD_SUPPORT
+		if (from_inetd) {
+		krb5_free_address(context, my_addr);
+		}
+#endif
 	}
+#ifdef INETD_SUPPORT
+	if (from_inetd)
+	break;
+#endif
 }
 
 for (i = 0; i  n; ++i)
 	close(sockets[i]);
 free(sockets);
 
-krb5_free_addresses (context, addrs);
+#ifdef INETD_SUPPORT
+if (!from_inetd)
+#endif
+	krb5_free_addresses (context, addrs);
 krb5_free_host_realm (context, realms);
 krb5_free_context (context);
 return 0;



CVS commit: src/crypto/external/bsd/heimdal/dist/kuser

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:21:32 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/kuser: klist.c

Log Message:
From prior location, handle ctime returning NULL.

revision 1.11
date: 2010/04/02 15:25:04;  author: christos;  state: Exp;
make it obvious to grep that ctime is being checked.

and

revision 1.10
date: 2010/04/02 15:23:17;  author: christos;  state: Exp;
handle ctime returning NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kuser/klist.c

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/heimdal/dist/kuser/klist.c
diff -u src/crypto/external/bsd/heimdal/dist/kuser/klist.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/kuser/klist.c:1.2
--- src/crypto/external/bsd/heimdal/dist/kuser/klist.c:1.1.1.1	Wed Apr 13 18:14:39 2011
+++ src/crypto/external/bsd/heimdal/dist/kuser/klist.c	Thu Apr 14 18:21:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: klist.c,v 1.1.1.1 2011/04/13 18:14:39 elric Exp $	*/
+/*	$NetBSD: klist.c,v 1.2 2011/04/14 18:21:32 elric Exp $	*/
 
 /*
  * Copyright (c) 1997-2008 Kungliga Tekniska Högskolan
@@ -41,21 +41,29 @@
 #include kcc-commands.h
 
 static char*
-printable_time(time_t t)
+printable_time_internal(time_t t, int x)
 {
 static char s[128];
-strlcpy(s, ctime(t)+ 4, sizeof(s));
-s[15] = 0;
+char *p;
+
+if ((p = ctime(t)) == NULL)
+	strlcpy(s, ?, sizeof(s));
+else
+	strlcpy(s, p + 4, sizeof(s));
+s[x] = 0;
 return s;
 }
 
 static char*
+printable_time(time_t t)
+{
+return printable_time_internal(t, 20);
+}
+
+static char*
 printable_time_long(time_t t)
 {
-static char s[128];
-strlcpy(s, ctime(t)+ 4, sizeof(s));
-s[20] = 0;
-return s;
+return printable_time_internal(t, 20);
 }
 
 #define COL_ISSUED		NP_(  Issued,)



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/hx509

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:22:35 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/hx509: revoke.c

Log Message:
From prior location:

revision 1.2
date: 2010/04/02 15:26:17;  author: christos;  state: Exp;
handle ctime returning NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/hx509/revoke.c

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/heimdal/dist/lib/hx509/revoke.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/hx509/revoke.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/hx509/revoke.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/hx509/revoke.c:1.1.1.1	Wed Apr 13 18:15:12 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/hx509/revoke.c	Thu Apr 14 18:22:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: revoke.c,v 1.1.1.1 2011/04/13 18:15:12 elric Exp $	*/
+/*	$NetBSD: revoke.c,v 1.2 2011/04/14 18:22:35 elric Exp $	*/
 
 /*
  * Copyright (c) 2006 - 2007 Kungliga Tekniska Högskolan
@@ -1057,8 +1057,13 @@
 printable_time(time_t t)
 {
 static char s[128];
-strlcpy(s, ctime(t)+ 4, sizeof(s));
-s[20] = 0;
+char *p;
+if ((p = ctime(t)) == NULL)
+   strlcpy(s, ?, sizeof(s));
+else {
+   strlcpy(s, p + 4, sizeof(s));
+   s[20] = 0;
+}
 return s;
 }
 



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/vers

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 18:23:24 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/vers: print_version.c

Log Message:
From prior location.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/vers/print_version.c

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/heimdal/dist/lib/vers/print_version.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/vers/print_version.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/vers/print_version.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/vers/print_version.c:1.1.1.1	Wed Apr 13 18:15:44 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/vers/print_version.c	Thu Apr 14 18:23:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: print_version.c,v 1.1.1.1 2011/04/13 18:15:44 elric Exp $	*/
+/*	$NetBSD: print_version.c,v 1.2 2011/04/14 18:23:23 elric Exp $	*/
 
 /*
  * Copyright (c) 1998 - 2006 Kungliga Tekniska Högskolan
@@ -54,5 +54,7 @@
 	package_list = no version information;
 fprintf(stderr, %s (%s)\n, progname, package_list);
 fprintf(stderr, Copyright 1995-2011 Kungliga Tekniska Högskolan\n);
+#ifdef PACKAGE_BUGREPORT
 fprintf(stderr, Send bug-reports to %s\n, PACKAGE_BUGREPORT);
+#endif
 }



CVS commit: src/crypto/external/bsd/heimdal/dist

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 19:19:20 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/admin: ktutil.8
src/crypto/external/bsd/heimdal/dist/kadmin: kadmin.8 kadmind.8
src/crypto/external/bsd/heimdal/dist/kcm: kcm.8
src/crypto/external/bsd/heimdal/dist/kdc: hprop.8 hpropd.8 kdc.8
kstash.8 string2key.8
src/crypto/external/bsd/heimdal/dist/kpasswd: kpasswdd.8
src/crypto/external/bsd/heimdal/dist/kuser: kdestroy.1 kgetcred.1
kimpersonate.8 kinit.1 klist.1
src/crypto/external/bsd/heimdal/dist/lib/gssapi: gssapi.3
src/crypto/external/bsd/heimdal/dist/lib/kadm5: iprop-log.8 iprop.8
src/crypto/external/bsd/heimdal/dist/lib/krb5: krb5_get_in_cred.3
krb5_init_context.3

Log Message:
Updates to man pages found as diffs in prior location in a batch.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/admin/ktutil.8
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kadmin/kadmin.8 \
src/crypto/external/bsd/heimdal/dist/kadmin/kadmind.8
cvs rdiff -u -r1.1.1.2 -r1.2 src/crypto/external/bsd/heimdal/dist/kcm/kcm.8
cvs rdiff -u -r1.1.1.2 -r1.2 src/crypto/external/bsd/heimdal/dist/kdc/hprop.8 \
src/crypto/external/bsd/heimdal/dist/kdc/hpropd.8 \
src/crypto/external/bsd/heimdal/dist/kdc/kdc.8 \
src/crypto/external/bsd/heimdal/dist/kdc/kstash.8 \
src/crypto/external/bsd/heimdal/dist/kdc/string2key.8
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kpasswd/kpasswdd.8
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/kuser/kdestroy.1 \
src/crypto/external/bsd/heimdal/dist/kuser/kgetcred.1 \
src/crypto/external/bsd/heimdal/dist/kuser/kimpersonate.8 \
src/crypto/external/bsd/heimdal/dist/kuser/kinit.1 \
src/crypto/external/bsd/heimdal/dist/kuser/klist.1
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/gssapi/gssapi.3
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/kadm5/iprop-log.8 \
src/crypto/external/bsd/heimdal/dist/lib/kadm5/iprop.8
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/krb5/krb5_get_in_cred.3 \
src/crypto/external/bsd/heimdal/dist/lib/krb5/krb5_init_context.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/heimdal/dist/admin/ktutil.8
diff -u src/crypto/external/bsd/heimdal/dist/admin/ktutil.8:1.1.1.2 src/crypto/external/bsd/heimdal/dist/admin/ktutil.8:1.2
--- src/crypto/external/bsd/heimdal/dist/admin/ktutil.8:1.1.1.2	Thu Apr 14 14:08:06 2011
+++ src/crypto/external/bsd/heimdal/dist/admin/ktutil.8	Thu Apr 14 19:19:19 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: ktutil.8,v 1.1.1.2 2011/04/14 14:08:06 elric Exp $
+.\	$NetBSD: ktutil.8,v 1.2 2011/04/14 19:19:19 elric Exp $
 .\
 .\ Copyright (c) 1997-2004 Kungliga Tekniska Högskolan
 .\ (Royal Institute of Technology, Stockholm, Sweden). 
@@ -55,72 +55,43 @@
 is a program for managing keytabs.
 Supported options:
 .Bl -tag -width Ds
-.It Xo
-.Fl v ,
-.Fl -verbose
-.Xc
+.It Fl v , Fl -verbose
 Verbose output.
 .El
 .Pp
 .Ar command
 can be one of the following:
 .Bl -tag -width srvconvert
-.It add Xo
-.Op Fl p Ar principal
-.Op Fl -principal= Ns Ar principal
-.Op Fl V Ar kvno
-.Op Fl -kvno= Ns Ar kvno
-.Op Fl e Ar enctype
-.Op Fl -enctype= Ns Ar enctype
-.Op Fl w Ar password
-.Op Fl -password= Ns Ar password
-.Op Fl r
-.Op Fl -random
-.Op Fl s
-.Op Fl -no-salt
-.Op Fl H
-.Op Fl -hex
-.Xc
+.It add Oo Fl p Ar principal Oc Oo Fl -principal= Ns Ar principal Oc \
+Oo Fl V Ar kvno Oc Oo Fl -kvno= Ns Ar kvno Oc Oo Fl e Ar enctype Oc \
+Oo Fl -enctype= Ns Ar enctype Oc Oo Fl w Ar password Oc \
+Oo Fl -password= Ns Ar password Oc Oo Fl r Oc Oo Fl -random Oc \
+Oo Fl s Oc Oo Fl -no-salt Oc Oo Fl H Oc Op Fl -hex
 Adds a key to the keytab. Options that are not specified will be
 prompted for. This requires that you know the password or the hex key of the
 principal to add; if what you really want is to add a new principal to
 the keytab, you should consider the
 .Ar get
 command, which talks to the kadmin server.
-.It change Xo
-.Op Fl r Ar realm
-.Op Fl -realm= Ns Ar realm
-.Op Fl -a Ar host
-.Op Fl -admin-server= Ns Ar host
-.Op Fl -s Ar port
-.Op Fl -server-port= Ns Ar port
-.Xc
+.It change Oo Fl r Ar realm Oc Oo Fl -realm= Ns Ar realm Oc \
+Oo Fl -a Ar host Oc Oo Fl -admin-server= Ns Ar host Oc \
+Oo Fl -s Ar port Oc Op Fl -server-port= Ns Ar port
 Update one or several keys to new versions.  By default, use the admin
 server for the realm of a keytab entry.  Otherwise it will use the
 values specified by the options.
 .Pp
 If no principals are given, all the ones in the keytab are updated.
-.It copy Xo
-.Ar keytab-src
-.Ar keytab-dest
-.Xc
+.It copy Ar keytab-src Ar 

CVS commit: src/tools/slc

2011-04-14 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Apr 14 19:38:21 UTC 2011

Added Files:
src/tools/slc: Makefile

Log Message:
Tool for slc, a command built during the Heimdal build.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/tools/slc/Makefile

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

Added files:

Index: src/tools/slc/Makefile
diff -u /dev/null src/tools/slc/Makefile:1.1
--- /dev/null	Thu Apr 14 19:38:21 2011
+++ src/tools/slc/Makefile	Thu Apr 14 19:38:21 2011
@@ -0,0 +1,6 @@
+#	$NetBSD: Makefile,v 1.1 2011/04/14 19:38:21 elric Exp $
+
+HOSTPROGNAME=	${_TOOL_PREFIX}slc
+HOST_SRCDIR=	crypto/external/bsd/heimdal/lib/libsl/slc
+
+.include ${.CURDIR}/../Makefile.host



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/hdb

2011-04-13 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Apr 13 18:23:42 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/hdb: hdb.c

Log Message:
Conditionalise the sqlite3 HDB backend.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/hdb/hdb.c

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/heimdal/dist/lib/hdb/hdb.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/hdb/hdb.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/hdb/hdb.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/hdb/hdb.c:1.1.1.1	Wed Apr 13 18:14:42 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/hdb/hdb.c	Wed Apr 13 18:23:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hdb.c,v 1.1.1.1 2011/04/13 18:14:42 elric Exp $	*/
+/*	$NetBSD: hdb.c,v 1.2 2011/04/13 18:23:42 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan
@@ -80,7 +80,9 @@
 { HDB_INTERFACE_VERSION, ldap:,	hdb_ldap_create},
 { HDB_INTERFACE_VERSION, ldapi:,	hdb_ldapi_create},
 #endif
+#ifdef SQLITE3
 { HDB_INTERFACE_VERSION, sqlite:, hdb_sqlite_create},
+#endif
 {0, NULL,	NULL}
 };
 



CVS commit: src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5

2011-04-13 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Apr 13 18:30:04 UTC 2011

Modified Files:
src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5:
init_sec_context.c

Log Message:
_gss_DES3_get_mic_compat() requires that ctx-target has been defined, and,
well, it hasn't yet.  Move the call down to after it is defined and things
are better.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5/init_sec_context.c

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/heimdal/dist/lib/gssapi/krb5/init_sec_context.c
diff -u src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5/init_sec_context.c:1.1.1.1 src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5/init_sec_context.c:1.2
--- src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5/init_sec_context.c:1.1.1.1	Wed Apr 13 18:14:45 2011
+++ src/crypto/external/bsd/heimdal/dist/lib/gssapi/krb5/init_sec_context.c	Wed Apr 13 18:30:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: init_sec_context.c,v 1.1.1.1 2011/04/13 18:14:45 elric Exp $	*/
+/*	$NetBSD: init_sec_context.c,v 1.2 2011/04/13 18:30:04 elric Exp $	*/
 
 /*
  * Copyright (c) 1997 - 2008 Kungliga Tekniska Högskolan
@@ -424,10 +424,6 @@
 	goto failure;
 }
 
-ret = _gss_DES3_get_mic_compat(minor_status, ctx, context);
-if (ret)
-	goto failure;
-
 
 /*
  * This is hideous glue for (NFS) clients that wants to limit the
@@ -471,6 +467,10 @@
 
 ctx-lifetime = ctx-kcred-times.endtime;
 
+ret = _gss_DES3_get_mic_compat(minor_status, ctx, context);
+if (ret)
+	goto failure;
+
 ret = _gsskrb5_lifetime_left(minor_status,
  context,
  ctx-lifetime,



CVS commit: src/crypto/external/bsd/heimdal

2011-04-13 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Apr 13 19:04:40 UTC 2011

Added Files:
src/crypto/external/bsd/heimdal: heimdal2netbsd

Log Message:
Script to convert a git clone of Heimdal into our dist format.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/crypto/external/bsd/heimdal/heimdal2netbsd

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

Added files:

Index: src/crypto/external/bsd/heimdal/heimdal2netbsd
diff -u /dev/null src/crypto/external/bsd/heimdal/heimdal2netbsd:1.1
--- /dev/null	Wed Apr 13 19:04:40 2011
+++ src/crypto/external/bsd/heimdal/heimdal2netbsd	Wed Apr 13 19:04:40 2011
@@ -0,0 +1,258 @@
+#! /bin/sh
+#
+#	$NetBSD: heimdal2netbsd,v 1.1 2011/04/13 19:04:40 elric Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# heimdal2netbsd:  convert a heimdal source tree into a
+# netbsd amd source tree, under src/crypto/external/bsd/heimdal/dist
+# based on bind2netbsd by Bernd Ernesti and changes by Simon Burge
+#
+# Rough instructions for importing new heimdal release from their git
+# repository:
+#
+#	$ export SRCDIR=/usr/src
+#	$ export HEIMDAL_SRCDIR=src/crypto/external/bsd/heimdal
+#	$ cd /some/where/temporary
+#	$ git clone git://svn.h5l.org/heimdal.git
+#	$ sh $SRCDIR/$HEIMDAL_SRCDIR/heimdal2netbsd heimdal `pwd`
+#	$ cd $HEIMDAL_SRCDIR/dist
+#   $ cvs -d ... import $HEIMDAL_SRCDIR/dist HEIMDAL head-20110317
+#	$ cd /some/where/temporary/heimdal
+#	$ autoreconf -f -i
+#	$ ./configure
+#	$ make
+#	 merge newly generated config.h
+#	 with $HEIMDAL_SRCDIR/include/config.h
+#	 and check out diffs in generated headers
+#	 and C files.
+#	$ cd ..
+#	$ rm -r src heimdal
+#	$ cd $SRCDIR/$HEIMDAL_SRCDIR
+#	$ cvs commit -m Updated generated files for Heimdal head-20110317
+#
+#	- check makefiles to see if any extra sources have been added.
+#	- update distrib/sets if necessary.
+
+if [ $# -ne 2 ]; then echo heimdal2netbsd src dest; exit 1; fi
+
+r=$1
+d=$2/src/crypto/external/bsd/heimdal/dist
+
+case $d in
+	/*)
+		;;
+	*)
+		d=`/bin/pwd`/$d
+		;;
+esac
+
+case $r in
+	/*)
+		;;
+	*)
+		r=`/bin/pwd`/$r
+		;;
+esac
+
+echo preparing directory $d
+rm -rf $d
+mkdir -p $d
+
+### Copy the files and directories
+echo copying $r to $d
+cd $r
+pax -rw * $d
+
+### Remove unneeded files
+#echo removing unneeded directories and files
+#find $d/po -name '*[0-9] XXX:
+find $d -name '*.cat[0-9]' | xargs rm -f  echo removed catman pages
+find $d -name '*.info' | xargs rm -f	  echo removed info pages
+rm -rf $d/appl  echo removed appl
+rm -rf $d/lib/libedit			  echo removed lib/libedit
+rm -rf $d/lib/sqlite			  echo removed lib/sqlite
+rm -rf $d/doc/standardisation		  echo removed doc/standardisation
+
+# Fix man pages
+find $d -type f -name '*.[1358]' -print | while read f; do
+	sed \
+	-e 's,\.Os HEIMDAL,.Os,' \
+	-e 's,\.Pa krb5.h,.Pa krb5/krb5.h,' \
+	-e 's,\.In krb5.h,.In krb5/krb5.h,' \
+	-e 's,\.Pa gssapi.h,.Pa gssapi/gssapi.h,' \
+	-e 's,\.In gssapi.h,.In gssapi/gssapi.h,' \
+	-e 's,#include krb5.h,#include krb5/krb5.h,' \
+	 $f  /tmp/heimdal1f$$  mv /tmp/heimdal1f$$ $f  \
+	echo fixing man page $f
+done
+
+# Fix include usage
+
+KRB5_INCRE=asn1-common|asn1_err
+KRB5_INCRE=$KRB5_INCRE|base64
+KRB5_INCRE=$KRB5_INCRE|cms_asn1
+KRB5_INCRE=$KRB5_INCRE|com_err
+KRB5_INCRE=$KRB5_INCRE|com_right
+KRB5_INCRE=$KRB5_INCRE|crmf_asn1
+KRB5_INCRE=$KRB5_INCRE|der|der-protos
+KRB5_INCRE=$KRB5_INCRE|digest_asn1
+KRB5_INCRE=$KRB5_INCRE|getarg
+KRB5_INCRE=$KRB5_INCRE|hdb|hdb_err|hdb-protos|hdb_asn1
+KRB5_INCRE=$KRB5_INCRE|heim_asn1|heim_err

CVS commit: src/crypto/external/bsd/heimdal/include

2011-04-13 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Wed Apr 13 19:15:27 UTC 2011

Added Files:
src/crypto/external/bsd/heimdal/include: heimntlm-protos.h

Log Message:
Autogenerated headers for heimdal head-20110412.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 \
src/crypto/external/bsd/heimdal/include/heimntlm-protos.h

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

Added files:

Index: src/crypto/external/bsd/heimdal/include/heimntlm-protos.h
diff -u /dev/null src/crypto/external/bsd/heimdal/include/heimntlm-protos.h:1.1
--- /dev/null	Wed Apr 13 19:15:27 2011
+++ src/crypto/external/bsd/heimdal/include/heimntlm-protos.h	Wed Apr 13 19:15:27 2011
@@ -0,0 +1,194 @@
+/* This is a generated file */
+#ifndef __heimntlm_protos_h__
+#define __heimntlm_protos_h__
+
+#include stdarg.h
+
+#ifdef __cplusplus
+extern C {
+#endif
+
+int
+heim_ntlm_build_ntlm1_master (
+	void */*key*/,
+	size_t /*len*/,
+	struct ntlm_buf */*session*/,
+	struct ntlm_buf */*master*/);
+
+int
+heim_ntlm_build_ntlm2_master (
+	void */*key*/,
+	size_t /*len*/,
+	struct ntlm_buf */*blob*/,
+	struct ntlm_buf */*session*/,
+	struct ntlm_buf */*master*/);
+
+int
+heim_ntlm_calculate_lm2 (
+	const void */*key*/,
+	size_t /*len*/,
+	const char */*username*/,
+	const char */*target*/,
+	const unsigned char serverchallenge[8],
+	unsigned char ntlmv2[16],
+	struct ntlm_buf */*answer*/);
+
+int
+heim_ntlm_calculate_ntlm1 (
+	void */*key*/,
+	size_t /*len*/,
+	unsigned char challenge[8],
+	struct ntlm_buf */*answer*/);
+
+int
+heim_ntlm_calculate_ntlm2 (
+	const void */*key*/,
+	size_t /*len*/,
+	const char */*username*/,
+	const char */*target*/,
+	const unsigned char serverchallenge[8],
+	const struct ntlm_buf */*infotarget*/,
+	unsigned char ntlmv2[16],
+	struct ntlm_buf */*answer*/);
+
+int
+heim_ntlm_calculate_ntlm2_sess (
+	const unsigned char clnt_nonce[8],
+	const unsigned char svr_chal[8],
+	const unsigned char ntlm_hash[16],
+	struct ntlm_buf */*lm*/,
+	struct ntlm_buf */*ntlm*/);
+
+int
+heim_ntlm_calculate_ntlm2_sess_hash (
+	const unsigned char clnt_nonce[8],
+	const unsigned char svr_chal[8],
+	unsigned char verifier[8]);
+
+int
+heim_ntlm_decode_targetinfo (
+	const struct ntlm_buf */*data*/,
+	int /*ucs2*/,
+	struct ntlm_targetinfo */*ti*/);
+
+int
+heim_ntlm_decode_type1 (
+	const struct ntlm_buf */*buf*/,
+	struct ntlm_type1 */*data*/);
+
+int
+heim_ntlm_decode_type2 (
+	const struct ntlm_buf */*buf*/,
+	struct ntlm_type2 */*type2*/);
+
+int
+heim_ntlm_decode_type3 (
+	const struct ntlm_buf */*buf*/,
+	int /*ucs2*/,
+	struct ntlm_type3 */*type3*/);
+
+void
+heim_ntlm_derive_ntlm2_sess (
+	const unsigned char sessionkey[16],
+	const unsigned char */*clnt_nonce*/,
+	size_t /*clnt_nonce_length*/,
+	const unsigned char svr_chal[8],
+	unsigned char derivedkey[16]);
+
+int
+heim_ntlm_encode_targetinfo (
+	const struct ntlm_targetinfo */*ti*/,
+	int /*ucs2*/,
+	struct ntlm_buf */*data*/);
+
+int
+heim_ntlm_encode_type1 (
+	const struct ntlm_type1 */*type1*/,
+	struct ntlm_buf */*data*/);
+
+int
+heim_ntlm_encode_type2 (
+	const struct ntlm_type2 */*type2*/,
+	struct ntlm_buf */*data*/);
+
+int
+heim_ntlm_encode_type3 (
+	const struct ntlm_type3 */*type3*/,
+	struct ntlm_buf */*data*/);
+
+void
+heim_ntlm_free_buf (struct ntlm_buf */*p*/);
+
+void
+heim_ntlm_free_targetinfo (struct ntlm_targetinfo */*ti*/);
+
+void
+heim_ntlm_free_type1 (struct ntlm_type1 */*data*/);
+
+void
+heim_ntlm_free_type2 (struct ntlm_type2 */*data*/);
+
+void
+heim_ntlm_free_type3 (struct ntlm_type3 */*data*/);
+
+int
+heim_ntlm_keyex_unwrap (
+	struct ntlm_buf */*baseKey*/,
+	struct ntlm_buf */*encryptedSession*/,
+	struct ntlm_buf */*session*/);
+
+int
+heim_ntlm_keyex_wrap (
+	struct ntlm_buf */*base_session*/,
+	struct ntlm_buf */*session*/,
+	struct ntlm_buf */*encryptedSession*/);
+
+int
+heim_ntlm_nt_key (
+	const char */*password*/,
+	struct ntlm_buf */*key*/);
+
+int
+heim_ntlm_ntlmv2_key (
+	const void */*key*/,
+	size_t /*len*/,
+	const char */*username*/,
+	const char */*target*/,
+	unsigned char ntlmv2[16]);
+
+size_t
+heim_ntlm_unparse_flags (
+	uint32_t /*flags*/,
+	char */*s*/,
+	size_t /*len*/);
+
+int
+heim_ntlm_v1_base_session (
+	void */*key*/,
+	size_t /*len*/,
+	struct ntlm_buf */*session*/);
+
+int
+heim_ntlm_v2_base_session (
+	void */*key*/,
+	size_t /*len*/,
+	struct ntlm_buf */*ntlmResponse*/,
+	struct ntlm_buf */*session*/);
+
+int
+heim_ntlm_verify_ntlm2 (
+	const void */*key*/,
+	size_t /*len*/,
+	const char */*username*/,
+	const char */*target*/,
+	time_t /*now*/,
+	const unsigned char serverchallenge[8],
+	const struct ntlm_buf */*answer*/,
+	struct ntlm_buf */*infotarget*/,
+	unsigned char ntlmv2[16]);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __heimntlm_protos_h__ */



CVS commit: src/sbin/cgdconfig

2010-12-02 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Dec  2 18:02:58 UTC 2010

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
Remove a line that was intended only for my personal testing and that
breaks things.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.30 src/sbin/cgdconfig/cgdconfig.c:1.31
--- src/sbin/cgdconfig/cgdconfig.c:1.30	Thu Dec  2 04:54:32 2010
+++ src/sbin/cgdconfig/cgdconfig.c	Thu Dec  2 18:02:58 2010
@@ -1,6 +1,4 @@
-#define opendisk1(x,y,z,t,u,v) opendisk(x,y,z,t,u)
-
-/* $NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.31 2010/12/02 18:02:58 elric Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -35,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT(@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.);
-__RCSID($NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $);
+__RCSID($NetBSD: cgdconfig.c,v 1.31 2010/12/02 18:02:58 elric Exp $);
 #endif
 
 #include err.h



CVS commit: src/sbin/cgdconfig

2010-12-01 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Thu Dec  2 04:54:32 UTC 2010

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
In -G, refuse to operate if KEYGEN_URANDOM is specified as we already do
for KEYGEN_RANDOMKEY.

Print a warning if such a refusal is made---this will help the user understand
why there is an error.

Patch provided by:  Taylor R Campbell campbell+net...@mumble.net.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.29 src/sbin/cgdconfig/cgdconfig.c:1.30
--- src/sbin/cgdconfig/cgdconfig.c:1.29	Sat Nov 27 17:08:36 2010
+++ src/sbin/cgdconfig/cgdconfig.c	Thu Dec  2 04:54:32 2010
@@ -1,4 +1,6 @@
-/* $NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $ */
+#define opendisk1(x,y,z,t,u,v) opendisk(x,y,z,t,u)
+
+/* $NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +35,7 @@
 #ifndef lint
 __COPYRIGHT(@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.);
-__RCSID($NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $);
+__RCSID($NetBSD: cgdconfig.c,v 1.30 2010/12/02 04:54:32 elric Exp $);
 #endif
 
 #include err.h
@@ -872,11 +874,17 @@
 
 	/* for sanity, we ensure that none of the keygens are randomkey */
 	for (kg=p-keygen; kg; kg=kg-next)
-		if (kg-kg_method == KEYGEN_RANDOMKEY)
+		if ((kg-kg_method == KEYGEN_RANDOMKEY) ||
+		(kg-kg_method == KEYGEN_URANDOMKEY)) {
+			warnx(can't preserve randomly generated key);
 			goto bail;
+		}
 	for (kg=oldp-keygen; kg; kg=kg-next)
-		if (kg-kg_method == KEYGEN_RANDOMKEY)
+		if ((kg-kg_method == KEYGEN_RANDOMKEY) ||
+		(kg-kg_method == KEYGEN_URANDOMKEY)) {
+			warnx(can't preserve randomly generated key);
 			goto bail;
+		}
 
 	if (!params_verify(oldp)) {
 		warnx(invalid old parameters file \%s\, *argv);



CVS commit: src/sbin/cgdconfig

2010-11-27 Thread Roland Dowdeswell
Module Name:src
Committed By:   elric
Date:   Sat Nov 27 17:08:37 UTC 2010

Modified Files:
src/sbin/cgdconfig: cgdconfig.c pkcs5_pbkdf2.c

Log Message:
Remove trailing whitespace (patch provided by:  Taylor R Campbell
campbell+net...@mumble.net)


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sbin/cgdconfig/cgdconfig.c
cvs rdiff -u -r1.14 -r1.15 src/sbin/cgdconfig/pkcs5_pbkdf2.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.28 src/sbin/cgdconfig/cgdconfig.c:1.29
--- src/sbin/cgdconfig/cgdconfig.c:1.28	Tue Sep  8 21:36:35 2009
+++ src/sbin/cgdconfig/cgdconfig.c	Sat Nov 27 17:08:36 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.28 2009/09/08 21:36:35 pooka Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT(@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.);
-__RCSID($NetBSD: cgdconfig.c,v 1.28 2009/09/08 21:36:35 pooka Exp $);
+__RCSID($NetBSD: cgdconfig.c,v 1.29 2010/11/27 17:08:36 elric Exp $);
 #endif
 
 #include err.h
@@ -393,7 +393,7 @@
 }
 
 /*ARGSUSED*/
-/* 
+/*
  * XXX take, and pass through, a compat flag that indicates whether we
  * provide backwards compatibility with a previous bug.  The previous
  * behaviour is indicated by the keygen method pkcs5_pbkdf2, and a
@@ -795,7 +795,7 @@
 
 	ret = 0;
 	for (kg = p-keygen; kg  !ret; kg = kg-next) {
-		if ((kg-kg_method != KEYGEN_PKCS5_PBKDF2_SHA1)  
+		if ((kg-kg_method != KEYGEN_PKCS5_PBKDF2_SHA1) 
 		(kg-kg_method != KEYGEN_PKCS5_PBKDF2_OLD ))
 			continue;
 

Index: src/sbin/cgdconfig/pkcs5_pbkdf2.c
diff -u src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.14 src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.15
--- src/sbin/cgdconfig/pkcs5_pbkdf2.c:1.14	Mon Apr 28 20:23:08 2008
+++ src/sbin/cgdconfig/pkcs5_pbkdf2.c	Sat Nov 27 17:08:37 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pkcs5_pbkdf2.c,v 1.14 2008/04/28 20:23:08 martin Exp $ */
+/* $NetBSD: pkcs5_pbkdf2.c,v 1.15 2010/11/27 17:08:37 elric Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: pkcs5_pbkdf2.c,v 1.14 2008/04/28 20:23:08 martin Exp $);
+__RCSID($NetBSD: pkcs5_pbkdf2.c,v 1.15 2010/11/27 17:08:37 elric Exp $);
 #endif
 
 #include sys/resource.h
@@ -93,7 +93,7 @@
 		if (first_time) {
 			(void)memcpy(r, tmp, PRF_BLOCKLEN);
 			first_time = 0;
-		} else 
+		} else
 			memxor(r, tmp, PRF_BLOCKLEN);
 		(void)memcpy(data, tmp, PRF_BLOCKLEN);
 		datalen = PRF_BLOCKLEN;
@@ -128,7 +128,7 @@
 
 	/* Step 3 */
 	for (i = 0; i  l; i++)
-		prf_iterate(*r + (PRF_BLOCKLEN * i), P, Plen, S, Slen, c, 
+		prf_iterate(*r + (PRF_BLOCKLEN * i), P, Plen, S, Slen, c,
 			(compat?i:i+1));
 
 	/* Step 4 and 5



CVS commit: xsrc/xfree/xc/programs/Xserver/hw/netbsd

2009-10-27 Thread Roland Dowdeswell
Module Name:xsrc
Committed By:   elric
Date:   Tue Oct 27 23:17:13 UTC 2009

Modified Files:
xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb: sfbsimpleblt.c
xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga: tgasimpleblt.c
xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/sfb: sfbsimpleblt.c
xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/tga: tgasimpleblt.c

Log Message:
Assign my copyrights to TNF in exchange for a beer that christos@
bought me a while ago...


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c
cvs rdiff -u -r1.1 -r1.2 \
xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c
cvs rdiff -u -r1.1 -r1.2 \
xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/sfb/sfbsimpleblt.c
cvs rdiff -u -r1.1 -r1.2 \
xsrc/xfree/xc/programs/Xserver/hw/netbsd/dec/tga/tgasimpleblt.c

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

Modified files:

Index: xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c
diff -u xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c:1.1 xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c:1.2
--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c:1.1	Sun Jan 18 04:13:22 2004
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/sfb/sfbsimpleblt.c	Tue Oct 27 23:17:12 2009
@@ -1,11 +1,15 @@
-/* $NetBSD: sfbsimpleblt.c,v 1.1 2004/01/18 04:13:22 rtr Exp $ */
+/* $NetBSD: sfbsimpleblt.c,v 1.2 2009/10/27 23:17:12 elric Exp $ */
 
 /*
  * sfb simple rops
  */
 
 /*-
- * Copyright (c) 1995, 1996, 1998 Roland C. Dowdeswell.  All rights reserved.
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Roland C. Dowdeswell.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -15,22 +19,18 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *  This product includes software developed by Roland C. Dowdeswell.
- * 4. The name of the authors may not be used to endorse or promote products
- *  derived from this software without specific prior written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
 #define PSZ	8

Index: xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c
diff -u xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c:1.1 xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c:1.2
--- xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c:1.1	Sun Jan 18 04:13:22 2004
+++ xsrc/xfree/xc/programs/Xserver/hw/netbsd/alpha/tga/tgasimpleblt.c	Tue Oct 27 23:17:12 2009
@@ -1,11 +1,15 @@
-/* $NetBSD: tgasimpleblt.c,v 1.1 2004/01/18 04:13:22 rtr Exp $ */
+/* $NetBSD: tgasimpleblt.c,v 1.2 2009/10/27 23:17:12 elric Exp $ */
 
 /*
  * tga simple rops
  */
 
 /*-
- * Copyright (c) 1995, 1996, 1998 Roland C. Dowdeswell.  All rights reserved.
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All