Skip to content

Commit 8563ee9

Browse files
committed
Merge branch 'master' into drm-next
Conflicts: sys/compat/linuxkpi/common/include/asm/smp.h sys/compat/linuxkpi/common/include/linux/smp.h sys/compat/linuxkpi/common/src/linux_compat.c Issue: #140
2 parents 32288e2 + 0522d72 commit 8563ee9

File tree

448 files changed

+7230
-3692
lines changed

Some content is hidden

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

448 files changed

+7230
-3692
lines changed

contrib/blacklist/README

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: README,v 1.7 2015/01/26 00:34:50 christos Exp $
1+
# $NetBSD: README,v 1.8 2017/04/13 17:59:34 christos Exp $
22

33
This package contains library that can be used by network daemons to
44
communicate with a packet filter via a daemon to enforce opening and
@@ -98,6 +98,16 @@ group "internal" on $int_if {
9898
...
9999
}
100100

101+
You can use 'blacklistctl dump -a' to list all the current entries
102+
in the database; the ones that have nfail <c>/<t> where <c>urrent
103+
>= <t>otal, should have an id assosiated with them; this means that
104+
there is a packet filter rule added for that entry. For npf, you
105+
can examine the packet filter dynamic rule entries using 'npfctl
106+
rule <rulename> list'. The number of current entries can exceed
107+
the total. This happens because entering packet filter rules is
108+
asynchronous; there could be other connection before the rule
109+
becomes activated.
110+
101111
Enjoy,
102112

103113
christos

contrib/blacklist/bin/blacklistctl.8

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: blacklistctl.8,v 1.7 2015/04/30 06:20:43 riz Exp $
1+
.\" $NetBSD: blacklistctl.8,v 1.9 2016/06/08 12:48:37 wiz Exp $
22
.\"
33
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
44
.\" All rights reserved.
@@ -77,7 +77,8 @@ it to make sure that there is only one rule active.
7777
.Nm
7878
first appeared in
7979
.Nx 7 .
80-
.Fx support for
80+
.Fx
81+
support for
8182
.Nm
8283
was implemented in
8384
.Fx 11 .

contrib/blacklist/bin/blacklistctl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: blacklistctl.c,v 1.20 2016/04/04 15:52:56 christos Exp $ */
1+
/* $NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $ */
22

33
/*-
44
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
3333
#endif
3434

3535
#include <sys/cdefs.h>
36-
__RCSID("$NetBSD: blacklistctl.c,v 1.20 2016/04/04 15:52:56 christos Exp $");
36+
__RCSID("$NetBSD: blacklistctl.c,v 1.21 2016/11/02 03:15:07 jnemeth Exp $");
3737

3838
#include <stdio.h>
3939
#include <time.h>

contrib/blacklist/bin/blacklistd.c

+24-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $ */
1+
/* $NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $ */
22

33
/*-
44
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
3232
#include "config.h"
3333
#endif
3434
#include <sys/cdefs.h>
35-
__RCSID("$NetBSD: blacklistd.c,v 1.35 2016/09/26 19:43:43 christos Exp $");
35+
__RCSID("$NetBSD: blacklistd.c,v 1.37 2017/02/18 00:26:16 christos Exp $");
3636

3737
#include <sys/types.h>
3838
#include <sys/socket.h>
@@ -403,12 +403,14 @@ int
403403
main(int argc, char *argv[])
404404
{
405405
int c, tout, flags, flush, restore, ret;
406-
const char *spath, *blsock;
406+
const char *spath, **blsock;
407+
size_t nblsock, maxblsock;
407408

408409
setprogname(argv[0]);
409410

410411
spath = NULL;
411-
blsock = _PATH_BLSOCK;
412+
blsock = NULL;
413+
maxblsock = nblsock = 0;
412414
flush = 0;
413415
restore = 0;
414416
tout = 0;
@@ -440,7 +442,17 @@ main(int argc, char *argv[])
440442
restore++;
441443
break;
442444
case 's':
443-
blsock = optarg;
445+
if (nblsock >= maxblsock) {
446+
maxblsock += 10;
447+
void *p = realloc(blsock,
448+
sizeof(*blsock) * maxblsock);
449+
if (p == NULL)
450+
err(EXIT_FAILURE,
451+
"Can't allocate memory for %zu sockets",
452+
maxblsock);
453+
blsock = p;
454+
}
455+
blsock[nblsock++] = optarg;
444456
break;
445457
case 't':
446458
tout = atoi(optarg) * 1000;
@@ -487,9 +499,11 @@ main(int argc, char *argv[])
487499
size_t nfd = 0;
488500
size_t maxfd = 0;
489501

490-
if (spath == NULL)
491-
addfd(&pfd, &bl, &nfd, &maxfd, blsock);
492-
else {
502+
for (size_t i = 0; i < nblsock; i++)
503+
addfd(&pfd, &bl, &nfd, &maxfd, blsock[i]);
504+
free(blsock);
505+
506+
if (spath) {
493507
FILE *fp = fopen(spath, "r");
494508
char *line;
495509
if (fp == NULL)
@@ -499,6 +513,8 @@ main(int argc, char *argv[])
499513
addfd(&pfd, &bl, &nfd, &maxfd, line);
500514
fclose(fp);
501515
}
516+
if (nfd == 0)
517+
addfd(&pfd, &bl, &nfd, &maxfd, _PATH_BLSOCK);
502518

503519
state = state_open(dbfile, flags, 0600);
504520
if (state == NULL)

contrib/blacklist/bin/blacklistd.conf.5

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: blacklistd.conf.5,v 1.3 2015/04/30 06:20:43 riz Exp $
1+
.\" $NetBSD: blacklistd.conf.5,v 1.5 2016/06/08 12:48:37 wiz Exp $
22
.\"
33
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
44
.\" All rights reserved.
@@ -218,7 +218,8 @@ bnx0:ssh * * * * 3 6h
218218
.Nm
219219
first appeared in
220220
.Nx 7 .
221-
.Fx support for
221+
.Fx
222+
support for
222223
.Nm
223224
was implemented in
224225
.Fx 11 .

contrib/blacklist/etc/rc.d/blacklistd

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# $NetBSD: blacklistd,v 1.1 2015/01/22 17:49:41 christos Exp $
3+
# $NetBSD: blacklistd,v 1.2 2016/10/17 22:47:16 christos Exp $
44
#
55

66
# PROVIDE: blacklistd
@@ -18,7 +18,7 @@ start_precmd="${name}_precmd"
1818
extra_commands="reload"
1919

2020
_sockfile="/var/run/${name}.sockets"
21-
_sockname="blsock"
21+
_sockname="blacklistd.sock"
2222

2323
blacklistd_precmd()
2424
{

contrib/blacklist/lib/bl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: bl.c,v 1.27 2015/12/30 16:42:48 christos Exp $ */
1+
/* $NetBSD: bl.c,v 1.28 2016/07/29 17:13:09 christos Exp $ */
22

33
/*-
44
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
3333
#endif
3434

3535
#include <sys/cdefs.h>
36-
__RCSID("$NetBSD: bl.c,v 1.27 2015/12/30 16:42:48 christos Exp $");
36+
__RCSID("$NetBSD: bl.c,v 1.28 2016/07/29 17:13:09 christos Exp $");
3737

3838
#include <sys/param.h>
3939
#include <sys/types.h>

contrib/blacklist/lib/libblacklist.3

+17-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: libblacklist.3,v 1.3 2015/01/25 23:09:28 wiz Exp $
1+
.\" $NetBSD: libblacklist.3,v 1.7 2017/02/04 23:33:56 wiz Exp $
22
.\"
33
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
44
.\" All rights reserved.
@@ -36,7 +36,7 @@
3636
.Nm blacklist_r ,
3737
.Nm blacklist ,
3838
.Nm blacklist_sa
39-
.Nm blacklist_sa_r ,
39+
.Nm blacklist_sa_r
4040
.Nd Blacklistd notification library
4141
.Sh LIBRARY
4242
.Lb libblacklist
@@ -62,7 +62,7 @@ block or release port access to prevent Denial of Service attacks.
6262
.Pp
6363
The function
6464
.Fn blacklist_open
65-
creates a the necessary state to communicate with
65+
creates the necessary state to communicate with
6666
.Xr blacklistd 8
6767
and returns a pointer to it, or
6868
.Dv NULL
@@ -106,18 +106,25 @@ All functions log errors to
106106
.Xr syslogd 8 .
107107
.Sh RETURN VALUES
108108
The function
109-
.Fn bl_open
109+
.Fn blacklist_open
110110
returns a cookie on success and
111111
.Dv NULL
112-
on failure setting errno to an appropriate value.
112+
on failure setting
113+
.Dv errno
114+
to an appropriate value.
113115
.Pp
114-
The
115-
.Fn bl_send
116-
function returns
116+
The functions
117+
.Fn blacklist ,
118+
.Fn blacklist_sa ,
119+
and
120+
.Fn blacklist_sa_r
121+
return
117122
.Dv 0
118123
on success and
119-
.Dv -1
120-
on failure setting errno to an appropriate value.
124+
.Dv \-1
125+
on failure setting
126+
.Dv errno
127+
to an appropriate value.
121128
.Sh SEE ALSO
122129
.Xr blacklistd.conf 5 ,
123130
.Xr blacklistd 8

contrib/blacklist/libexec/blacklistd-helper

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ fi
1919
if [ -z "$pf" ]; then
2020
for f in npf pf ipf; do
2121
if [ -f "/etc/$f.conf" ]; then
22-
pf="$f"
23-
break
22+
pf="$f"
23+
break
2424
fi
2525
done
2626
fi

contrib/blacklist/port/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#
22
ACLOCAL_AMFLAGS = -I m4
33
lib_LTLIBRARIES = libblacklist.la
4-
include_HEADERS = blacklist.h
4+
include_HEADERS = ../include/blacklist.h
55

66
bin_PROGRAMS = blacklistd blacklistctl srvtest cltest
77

8-
VPATH = ../bin:../lib:../test
8+
VPATH = ../bin:../lib:../test:../include
99

1010
AM_CPPFLAGS = -I../include -DDOT="."
1111
AM_CFLAGS = @WARNINGS@

contrib/blacklist/port/sockaddr_snprintf.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: sockaddr_snprintf.c,v 1.10 2016/04/05 12:28:57 christos Exp $ */
1+
/* $NetBSD: sockaddr_snprintf.c,v 1.11 2016/06/01 22:57:51 christos Exp $ */
22

33
/*-
44
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
3434

3535
#include <sys/cdefs.h>
3636
#if defined(LIBC_SCCS) && !defined(lint)
37-
__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.10 2016/04/05 12:28:57 christos Exp $");
37+
__RCSID("$NetBSD: sockaddr_snprintf.c,v 1.11 2016/06/01 22:57:51 christos Exp $");
3838
#endif /* LIBC_SCCS and not lint */
3939

4040
#include <sys/param.h>
@@ -219,7 +219,7 @@ sockaddr_snprintf(char * const sbuf, const size_t len, const char * const fmt,
219219
case AF_LINK:
220220
sdl = ((const struct sockaddr_dl *)(const void *)sa);
221221
(void)strlcpy(addr = abuf, link_ntoa(sdl), sizeof(abuf));
222-
if ((w = strchr(addr, ':')) != 0) {
222+
if ((w = strchr(addr, ':')) != NULL) {
223223
*w++ = '\0';
224224
addr = w;
225225
}

contrib/elftoolchain/cxxfilt/cxxfilt.c

-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ main(int argc, char **argv)
189189
if (c == EOF)
190190
break;
191191
putchar(c);
192-
if (c == '\n')
193-
fflush(stdout);
194192
} else {
195193
if ((size_t) p >= sizeof(buf) - 1)
196194
warnx("buffer overflowed");

contrib/hyperv/tools/hv_kvp_daemon.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ typedef uint16_t __u16;
6161
typedef uint32_t __u32;
6262
typedef uint64_t __u64;
6363

64+
#define POOL_FILE_MODE (S_IRUSR | S_IWUSR)
65+
#define POOL_DIR_MODE (POOL_FILE_MODE | S_IXUSR)
66+
#define POOL_DIR "/var/db/hyperv/pool"
67+
6468
/*
6569
* ENUM Data
6670
*/
@@ -285,23 +289,25 @@ kvp_file_init(void)
285289
int i;
286290
int alloc_unit = sizeof(struct kvp_record) * ENTRIES_PER_BLOCK;
287291

288-
if (mkdir("/var/db/hyperv/pool", S_IRUSR | S_IWUSR | S_IROTH) < 0 &&
292+
if (mkdir(POOL_DIR, POOL_DIR_MODE) < 0 &&
289293
(errno != EEXIST && errno != EISDIR)) {
290294
KVP_LOG(LOG_ERR, " Failed to create /var/db/hyperv/pool\n");
291295
exit(EXIT_FAILURE);
292296
}
297+
chmod(POOL_DIR, POOL_DIR_MODE); /* fix old mistake */
293298

294299
for (i = 0; i < HV_KVP_POOL_COUNT; i++)
295300
{
296301
fname = kvp_pools[i].fname;
297302
records_read = 0;
298303
num_blocks = 1;
299304
snprintf(fname, MAX_FILE_NAME, "/var/db/hyperv/pool/.kvp_pool_%d", i);
300-
fd = open(fname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR | S_IROTH);
305+
fd = open(fname, O_RDWR | O_CREAT, POOL_FILE_MODE);
301306

302307
if (fd == -1) {
303308
return (1);
304309
}
310+
fchmod(fd, POOL_FILE_MODE); /* fix old mistake */
305311

306312

307313
filep = fopen(fname, "r");

contrib/ipfilter/tools/ippool.c

+2
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,9 @@ setnodeaddr(int type, int role, void *ptr, char *arg)
10471047
if (type == IPLT_POOL) {
10481048
ip_pool_node_t *node = ptr;
10491049

1050+
#ifdef USE_INET6
10501051
if (node->ipn_addr.adf_family == AF_INET)
1052+
#endif
10511053
node->ipn_addr.adf_len = offsetof(addrfamily_t,
10521054
adf_addr) +
10531055
sizeof(struct in_addr);

contrib/less/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
------------
33

44
Less
5-
Copyright (C) 1984-2015 Mark Nudelman
5+
Copyright (C) 1984-2016 Mark Nudelman
66

77
Redistribution and use in source and binary forms, with or without
88
modification, are permitted provided that the following conditions

contrib/less/NEWS

+34
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,40 @@
99

1010
To report bugs, suggestions or comments, send email to bug-less@gnu.org
1111

12+
======================================================================
13+
14+
Major changes between "less" versions 487 and 491
15+
16+
* Don't output terminal init sequence if using -F and file fits on one screen.
17+
18+
* Use ANSI prototypes in funcs.h declarations.
19+
20+
* Fix some const mismatches.
21+
22+
* Remove "register" in variable declarations.
23+
24+
* Fix some memory leaks.
25+
26+
======================================================================
27+
28+
Major changes between "less" versions 481 and 487
29+
30+
* New commands ESC-{ and ESC-} to shift to start/end of displayed lines.
31+
32+
* Make search highlights work correctly when changing caselessness with -i.
33+
34+
* New option -Da in Windows version to enable SGR mode.
35+
36+
* Fix "nothing to search" error when top or bottom line on screen is empty.
37+
38+
* Fix bug when terminal has no "cm" termcap entry.
39+
40+
* Fix incorrect display when entering double-width chars in search string.
41+
42+
* Fix bug in Unicode handling that missed some double width characters.
43+
44+
* Update Unicode database to 9.0.0.
45+
1246
======================================================================
1347

1448
Major changes between "less" versions 458 and 481

0 commit comments

Comments
 (0)