summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* MFC r302624:trasz2016-11-031-2/+5
| | | | Add some .Xrs to getloginclass(2).
* MFC r307227 and r307343:ed2016-10-296-54/+56
| | | | | | | | | | | | | | | | | | | | | | Improve typing of POSIX search tree functions. Back in 2015 when I reimplemented these functions to use an AVL tree, I was annoyed by the weakness of the typing of these functions. Both tree nodes and keys are represented by 'void *', meaning that things like the documentation for these functions are an absolute train wreck. To make things worse, users of these functions need to cast the return value of tfind()/tsearch() from 'void *' to 'type_of_key **' in order to access the key. Technically speaking such casts violate aliasing rules. I've observed actual breakages as a result of this by enabling features like LTO. I've filed a bug report at the Austin Group. Looking at the way the bug got resolved, they made a pretty good step in the right direction. A new type 'posix_tnode' has been added to correspond to tree nodes. It is still defined as 'void' for source-level compatibility, but in the very far future it could be replaced by a proper structure type containing a key pointer.
* MFC r307364:bapt2016-10-221-3/+1
| | | | directly create the socket with SOCK_NONBLOCK instead of calling fcntl(2)
* MFH (r306488, r306494, r306495, r306496): fix markup and cross-referencesdes2016-10-222-46/+42
|
* MFH (r305381, r306457): upgrade to unbound 1.5.10 via 1.5.9des2016-10-211-13/+13
|
* MFC r305961:ngie2016-10-212-0/+4
| | | | | | | | | | Re-add PACKAGE=> tests to lib/libc/tests/net/getaddrinfo/Makefile and add it to lib/libc/tests/sys/Makefile [*] Even though make -VPACKAGE and make -n install seem to do the right thing, the effects are a bit different, depending on the build host. Obtained from: HardenedBSD (af602f0db) [*]
* MFC r305920:ngie2016-10-212-4/+4
| | | | | | | Remove spurious newlines from atf_tc_fail calls This changes the results from broken (incorrect) to failed (correct) on i386
* MFC r305919:ngie2016-10-212-4/+0
| | | | | | | | | Don't define PACKAGE in lib/libc/tests/{iconv,net/getaddrinfo} needlessly This is already being done by bsd.test.mk The other subdirectory Makefiles were intentionally left alone
* MFC r306332:pfg2016-10-191-1/+2
| | | | | | btree(3): don't shortcut closing if the metadata is dirty. Obtained from: NetBSD (from krb5 tree)
* MFC: 304677, 304680, 305125, 305770, 305769bapt2016-10-196-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r304677: Add tftpfs support for the EFI loader Allow netbooting on efi without having to setup any NFS server by rebuilding the loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader r305125: Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE) From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour) if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150. We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader. Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose. Relnotes: yes Sponsored by: Gandi.net
* MFC 305588sephe2016-10-171-9/+24
| | | | | | | | | | | | pxeboot: Add nfs.read_size tunable. Increase this tunable improves kernel loading speed. Submitted by: Jun Su <junsu microsoft com> Reviewed by: rpokala, wblock (previous version) Obtained from: DragonFlyBSD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7756
* MFC r307037:kib2016-10-141-4/+3
| | | | Correct indent.
* MFC r307036:kib2016-10-141-0/+2
| | | | Fill msg_len for the initial element of msgvec.
* MFC r306670:mm2016-10-121-0/+2
| | | | | | | | | | | Sync libarchive with vendor including security fixes. Important vendor bugfixes (relevant to FreeBSD): #747: Out of bounds read in mtree parser #761: heap-based buffer overflow in read_Header (7-zip) #794: Invalid file on bsdtar command line results in internal errors (1) PR: 213092 (1)
* MFC r305628: intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)).jilles2016-10-112-5/+10
|
* MFC r306588:kib2016-10-093-2/+9
| | | | Export the mq_getfd_np() and timer_oshandle_np() symbols from librt.so.
* MFC r306334:kib2016-10-033-0/+244
| | | | | | | Document thr_suspend(2) and thr_wake(2). MFC r306506: Reword the statement.
* MFC r306505:kib2016-10-031-1/+1
| | | | Add an article.
* MFC r305902:kib2016-10-011-1/+8
| | | | | | | Reduce size of ufs inode. MFC r305903: Fix libprocstat build after r305902.
* MFC 305034: Implement 'devctl clear driver' to undo a previous 'set driver'.jhb2016-09-303-3/+51
| | | | | | | | | | | Add a new 'clear driver' command for devctl along with the accompanying ioctl and devctl_clear_driver() library routine to reset a device to use a wildcard devclass instead of a fixed devclass. This can be used to undo a previous 'set driver' command. After the device's name has been reset to permit wildcard names, it is reprobed so that it can attach to newly-available (to it) device drivers. Sponsored by: Chelsio Communications
* MFC r306075,r306109ache2016-09-281-14/+32
| | | | | | | | | | | | | | | | | | 1) Microoptimize %p case. 2) Implememt %u for GNU compatibility. 3) Don't forget to advance buf for %w/%u. 4) Fail with incomplete week (week 0) request and no such week in the year. 5) Fix yday formula when Sunday requested and the week started from Monday. 6) Fail with impossible yday for incomplete week (week 0) and direct %w/%u request. 7) Shift yday/wday to the first day of the year, if incomplete week (week 0) requested and no %w/%u used. 8) For already non-standard %z extension implement GNU compatible formats: +hh and -hh. 9) Check for incorrect values for %z. PR: 212983 (case 3 only)
* MFC r306257:kib2016-09-282-3/+98
| | | | | | | Document r306081, i.e. procctl(PROC_TRAPCAP) and sysctl kern.trap_enocap. MFC r306366: Editing fixes for r306257, documentation for trapcap.
* MFC r305819:mm2016-09-251-0/+2
| | | | | | | | | | | | | | | | | Sync libarchive with vendor including important security fixes. Issues fixed (FreeBSD): PR #778: ACL error handling Issue #745: Symlink check prefix optimization is too aggressive Issue #746: Hard links with data can evade sandboxing restrictions This update fixes the vulnerability #3 and vulnerability #4 as reported in "non-cryptanalytic attacks against FreeBSD update components". https://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f Fix for vulnerability #2 has already been merged in r305188. Security: http://gist.github.com/anonymous/e48209b03f1dd9625a992717e7b89c4f
* MFC: 304626,304635:roberto2016-09-252-4/+4
| | | | | | | r304626: Add support for Ed25519 keys. r304635: Remove support for SSH1, already disabled in our OpenSSH. Submitted by: mwlucas (r304626), vangyzen (r304635)
* MFC r305956: Add manpage for rctl_* system callsbadger2016-09-242-0/+225
| | | | | Approved by: kib (mentor) Sponsored by: Dell Technologies
* MFC r305380:bde2016-09-191-0/+6
| | | | | | Fix missing fmodl() on arches with 53-bit long doubles. PR: 199422, 211965
* MFC r305033,r305041,r305170:ngie2016-09-182-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r305033: Minor Makefile simplifications for lib/atf/... - Replace uses of `${.CURDIR:H:H:H}` with ${SRCTOP} - Use built-in :H operator instead of ".." when enumerating paths. r305041: Filter certain compile-time options into -DATF_BUILD_* Items filtered through are: - Constant defines (-D) - Include flags (-I) - Linker flags (-L) - Optimization level (-O) - Warnings / linker flags (-W) - Preprocessor options (-f) This fixes the scenario hit by the Jenkins job where it's infecting the build with --sysroot, etc options from the Jenkins build in the tests. Prefix all intermediate variables (_CFLAGS, etc) with "ATF_BUILD" [*]. Requested by: jmmv r305170: Don't bake all of CC/CPP/CXX into CFLAGS Capture executable names for CC, CPP, CXX (assumed to be the first non-CCACHE_BIN word). This change strips out all of the cross-compiler arguments, (-target, -B, etc), added to ${CC}, etc via ${CROSSENV} in Makefile.inc1, so it doesn't infect the build and subsequently the test. Add comments noting why this logic is being added, and why the logic in r305041 was necessary/what it was trying to achieve. This is required after recent changes made to the toolchain to always specify --sysroot, -target, -B, etc with clang in buildworld (presumably r304681).
* MFC r304285:kib2016-09-1610-113/+130
| | | | Implement userspace gettimeofday(2) with HPET timecounter.
* MFC r305130: Update to ELF Tool Chain r3490emaste2016-09-152-1/+2
| | | | | | | | | | | | | Improvements include: * readelf: report all relocation types in rel/rela for MIPS N64 * readelf: add ELFOSABI_ARM_AEABI * elfdump: add ELFOSABI_ARM_AEABI and ELFOSABI_ARM * Add recent RISC-V relocations * elfcopy: use elftc_timestamp, to support SOURCE_DATE_EPOCH MFC r305155: readelf: silence GCC 4.2.1 uninitialized variable warning Sponsored by: The FreeBSD Foundation
* MFC r305422:mm2016-09-121-0/+2
| | | | | | | | | | | Sync libarchive with vendor Vendor issues fixed: PR #777: Multiple bugfixes for setup_acls() This includes a bugfix for a bug that caused ACLs not to be read properly for files and directories inside subdirectories and as a result not being stored or being incorrectly stored in tar archives.
* MFC r305284:hselasky2016-09-091-2/+13
| | | | | | | Fix array size issue when using the pre-scaling feature for ISOCHRONOUS USB transfers. Make sure enough length and buffer pointers are allocated when setting up the libusb transfer structure to support the maximum number of frames the kernel can handle.
* MFC r303893, r303894:pfg2016-09-081-1/+1
| | | | | | | | misc replacements of comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone.
* MFC r303889:pfg2016-09-081-1/+1
| | | | | | | | libc/rpc: replace comma with semicolon when pertinent. Uses of commas instead of a semicolons can easily go undetected. The comma can serve as a statement separator but this shouldn't be abused when statements are meant to be standalone.
* MFC r305413ache2016-09-081-4/+10
| | | | Fix error handling.
* MFC r305406,r305409,r305412ache2016-09-081-9/+25
| | | | | | | | | | | | | 1) Fix errors handling. 2) Prevent out of bounds access to ws[-1] (passed buffer) which happens when the first mb sequence is incomplete and there are not enougn chars in the read buffer. ws[-1] may lead to memory faults or false results, in case the memory here contains '\n'. 3) Fix n == 1 case. Here should be no physical read (fill buffer) attempt (we read n - 1 chars with the room for NUL, see fgets()), and no NULL return.
* MFC r305154: directory(3): Deprecate readdir_r(). Clarify dirent buffers.jilles2016-09-071-2/+24
| | | | | | | | | | | | | | | In existing implementations including FreeBSD, there is no reason to use readdir_r() in the common case where potentially multiple threads each list their own directory. Code using readdir() is simpler. What's more, although readdir_r() can safely be used on FreeBSD because NAME_MAX is forced to 255, it cannot be used safely on systems where {NAME_MAX} is not fixed. As a concrete example, FAT/NTFS filenames can be up to 255 UTF-16 code units long, which can be up to 765 UTF-8 bytes. Deprecating readdir_r() in POSIX has been proposed in http://www.austingroupbugs.net/view.php?id=696 and glibc wants to deprecate it as well.
* MFC r305090: getvfsbyname(3): Remove [EFAULT] error.jilles2016-09-071-6/+1
| | | | | Since r101651 in 2002, getvfsbyname() has written *vfc using userland memcpy(), so the [EFAULT] error no longer occurs.
* MFC r305241ache2016-09-051-1/+11
| | | | | | | fgetwc(3) may set both __SEOF and __SERR at once (in case of incomplete sequence near EOF), so we can't just check for (wc == WEOF && !__sfeof(fp)) and must relay on __sferror(fp) with __SERR clearing/restoring.
* MFC r305144ache2016-09-052-2/+2
| | | | | | | | 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com
* MFC r305219ache2016-09-041-5/+8
| | | | | If error happens, don't overwrite original errno comes from __mbrtowc() and __srefill().
* MFC r305015:kib2016-09-031-1/+0
| | | | Remove commented out mention of ptrace.S.
* MFC r304928:kib2016-09-0318-429/+76
| | | | | | | | | | | | | Do not obliterate errno value in the main thread during ptrace(2) call on x86. MFC r304931: Follow ABI when calling __error from the ptrace(2) wrapper. MFC r305012: Rewrite ptrace(2) wrappers in C. MFC r305022: Restore the requirement of setting errno to zero before calling ptrace(2).
* MFC r305133ache2016-09-031-0/+19
| | | | | Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone.
* MFC r304075,r304989:mm2016-09-011-0/+3
| | | | | | | | | | | | | | | | | Sync libarchive with vendor including security fixes Vendor issues fixed: Issue #731: Reject tar entries >= INT64_MAX Issue #744: Very long pathnames evade symlink checks Issue #748: libarchive can compress, but cannot decompress zip some files PR #750: ustar: fix out of bounds read on empty string ("") filename PR #755: fix use of acl_get_flagset_np() on FreeBSD Issue #767: Buffer overflow printing a filename Issue #770: Zip read: be more careful about extra_length MFC r304874: Temporarily disable two libarchive tests that have not yet been fixed by vendor. Tests will be re-enabled after a fix has been merged.
* MFC r305024:kib2016-09-011-41/+41
| | | | Typesetting fixes.
* MFC r304911ache2016-08-301-0/+19
| | | | | | | | | | | | | The formal behavior of qsort is unstable with regard to objects that are equal. Unfortunately, RFC 3484 requires that otherwise equal objects remain in the order supplied by the DNS server. The present code attempts to deal with this by returning -1 for objects that are equal (i.e., returns that the first parameter is less then the second parameter). Unfortunately, the qsort API does not state that the first parameter passed in is in any particular position in the list. PR: 212122 Submitted by: Herbie.Robinson@stratus.com
* MFC r304287:kib2016-08-292-4/+48
| | | | Add fdatasync(2) man page, combined with fsync(2).
* MFC r304209:kib2016-08-295-0/+65
| | | | The fdatasync(2) call must be cancellation point.
* MFC r304176:kib2016-08-291-0/+6
| | | | Add a trivial implementation of fdatasync(2).
* MFC r304033:ngie2016-08-281-3/+3
| | | | | | | | | | | Increase timeout from 10 minutes to 20 minutes for all tests On particular slow networks, it can (on average) take longer to resolve hosts to IP* addresses. 20 minutes seemed reasonable for my work network This will be solved in a more meaningful way (if possible) using concurrency in the near future
OpenPOWER on IntegriCloud