Skip to content

Commit 4289ab8

Browse files
committed
Merge branch 'user-src-clean' into user-src
2 parents cd1f151 + e964d6e commit 4289ab8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1125
-239
lines changed

bin/ls/ls.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: ls.c,v 1.74 2014/04/02 10:55:47 wiz Exp $ */
1+
/* $NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $ */
22

33
/*
44
* Copyright (c) 1989, 1993, 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\
4242
#if 0
4343
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
4444
#else
45-
__RCSID("$NetBSD: ls.c,v 1.74 2014/04/02 10:55:47 wiz Exp $");
45+
__RCSID("$NetBSD: ls.c,v 1.75 2016/05/30 17:26:29 dholland Exp $");
4646
#endif
4747
#endif /* not lint */
4848

@@ -631,7 +631,7 @@ display(FTSENT *p, FTSENT *list)
631631
if (f_humanize) {
632632
d.s_block = 4; /* min buf length for humanize_number */
633633
} else {
634-
(void)snprintf(buf, sizeof(buf), "%llu",
634+
(void)snprintf(buf, sizeof(buf), "%lld",
635635
(long long)howmany(maxblock, blocksize));
636636
d.s_block = strlen(buf);
637637
if (f_commas) /* allow for commas before every third digit */
@@ -647,17 +647,17 @@ display(FTSENT *p, FTSENT *list)
647647
if (f_humanize) {
648648
d.s_size = 4; /* min buf length for humanize_number */
649649
} else {
650-
(void)snprintf(buf, sizeof(buf), "%llu",
650+
(void)snprintf(buf, sizeof(buf), "%lld",
651651
(long long)maxsize);
652652
d.s_size = strlen(buf);
653653
if (f_commas) /* allow for commas before every third digit */
654654
d.s_size += (d.s_size - 1) / 3;
655655
}
656656
d.s_user = maxuser;
657657
if (bcfile) {
658-
(void)snprintf(buf, sizeof(buf), "%u", maxmajor);
658+
(void)snprintf(buf, sizeof(buf), "%d", maxmajor);
659659
d.s_major = strlen(buf);
660-
(void)snprintf(buf, sizeof(buf), "%u", maxminor);
660+
(void)snprintf(buf, sizeof(buf), "%d", maxminor);
661661
d.s_minor = strlen(buf);
662662
if (d.s_major + d.s_minor + 2 > d.s_size)
663663
d.s_size = d.s_major + d.s_minor + 2;

bin/pax/ar_io.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $ */
1+
/* $NetBSD: ar_io.c,v 1.57 2016/05/31 03:32:36 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 1992 Keith Muller.
@@ -42,7 +42,7 @@
4242
#if 0
4343
static char sccsid[] = "@(#)ar_io.c 8.2 (Berkeley) 4/18/94";
4444
#else
45-
__RCSID("$NetBSD: ar_io.c,v 1.56 2015/03/09 23:38:08 sevan Exp $");
45+
__RCSID("$NetBSD: ar_io.c,v 1.57 2016/05/31 03:32:36 dholland Exp $");
4646
#endif
4747
#endif /* not lint */
4848

@@ -1631,7 +1631,6 @@ void
16311631
ar_summary(int n)
16321632
{
16331633
time_t secs;
1634-
int len;
16351634
char buf[BUFSIZ];
16361635
char tbuf[MAXPATHLEN/4]; /* XXX silly size! */
16371636
char s1buf[MAXPATHLEN/8]; /* XXX very silly size! */
@@ -1657,33 +1656,32 @@ ar_summary(int n)
16571656
* could have written anything yet.
16581657
*/
16591658
if (frmt == NULL && act != COPY) {
1660-
len = snprintf(buf, sizeof(buf),
1659+
snprintf(buf, sizeof(buf),
16611660
"unknown format, %s skipped in %s\n",
16621661
sizefmt(s1buf, sizeof(s1buf), rdcnt),
16631662
timefmt(tbuf, sizeof(tbuf), rdcnt, secs, "bytes"));
16641663
if (n == 0)
16651664
(void)fprintf(outf, "%s: %s", argv0, buf);
16661665
else
1667-
(void)write(STDERR_FILENO, buf, len);
1666+
(void)write(STDERR_FILENO, buf, strlen(buf));
16681667
return;
16691668
}
16701669

16711670

16721671
if (n != 0 && *archd.name) {
1673-
len = snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n",
1672+
snprintf(buf, sizeof(buf), "Working on `%s' (%s)\n",
16741673
archd.name, sizefmt(s1buf, sizeof(s1buf), archd.sb.st_size));
1675-
(void)write(STDERR_FILENO, buf, len);
1676-
len = 0;
1674+
(void)write(STDERR_FILENO, buf, strlen(buf));
16771675
}
16781676

16791677

16801678
if (act == COPY) {
1681-
len = snprintf(buf, sizeof(buf),
1679+
snprintf(buf, sizeof(buf),
16821680
"%lu files in %s\n",
16831681
(unsigned long)flcnt,
16841682
timefmt(tbuf, sizeof(tbuf), flcnt, secs, "files"));
16851683
} else {
1686-
len = snprintf(buf, sizeof(buf),
1684+
snprintf(buf, sizeof(buf),
16871685
"%s vol %d, %lu files, %s read, %s written in %s\n",
16881686
frmt->name, arvol-1, (unsigned long)flcnt,
16891687
sizefmt(s1buf, sizeof(s1buf), rdcnt),

bin/pax/dumptar.c

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dumptar.c,v 1.2 2008/04/28 20:22:51 martin Exp $ */
1+
/* $NetBSD: dumptar.c,v 1.3 2016/05/30 17:34:35 dholland Exp $ */
22

33
/*-
44
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -30,29 +30,38 @@
3030
*/
3131

3232
#include <stdio.h>
33-
#include <err.h>
33+
#include <string.h>
34+
#include <stdlib.h>
35+
#include <unistd.h>
3436
#include <fcntl.h>
37+
#include <err.h>
38+
#include <assert.h>
3539
#include <sys/stat.h>
3640
#include <sys/mman.h>
3741

3842
#include "tar.h"
3943

4044
#define ussum(a) 1
4145

46+
/*
47+
* Ensure null termination.
48+
*/
4249
static char *
4350
buf(const char *p, size_t s)
4451
{
4552
static char buf[1024];
46-
(void)snprintf(buf, sizeof(buf), "%s", p);
53+
54+
assert(s < sizeof(buf));
55+
memcpy(buf, p, s);
4756
buf[s] = '\0';
4857
return buf;
4958
}
5059

51-
int
60+
static int
5261
intarg(const char *p, size_t s)
5362
{
5463
char *ep, *b = buf(p, s);
55-
int r = (int)strtol(p, &ep, 8);
64+
int r = (int)strtol(b, &ep, 8);
5665
return r;
5766
}
5867

external/bsd/tcpdump/bin/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.13 2015/03/31 21:59:35 christos Exp $
1+
# $NetBSD: Makefile,v 1.14 2016/06/29 19:45:14 christos Exp $
22

33
WARNS?= 1 # XXX: need to cleanup later
44

@@ -183,7 +183,7 @@ CPPFLAGS+=-DINET6=1 -DHAVE_RES_USE_INET6=1
183183
.endif
184184

185185
.if (${MKCRYPTO} != "no")
186-
CPPFLAGS+=-DHAVE_LIBCRYPTO=1
186+
CPPFLAGS+=-DHAVE_LIBCRYPTO=1 -DHAVE_OPENSSL_EVP_H
187187
LDADD+= -lcrypto -lcrypt
188188
DPADD+= ${LIBCRYPTO} ${LIBCRYPT}
189189
.endif

external/bsd/tcpdump/include/config.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
/* #undef HAVE_LIBCAP_NG */
6161

6262
/* Define to 1 if you have the `crypto' library (-lcrypto). */
63-
#define HAVE_LIBCRYPTO 1
63+
/* in the Makefile */
64+
/* #undef HAVE_LIBCRYPTO */
6465

6566
/* Define to 1 if you have the `rpc' library (-lrpc). */
6667
/* #undef HAVE_LIBRPC */
@@ -87,7 +88,8 @@
8788
#define HAVE_OPENAT 1
8889

8990
/* Define to 1 if you have the <openssl/evp.h> header file. */
90-
#define HAVE_OPENSSL_EVP_H 1
91+
/* in the Makefile */
92+
/* #undef HAVE_OPENSSL_EVP_H */
9193

9294
/* if there's an os_proto.h for this platform, to use additional prototypes */
9395
/* #undef HAVE_OS_PROTO_H */

external/bsd/wpa/bin/hostapd/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.8 2015/04/01 19:45:14 christos Exp $
1+
# $NetBSD: Makefile,v 1.9 2016/06/29 19:16:23 christos Exp $
22

33
.include "${.CURDIR}/../Makefile.inc"
44

@@ -86,7 +86,6 @@ eap_server_methods.c
8686

8787
# crypto
8888
SRCS+= \
89-
crypto_openssl.c \
9089
random.c \
9190
sha1-prf.c
9291

@@ -150,6 +149,7 @@ aes-ctr.c \
150149
aes-eax.c \
151150
aes-encblock.c \
152151
aes-omac1.c \
152+
crypto_openssl.c \
153153
dh_groups.c \
154154
fips_prf_openssl.c \
155155
ms_funcs.c \
@@ -196,7 +196,9 @@ DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBDES}
196196
LDADD+= -lssl -lcrypto -ldes
197197
.else
198198
CPPFLAGS+= -DINTERNAL_AES -DINTERNAL_MD5 -DINTERNAL_SHA1 -DCONFIG_NO_PBKDF2
199+
CPPFLAGS+= -DCONFIG_CRYPTO_INTERNAL
199200
SRCS+= tls_none.c sha1-internal.c md5-internal.c aes-xinternal.c rc4.c
201+
SRCS+= sha1-pbkdf2.c sha1.c md5.c
200202
.endif
201203

202204
.include <bsd.prog.mk>

external/bsd/wpa/bin/hostapd/aes-xinternal.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "aes.h"
55
#include "aes_wrap.h"
66

7-
int aes_wrap(const u8 *kek, int n, const u8 *cipher, u8 *plain)
7+
int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *cipher, u8 *plain)
88
{
99
return -1;
1010
}

external/bsd/wpa/bin/wpa_passphrase/Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.3 2015/04/01 19:45:14 christos Exp $
1+
# $NetBSD: Makefile,v 1.4 2016/06/29 19:16:23 christos Exp $
22

33
.include "${.CURDIR}/../Makefile.inc"
44

@@ -18,7 +18,9 @@ DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBDES}
1818
LDADD+= -lssl -lcrypto -ldes
1919
.else
2020
CPPFLAGS+= -DINTERNAL_AES -DINTERNAL_MD5 -DINTERNAL_SHA1
21+
CPPFLAGS+= -DCONFIG_CRYPTO_INTERNAL
2122
SRCS+= tls_none.c md5-internal.c sha1-internal.c
23+
SRCS+= sha1-pbkdf2.c sha1.c md5.c
2224
.endif
2325

2426

external/bsd/wpa/bin/wpa_supplicant/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.7 2016/03/23 09:35:25 roy Exp $
1+
# $NetBSD: Makefile,v 1.8 2016/06/29 19:16:23 christos Exp $
22

33
.include "${.CURDIR}/../Makefile.inc"
44

@@ -33,6 +33,7 @@ pmksa_cache.c \
3333
preauth.c \
3434
random.c \
3535
scan.c \
36+
sha1-prf.c \
3637
wmm_ac.c \
3738
wpa.c \
3839
wpa_common.c \
@@ -102,7 +103,6 @@ eap_ttls.c \
102103
ms_funcs.c \
103104
mschapv2.c \
104105
sha1-tlsprf.c \
105-
sha1-prf.c \
106106
tls_openssl.c
107107

108108
SRCS+=aes-ctr.c \
@@ -119,7 +119,9 @@ LDADD+= -lssl -lcrypto -ldes
119119
.else
120120
CPPFLAGS+= -DINTERNAL_AES -DINTERNAL_MD5 -DINTERNAL_SHA1 -DCONFIG_NO_PBKDF2
121121
SRCS+= tls_none.c sha1-internal.c md5-internal.c aes-xinternal.c rc4.c
122-
SRCS+= aes-unwrap.c md5.c
122+
CPPFLAGS+= -DCONFIG_CRYPTO_INTERNAL
123+
#SRCS+= aes-unwrap.c md5.c
124+
SRCS+= sha1-pbkdf2.c sha1.c md5.c
123125
.endif
124126

125127
.endif

external/bsd/wpa/bin/wpa_supplicant/aes-xinternal.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "aes.h"
55
#include "aes_wrap.h"
66

7-
int aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain)
7+
int aes_unwrap(const u8 *kek, size_t kek_len, int n, const u8 *cipher, u8 *plain)
88
{
99
return -1;
1010
}

lib/libkvm/kvm_ia64.c

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* $NetBSD: kvm_ia64.c,v 1.2 2016/06/30 09:14:30 mrg Exp $ */
2+
3+
/*
4+
* Copyright (c) 2016 Matthew R. Green
5+
* All rights reserved.
6+
*
7+
* Redistribution and use in source and binary forms, with or without
8+
* modification, are permitted provided that the following conditions
9+
* are met:
10+
* 1. Redistributions of source code must retain the above copyright
11+
* notice, this list of conditions and the following disclaimer.
12+
* 2. Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
* 3. The name of the author may not be used to endorse or promote products
16+
* derived from this software without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21+
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23+
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
25+
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+
* SUCH DAMAGE.
29+
*/
30+
31+
/* Empty implementation */
32+
33+
#include <sys/param.h>
34+
35+
#include <limits.h>
36+
#include <kvm.h>
37+
38+
#include <uvm/uvm_extern.h>
39+
40+
#include "kvm_private.h"
41+
42+
43+
void
44+
_kvm_freevtop(kvm_t *kd)
45+
{
46+
47+
}
48+
49+
int
50+
_kvm_initvtop(kvm_t *kd)
51+
{
52+
53+
_kvm_err(kd, 0, "initvtop not yet implemented!");
54+
return (0);
55+
}
56+
57+
int
58+
_kvm_kvatop(kvm_t *kd, vaddr_t va, paddr_t *pa)
59+
{
60+
61+
_kvm_err(kd, 0, "vatop not yet implemented!");
62+
return -1;
63+
}
64+
65+
off_t
66+
_kvm_pa2off(kvm_t *kd, paddr_t pa)
67+
{
68+
69+
_kvm_err(kd, 0, "pa2off not yet implemented!");
70+
return -1;
71+
}
72+
73+
int
74+
_kvm_mdopen(kvm_t *kd)
75+
{
76+
77+
_kvm_err(kd, 0, "mdopen not yet implemented!");
78+
return -1;
79+
}

0 commit comments

Comments
 (0)