summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Second step in synching with NetBSD:schwarze2016-01-299-212/+213
| | | | | | | | | | | * Rename some types from *key*_t to *keymacro*_t. * Rename struct editline member el_key to el_keymacro. * Rename some functions in keymacro.c from key*() to keymacro*(). This removes the conflict of key_clear(), key_end(), and key_print() with macros in <term.h>. No functional change. This makes keymacro.h identical to the NetBSD version. It reduces the remaining diff from +2640 -1998 to +2446 -1805. OK czarkoff@
* Start synching with NetBSD:schwarze2016-01-296-17/+17
| | | | | | | | | | Rename the files key.[hc] to keymacro.[hc] and term.[hc] to terminal.[hc]. The change makes sense because "term.h" conflicts with <term.h> and the functions key_clear(), key_end(), and key_print() in "key.h" conflict with macros in <term.h>. No content change yet, no binary change in *.o after "strip -d". This reduces the remaining diff from +4634 -3992 to +2640 -1998. OK czarkoff@, and mmcc@ agrees with the direction.
* Therefor -> Therefore (where appropriate)tb2016-01-292-2/+2
| | | | from ray@, ok jmc@
* sigsuspend is section 2, not 3.jmc2016-01-281-2/+2
|
* The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),schwarze2016-01-282-12/+7
| | | | | | | | | | | | but it is likely to remain in POSIX for the forseeable future, and there is nothing wrong with using it, so remove the marker. By contrast, POSIX 2008 now declared setitimer(3) obsolescent. While here, remove a few cross references pointing to obsolete or non-standard functions and update the POSIX reference. Triggered by a question from <ChrisBennett at bennettconstruction dot us>. OK millert@ tb@
* Replace the malloc spinlock with a mutex. This lock is held over system callskettenis2016-01-273-7/+28
| | | | | | | | | | | | | which run for many cycles and may even sleep. This leads to other threads spinning for a long time waiting on the lock. Using a mutex means those threads go to sleep and get woken up when the lock is released, which results in a lot less CPU usage. More work is needed to improve the performance of threaded code that suffers from malloc lock contention, but this diff makes ports like Firefox significantly more usable. Tested by many. ok mpi@, guenther@, tedu@, jca@
* deprecate SSL_OP_SINGLE_DH_USEbeck2016-01-274-74/+12
| | | | ok jsing@
* Don't crash dumping malloc stats if malloc_init hasn't been called, noted byotto2016-01-261-1/+3
| | | | David CARLIER
* When encoding fails in fputwc(3), set the error indicator as requiredschwarze2016-01-261-2/+2
| | | | | | | | | | | | | | | | by POSIX and as FreeBSD, SunOS 10/11, and glibc also do it. Note that an enquiry to the Austin Group led to the conclusion that this change probably violates the C standard: C and POSIX unintentionally conflict. But the POSIX behaviour makes more sense (easier to write correct error handling code for it, and a lower risk that programs miss errors) and is much more widespread, and the Austin Group intends to approach the C committee in order to adjust the C standard. See: http://austingroupbugs.net/view.php?id=1022 While here, do not set errno a second time, wcrtomb(3) already did that, and it is required to do it by the standard. OK millert@ and tedu@, and jca@ no longer objects
* replace (void *)0 with NULLmmcc2016-01-191-4/+4
|
* remove a nop assignment that has been #if 0'd since 1996mmcc2016-01-191-5/+1
| | | | ok millert@
* adjust some syscalls in proc & id; from Carlin Binghamderaadt2016-01-181-5/+9
|
* Call BIO_sock_init() from tls_init() to ensure sockets are enabled on Windows.bcook2016-01-181-1/+4
| | | | This is of course a no-op on other platforms. Noted by equalsraf from github.
* Replace "function call" with "function" when referring to a functionmmcc2016-01-091-3/+3
| | | | | | | (well, a syscall, but this is the established practice) in the general sense. ok jmc@
* Make code fit in 80 columns, remove trailing spaces & tabs.ratchov2016-01-097-21/+24
|
* drop "abort" promise, and make it the default behaviour.semarie2016-01-091-3/+3
| | | | | | | | | The current code has already setted it by default since 1.74 any pledge failure tries to make a coredump (default rules for coredump still applies: so setuid binaries don't create them locally). ok deraadt@
* revert manual additions of hid.h now that usbhid.h brings it injcs2016-01-091-3/+1
|
* Zap extraneous SYNOPSIS sections.zhuk2016-01-081-4/+2
| | | | | | The gettytab(5) and termcap(5) get FILES, others don't need anything. With input from & okay schwarze@
* pull in dev/hid/hid.h for moved HIO_* varsjcs2016-01-081-1/+3
|
* fix SEE ALSO;jmc2016-01-071-3/+3
|
* Move sndiod man page to section 8.ratchov2016-01-073-34/+34
| | | | suggested by deraadt, fixes from jmc, ok millert
* add a bug that the path whitelist is not available at this time.tedu2016-01-061-2/+4
|
* Long ago, malloc internally had two kinds of failures, warnings and errors.tedu2016-01-062-14/+7
| | | | | | | | The 'A' option elevated warnings to errors, and has been the default for some time. Then warnings were effectively eliminated in favor of everything being an error, but then the 'a' flag turned real errors into warnings! Remove the 'a' option entirely. You shouldn't have used it anyway. ok tb tdeval
* Use "path" not "file" as the function arg to utimes() and utimensat().millert2016-01-051-8/+8
| | | | The DESCRIPTION section already referred to "path" in some places.
* Follow style(9) and drop lint /* NOTREACHED */ annotations fromtb2016-01-042-6/+4
| | | | | | | | the examples. Diff from Juuso Lapinlampi < wub () partyvan ! eu >, thanks! ok schwarze@
* Bugfix: When errno happens to be EILSEQ upon entry to fgetws(3),schwarze2016-01-041-3/+3
| | | | | | | and when the file ends without a terminating Ln character, fgetws(3) discarded any characters read and reported bogus EOF. Never inspect errno(2) unless right after an error occurred! OK millert@
* Fix lots of bugs.schwarze2016-01-041-18/+28
| | | | | | | | | | | | | | | | | | | | | 1. When fprintf(fp, "...%ls...", ...) encounters an encoding error, do not destroy all the fp->_flags, which made the file permanently unreadable and unwriteable. 2. Do not change fp->_flags at all in case of encoding errors. Neither the manual nor POSIX ask for it, no other conversions set the error indicator, and it isn't needed because the return value reports failure and must be checked anyway. 3. Detect failure in mbrtowc(3), do not silently treat invalid bytes in the format string as the end of the format string. 4. Detect failure of __find_arguments(), no matter whether due to out of memory conditions or encoding errors, and gracefully fail rather than accessing an invalid pointer. 5. Remove the pointless and slightly dangerous errno = EILSEQ overrides after functions that already do that and are required by the standard to do so. OK jca@ on items 1, 2, and 5. OK millert@ on the complete diff. "Completely brutal mix of bugs." deraadt@
* Calling clone(2) with CLONE_NEWPID yields multiple processes with pid=1.bcook2016-01-042-4/+6
| | | | | | | | | | | | | Work around this particular case by reseeding whenever pid=1, but as guenther@ notes, directly calling clone(2), and then forking to match another pid, provides other ways to bypass new process detection on Linux. Hopefully at some point Linux implements something like MAP_INHERIT_ZERO, and does not invent a corresponding mechanism to subvert it. Noted by Sebastian Krahmer and the opmsg team. See http://stealth.openwall.net/crypto/randup.c for a test program. ok beck@
* Document that the ssl free() functions are NULL safe. OK mmcc@millert2015-12-306-12/+42
|
* another case where bad things would happen after wrterrortedu2015-12-301-2/+4
|
* if somebody makes the mistake of disabling abort, don't deref null intedu2015-12-301-2/+4
| | | | validate_junk. from Michal Mazurek
* Verify that the section header size supplied in the ELF header is whatmmcc2015-12-291-1/+4
| | | | | | | we expect it to be. This prevents out-of-bounds access or excessive memory allocation on a malformed ELF header. Found by Serguey Parkhomovsky with AFL. Improved by and ok kettenis@
* mention that ibuf_free() does not need a NULL check.benno2015-12-291-2/+5
|
* check for NULL in ibuf_free().benno2015-12-291-1/+3
| | | | | ok and slight improvement, mmcco@ ok semarie@ and encouragement tedu@ krw@
* Remove NULL-checks before free() and needless argument casts.mmcc2015-12-281-5/+3
| | | | ok tb@
* Remove NULL-checks before free() and unnecessary argument casts.mmcc2015-12-281-8/+5
| | | | ok tb@
* Remove NULL-checks before free() and a few related dead assignments.mmcc2015-12-2816-96/+53
| | | | ok and valuable input from millert@
* Switch login(3) from lseek+read/write to pread/pwrite and only do the pread()guenther2015-12-282-14/+15
| | | | | | | | if the data is needed. Use O_CLOEXEC on the internal fd as MT paranoia. Fix cast in offset calculation; delete register keyword; prefer memset() over bzero() ok millert@
* remove unused variablechl2015-12-271-2/+1
| | | | ok tedu@
* Simplify allocation logic based on free and realloc's behavior on NULL.mmcc2015-12-251-4/+3
| | | | ok tedu@
* revert change to call kevent immediately.tedu2015-12-251-6/+65
| | | | | | | | | tcpbench (at a minimum) relies on the old behavior of changes all happening after all event handlers run. in particular, it resets the event for the listening socket *before* calling accept(), when it is still readable. kevent then (correctly) says it is readable on the next go through the loop. silly, subtle, and stupid. problem reported by kettenis
* Add missing second argument to FD_SET macro in example code snippet.tb2015-12-251-3/+3
| | | | | | Spotted and diff provided by d ! lowe () openmailbox ! org, thanks! ok schwarze@
* Both our manual and POSIX ask us to set the error indicator when anschwarze2015-12-241-2/+2
| | | | | | | encoding error occurs, so do it. While here, do not set errno after mbrtowc(3) failure; mbrtowc(3) already does that, and that behaviour is required by the standard. ok jca@ guenther@ "nice find" deraadt@
* remove NULL-check before free()mmcc2015-12-241-3/+2
|
* More adress -> addressmmcc2015-12-244-4/+4
|
* remove two NULL castsmmcc2015-12-231-5/+3
|
* Remove the rest of the scaffolding for nonexistent ElGamal support,mmcc2015-12-231-17/+1
| | | | | | which has been disabled for sixteen years. ok millert@, tb@, sthen@
* Remove NULL casts and tweak style in a few places. A more invasivemmcc2015-12-231-87/+83
| | | | version of this diff was reviewed by tb@
* remove NULL-checks before free()mmcc2015-12-236-38/+22
|
* remove NULL-checks before free()mmcc2015-12-231-5/+3
|