Commit Graph

7375 Commits

Author SHA1 Message Date
Enji Cooper
4acf8d706e Diff reduce with upstream by using macros and logic integrated in
later revisions of the test
2017-01-16 18:36:38 +00:00
Enji Cooper
39a3103b41 Use sys/param.h instead of sys/types.h to prep for upstreaming to NetBSD 2017-01-16 18:17:53 +00:00
Enji Cooper
e2a4e9c682 Remove unnecessary whitespace diff 2017-01-16 18:04:14 +00:00
Enji Cooper
183ae521e5 Use _SED instead of hacking tests rewriting mknod ... p as mkfifo
Similar to r312297
2017-01-16 17:53:58 +00:00
Enji Cooper
267f10b14c Use _SED to rewrite mknod ... p command as mkfifo instead of
adding an unnecessary diff to the test
2017-01-16 17:49:53 +00:00
Enji Cooper
3b0a9131e6 Merge ^/vendor/NetBSD/tests/dist@r312294
This includes a number of accepted upstream fixes, as well as
a reimplementation of the net/carp/... testcase (which is
currently unused).
2017-01-16 17:43:43 +00:00
Enji Cooper
89964aab17 Add GLOB_STAR #ifdef to testcases which require GLOB_STAR support 2017-01-16 07:41:39 +00:00
Enji Cooper
f467f63cbb Remove sys/param.h
It was used for nitems, but I converted it to __arraycount later, and
is already pulled in by header pollution on FreeBSD as well as NetBSD
ala sys/cdefs.h
2017-01-16 07:39:08 +00:00
Enji Cooper
5ca8558309 Drop unnecessary diff rewriting dict(..) function
This is already being properly handled via ATF config require.files call
2017-01-16 07:34:45 +00:00
Enji Cooper
6a93de28a6 Diff reduce with upstream and consolidate #ifdefs where possible 2017-01-15 22:00:59 +00:00
Enji Cooper
bfb8e4c9c4 Remove libutil.h #include on FreeBSD and instead favor stdio.h from libnetbsd 2017-01-15 21:38:19 +00:00
Enji Cooper
caeb04e465 lib/libc/gen/t_glob.c: diff reduce with NetBSD's copy 2017-01-15 10:17:15 +00:00
Enji Cooper
f40f3adc42 Pull in ^/vendor/NetBSD/tests/dist@r312219
Remove divergence with upstream where possible
2017-01-15 10:04:20 +00:00
Enji Cooper
83e891f222 Revert t_pow@r312154
This hunk hasn't been accepted yet
2017-01-14 10:10:49 +00:00
Enji Cooper
1f6a3aa8e5 Fix the build using hunks pending upstream contributions 2017-01-14 10:08:22 +00:00
Enji Cooper
e0940c61c2 Diff reduce with upstream post-accepted contributions 2017-01-14 10:05:26 +00:00
Enji Cooper
81e7d81dc3 One more sys/types.h kevent clarification missed in r312151 2017-01-14 09:47:06 +00:00
Enji Cooper
ecab856bc9 Clarify why sys/types.h #include is needed on FreeBSD 2017-01-14 09:45:46 +00:00
Enji Cooper
c8300756f2 Use cleanup routines to remove POSIX semaphores instead of just blindly
unlinking them at the beginning of the testcase

This is a lot more intelligent in cleaning up the semaphores if the testcase
fails before sem_unlink is called.

Contributed back as bin/51872 upstream.
2017-01-14 09:42:06 +00:00
Enji Cooper
2a1440c618 Diff reduce with upstream by taking diff hunks that were contributed back 2017-01-14 09:38:40 +00:00
Enji Cooper
9f30f6b7c3 Readd the CMSG_DATA for assigning the kqueue... this testcase isn't officially
correct yet, but it's getting closer.
2017-01-14 09:25:09 +00:00
Enji Cooper
25785590d5 Remove extra EVSET I added in r312146 by accident 2017-01-14 09:21:36 +00:00
Enji Cooper
a41b7cf58e Diff reduce with upstream
Use CMSG_FIRSTHDR macro to properly link the kqueue to the socket to
get it to now return -1/EBADF with sendmsg per the testcase expectations
2017-01-14 09:20:54 +00:00
Enji Cooper
7bb9bc9cc2 Try to consolidate the #ifdef soup into FreeBSD vs non-FreeBSD blocks better 2017-01-14 08:47:00 +00:00
Enji Cooper
0e6a2253dc Diff reduce with upstream 2017-01-14 08:39:53 +00:00
Enji Cooper
6e515978dd Remove comment no longer true since the test no longer bombs out earlier on 2017-01-14 08:38:21 +00:00
Enji Cooper
04f40d86db Diff reduce with upstream 2017-01-14 08:36:43 +00:00
Enji Cooper
50e474a4f6 :strtold_nan: remove unnecessary strcmp check
It gets checked again later on in the testcase
2017-01-14 08:35:29 +00:00
Enji Cooper
1081817ad5 Diff reduce with upstream 2017-01-14 08:12:57 +00:00
Enji Cooper
154be35857 Use copy of sha2.h from libnetbsd 2017-01-14 08:11:17 +00:00
Enji Cooper
0e3f47800f Restore deleted line 2017-01-14 07:59:33 +00:00
Enji Cooper
1cb4521644 Diff reduce with upstream using lib/libnetbsd's updated copy of sha1.h 2017-01-14 07:58:40 +00:00
Enji Cooper
9a62e988b3 r312133 should have used the non-FreeBSD block 2017-01-14 07:50:29 +00:00
Enji Cooper
4e9c68081e Diff reduce with upstream by using util.h from libnetbsd instead of libutil.h 2017-01-14 07:48:22 +00:00
Enji Cooper
3b85282333 Diff reduce with upstream 2017-01-14 07:39:07 +00:00
Enji Cooper
88dd6cd01d Copy ^/vendor/NetBSD/tests/dist/lib/libc/hash/t_hmac.c to
contrib/netbsd-tests/lib/libc/hash/t_hmac.c

This was missed in r303980
2017-01-14 07:16:15 +00:00
Enji Cooper
8eace6ac0f Try again with a better commit message 2017-01-14 07:15:14 +00:00
Enji Cooper
519b4f22b0 Copy ^/vendor/NetBSD/tests/dist to contrib/netbsd-tests
This was missed in r303980
2017-01-14 07:14:25 +00:00
Enji Cooper
63d1fd5970 Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123
Sponsored by:	Dell EMC Isilon
2017-01-14 06:49:17 +00:00
Enji Cooper
792bbaba98 Remove contrib/netbsd-tests/fs/nfs/nfsservice/rpcbind
This should have been pruned in r305358

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-01-14 06:16:57 +00:00
Enji Cooper
36b9e15c66 Delete trailing whitespace and use __arraycount instead of nitems in contrib code
MFC after:	1 week
2017-01-14 03:54:23 +00:00
Enji Cooper
a5deb9babb Note that sys/types.h is required on FreeBSD for kqueue(2), unlike NetBSD
MFC after:	12 days
X-MFC with:	r305358
Sponsored by:	Dell EMC Isilon
2017-01-14 01:01:02 +00:00
Enji Cooper
cdebaff820 Upgrade NetBSD tests to 01.11.2017_23.20 snapshot
This contains some new testcases in /usr/tests/...:

- .../lib/libc
- .../lib/libthr
- .../lib/msun
- .../sys/kern

Tested on:	amd64, i386
MFC after:	1 month
2017-01-13 03:33:57 +00:00
Enji Cooper
9527fa4f66 Remove __HAVE_LONG_DOUBLE #define from t_strtod.c and place it in Makefile
This is to enable support in other testcases

Inspired by lib/msun/tests/Makefile .

MFC after:	1 week
2017-01-12 08:40:52 +00:00
Enji Cooper
35cfc322f1 Fix lib/libc/sys/access_test after r311925
sys/param.h needs to be #included in order for __FreeBSD_version to be checked

MFC after:	13 days
2017-01-12 08:31:42 +00:00
Ed Maste
c83bcfbd2e readelf: add S390 relocation types
From https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries.html

Reviewed by:	bz
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9149
2017-01-11 22:54:04 +00:00
Ed Maste
0fbbe5bf87 readelf: add more PPC64 relocation types found in LLVM
MFC after:	2 weeks
MFC with:	r311941
Sponsored by:	The FreeBSD Foundation
2017-01-11 21:28:22 +00:00
Ed Maste
dd9d62b416 readelf: add PPC64 relocation types
Reported by:	Mark Millard
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9146
2017-01-11 21:18:14 +00:00
Enji Cooper
bccef7f6d9 Consolidate __NetBSD__ #ifdef
MFC after:	3 days
2017-01-11 10:20:35 +00:00
Enji Cooper
ddba0402f4 Import testcase updates with code contributed back to NetBSD
This also (inadvertently) contains an update to
contrib/netbsd-tests/lib/libc/sys/t_wait.c (new testcases).

MFC after:		2 weeks
In collaboration with:	christos@NetBSD.org
2017-01-11 09:51:34 +00:00
Enji Cooper
d1a6b5fb2f Fix whitespace in comment
MFC after:	3 days
2017-01-11 09:34:42 +00:00
Enji Cooper
0e0dd02306 Partially revert r311236
There's no sense in trying to close a file descriptor from the negative cases
with unlink_test; it's best to ignore these cases.

The mkfifo case does make sense to keep though.

MFC after:	3 days
2017-01-11 07:22:21 +00:00
Enji Cooper
19f27f3c34 Fix up r311227
Check for creat returning a value != -1, not a non-zero value

MFC after:	3 days
Pointyhat to:	ngie
Reported by:	Coverity
CID:		1368366
2017-01-11 07:17:03 +00:00
Martin Matuska
2dbf8c4a76 MFV r311899:
Sync libarchive with vendor.

Vendor bugfixes:
#691: Support for SCHILY.xattr extended attributes
#854: Spelling fixes

Multiple fixes in ACL code:
  - prefer acl_set_fd_np() to acl_set_fd()
  - if acl_set_fd_np() fails, do no fallback to acl_set_file()
  - do not warn if trying to write ACLs to a filesystem without ACL support
  - fix id handling in archive_acl_(from_to)_text*() for NFSv4 ACLs

MFC after:	1 week
X-MFC with:	r310866
2017-01-10 21:59:35 +00:00
Enji Cooper
7931520d40 Diff reduce with upstream by removing signal.h #include
MFC after:	3 days
2017-01-10 10:27:09 +00:00
Enji Cooper
b6a72c5dbe Merge ^/vendor/NetBSD/tests/dist@r311868
This is the vendor accepted version of ^/head@r311245

MFC after:	3 days
2017-01-10 10:16:59 +00:00
Enji Cooper
2bbc0fe246 Merge the grammar fix for lib/libc/gen/raise_test:raise_stress
MFC after:	3 days
2017-01-10 10:12:36 +00:00
Enji Cooper
818d3ff977 Add a REVISION section to track changes for the BEGEMOT-MIB MIB file
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after:	1 week
2017-01-09 06:27:30 +00:00
Enji Cooper
0c72a43f3f Add a REVISION section to track changes for the FOKUS-MIB MIB file
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after:	1 week
2017-01-09 06:24:28 +00:00
Enji Cooper
b55d259a14 Similar to r311750, check for the result from smiGetModule to avoid a segfault
when dereferencing a NULL pointer later on.

Choose to just check for the NULL pointer in the next for-loop for now to fix
the issue with a minimal amount of code churn

sys/queue.h use here would make more sense than using a static table

MFC after:	5 days
2017-01-09 06:13:27 +00:00
Enji Cooper
8406423362 Use calloc instead of malloc + memset(.., 0, ..)
MFC after:	5 days
2017-01-09 06:03:49 +00:00
Enji Cooper
c5f8d75113 Check result from smiGetFirstNode and smiGetNodeByOID
This avoids a segfault with malformed or unanticipated files,
like IPV6-TC.txt (a file containing just TEXTUAL-CONVENTIONS).

MFC after:	5 days
Found with:	gensnmpdef /usr/local/share/snmp/mibs/IPV6-TC.txt
2017-01-09 05:51:38 +00:00
Enji Cooper
fbd43e4c99 Add a REVISION section to track changes for the BEGEMOT-IP-MIB MIB file
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at

MFC after:	1 week
2017-01-09 03:21:21 +00:00
Enji Cooper
0ab7046959 Use nitems(mib) instead of hardcoding mib's length when calling sysctl(3)
MFC after:	3 days
2017-01-09 01:47:00 +00:00
Dimitry Andric
00742f6ced Fix the following clang 4.0.0 warning in ngatm's snmp_atm.c:
contrib/ngatm/snmp_atm/snmp_atm.c:173:6: error: logical not is only
    applied to the left hand side of this bitwise operator
    [-Werror,-Wlogical-not-parentheses]
            if (!ifmr.ifm_status & IFM_AVALID) {
                ^                ~

Obviously, the masking needs to be done before the logical not
operation.  Add parentheses to make it so.

MFC after:      3 days
2017-01-07 15:57:12 +00:00
Ed Maste
d4cd50b494 libunwind: add noexec stack annotation
Reported by:	vangyzen
Reviewed by:	kib
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D9075
2017-01-07 14:40:58 +00:00
Dimitry Andric
05ea86b0c0 In tcpdump's print-tcp.c, avoid increasing alignment when taking the
addresses of members of struct ip, which is packed.  Since the pointers
are only used for memcmp'ing, they can be pointing to void instead.

Note that upstream has removed the src and dst variables, in the mean
time.

MFC after:	3 days
2017-01-07 00:17:01 +00:00
Dimitry Andric
dba092b109 After r311459, some ports can break, because a few of the newly added
prototypes in <tcpd.h> use FILE.  Pull in a minimal forward declaration
of FILE from <stdio.h> to minimize impact.  Sorry for the breakage.

Reported by:	Shawn Webb <shawn.webb@hardenedbsd.org>
X-MFC-With:	r311459
2017-01-06 21:40:30 +00:00
Konstantin Belousov
1c32456953 Use type-independent formats for printing nlink_t and ino_t.
Extracted from:	ino64 work by gleb, mckusick
Discussed with:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2017-01-06 16:59:33 +00:00
Enji Cooper
08235f2408 Remove unnecessary __unused attribute attached to ctx in op_begemot_mibII(..)
MFC after:	3 days
2017-01-06 07:57:45 +00:00
Xin LI
1456f0f968 MFV r311477: xz 5.2.3.
MFC after:	2 weeks
2017-01-06 07:54:53 +00:00
Dimitry Andric
8da8161b26 Also remove unnecessary extern keywords from tcpd.h.
Noticed by:	kib
X-MFC-With:	r311459
2017-01-05 21:17:10 +00:00
Dimitry Andric
fd3e9b3896 Put proper prototypes in tcpd.h
Clang 4.0.0 complains about tcpd.h's not-really-prototypes, e.g.:

    /usr/include/tcpd.h:75:24: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    extern int hosts_access();              /* access control */
                           ^

To fix this, turn these declarations into real prototypes.  While here,
garbage collect the incompatible rfc931() function from scaffold.c, as
it is never used.

Reviewed by:	emaste
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D9052
2017-01-05 20:44:45 +00:00
Enji Cooper
60c2226f89 op_usm_users: don't deref uusers if it's NULL when SETting the value
Add an XXX comment to note that the conditional seems suspect given
how it's handled elsewhere in the SNMP_OP_SET case.

MFC after:	2 weeks
Reported by:	Coverity
CID:		1008573
2017-01-05 09:46:36 +00:00
Enji Cooper
3daec7ae72 snmp_table_fetch_async: don't leak work if snmp_pdu_send(..) fails
MFC after:	1 week
Reported by:	Coverity
CID:		1017276
2017-01-05 08:49:06 +00:00
Enji Cooper
994c8618ec op_usm_users: fix indentation in SNMP_OP_SET block
MFC after:	3 days
2017-01-05 08:27:23 +00:00
Enji Cooper
446bd8a476 Use calloc instead of malloc + memset(.., 0, ..)
MFC after:	3 days
2017-01-05 08:17:17 +00:00
Enji Cooper
70157df618 lsock_init_port: address issues with initializing sockaddr_un object
- Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
- Use SUN_LEN(..) instead of spelling out calculation longhand (inspired
  by comment by jmallett).

Tested with:	dgram and stream support with both bsnmpwalk and snmpwalk

MFC after:	1 week
Reported by:	Coverity
CID:		1006825
2017-01-05 08:14:20 +00:00
Enji Cooper
10a0306a2e lm_load: fix string copying issues
- Ensure `section` doesn't overrun section by using strlcpy instead of
  strcpy [*].
- Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity,
  but is an opportunistic change).

MFC after:	1 week
Reported by:	Coverity
CID:		1006826 [*]
2017-01-05 07:55:17 +00:00
Enji Cooper
20a4ce8bf2 Redo fix for CID 979581
The previous change was flawed in terms of how it calculated the
buffer length for the sockaddr_un object. Use SUN_LEN where
appropriate and mute the Coverity complaint by using memset(.., 0, ..)
to zero out the entire structure instead of setting .sun_len to a bogus
value and strlcpy'ing in the contents of argv[1].

SUN_LEN is now being passed to bind(2) as well. For some odd reason
this wasn't flagged as a bug with Coverity.

Reported by:	jilles, jmallett
MFC after:	2 days
X-MFC with:	r311233
2017-01-05 07:46:57 +00:00
Xin LI
a94dccbe27 MFV r311279: zlib 1.2.10.
MFC after:	1 month
2017-01-04 16:09:08 +00:00
Enji Cooper
ccd0cf8ffa snmp_mibII(3) requires net/if.h and net/if_mib.h
Document that requirement

MFC after:	1 week
2017-01-04 10:08:18 +00:00
Xin LI
ea3017ea00 Vendor import of zlib 1.2.10. 2017-01-04 09:37:45 +00:00
Xin LI
e16f0839c6 Restructure libz, place vendor files in contrib/zlib like other third
party software, this provides more standarized import workflow and
makes future upgrades easier.

The following files are new with this commit:

	zconf.h.in
	zlib.map
	zlib.pc.in

They are not connected to build, but were kept in tree for reference
for future maintenance.

All our local trivial changes were applied to contrib/zlib, and the
contrib/zlib vendor source code is intended to 100% match lib/libz
before this commit.

MFC after:	2 weeks
2017-01-04 09:30:47 +00:00
Enji Cooper
d6766132c2 run: ensure pthread_condattr_{init,setclock} is successful
MFC after:	1 week
Reported by:	Coverity
CID:		1268631, 1268633
2017-01-04 09:06:49 +00:00
Enji Cooper
dca7cc9815 setrlimit_basic: don't leak buf; free it on completion
MFC after:	3 days
Reported by:	Coverity
CID:		978311
2017-01-04 09:00:16 +00:00
Enji Cooper
fcc9604d43 revoke_perm: don't leak fd at the end of the test; close it
This code is unused on FreeBSD, but it mutes a valid Coverity warning
which would be true on NetBSD

MFC after:	3 days
Reported by:	Coverity
CID:		978311
2017-01-04 08:59:06 +00:00
Enji Cooper
621b0f13af stat_symlink: don't leak fd; close the file descriptor when done
MFC after:	3 days
Reported by:	Coverity
CID:		978314
2017-01-04 08:49:07 +00:00
Enji Cooper
c0b11b8e04 pipe_restart: free f on function exit to quell complaint from Coverity
MFC after:	3 days
Reported by:	Coverity
CID:		978307
2017-01-04 08:43:27 +00:00
Enji Cooper
64af3fbaba swapcontext1: test for getcontext(3) and swapcontext(3) success properly
The beforementioned libcalls both succeed if the return codes aren't -1

MFC after:	3 days
Reported by:	Coverity
CID:		976790, 976791
2017-01-04 08:35:46 +00:00
Enji Cooper
7251167f52 Clarify lifetime of child(..) function
Ensure child exits when complete as it's always run in a forked
process.

Add a missing break statement in :pselect_sigmask when calling
child(..) for clarity and to avoid weird domino effects if the
child process somehow does something it's not supposed to do
with the logfiles, file descriptors, etc

MFC after:	1 week
Reported by:	Coverity
CID:		1223369, 1223370, 1300301
2017-01-04 08:25:31 +00:00
Xin LI
0594943177 Add missing files in zlib 1.2.8. 2017-01-04 08:12:31 +00:00
Enji Cooper
17a0c1eb75 fpu: ensure calls to pthread_create succeed and test sched_yield to make
sure it returns 0

sched_yield tests for values returning 0 of type int and sched_yield is
of type long, so the test is a mismatch

MFC after:	1 week
Reported by:	Coverity
CID:		1254953, 1254954, 1254965, 1254966
2017-01-04 08:07:48 +00:00
Enji Cooper
2e590d595e Use calloc instead of malloc with buffers in snmp_{recv,send}_packet
This doesn't fix the issue noted in the PR, but at the very least it
cleans up the error so it looks a bit more sane, and in the event
that bsnmp did wander off into the weeds, the likelihood of it
crashing with more sensible output is greater, in my opinion

MFC counter set high so I have enough time to resolve the real
underlying bug in bsnmpwalk

MFC after:	1 month
PR:		215721
2017-01-04 07:53:01 +00:00
Enji Cooper
b5bbd2a17c mincore_resid: free buf after use
MFC after:	3 days
Reported by:	Coverity
CID:		978304
2017-01-04 04:55:33 +00:00
Enji Cooper
83e8b13f15 {strchr,strlen}_basic: don't leak the dlopen'ed handle; close after use
MFC after:	3 days
Reported by:	Coverity
CID:		978299, 978300
2017-01-04 04:50:03 +00:00
Enji Cooper
5d37d9cc25 mknodat_fd: close dfd after use to avoid leaking it
MFC after:	3 days
Reported by:	Coverity
CID:		978287
2017-01-04 04:32:00 +00:00
Enji Cooper
f4cbf11049 mkfifoat_fd: close dfd after use to avoid leaking it
MFC after:	3 days
Reported by:	Coverity
CID:		978286
2017-01-04 04:29:53 +00:00
Enji Cooper
5641f109c1 fexecve: don't leak fd on fexecve(2) failure; close before calling err
MFC after:	3 days
Reported by:	Coverity
CID:		978285
2017-01-04 04:27:13 +00:00
Enji Cooper
3b33767589 tty: don't leak s after opening it with openpty
MFC after:	3 days
Reported by:	Coverity
CID:		978321
2017-01-04 04:19:05 +00:00