summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-02-05avoid an uninitialised value in a return path added in rev 1.5Jonathan Gray
ok tobias@
2016-02-02Get rid of an ugly #ifdef in the middle of el_init() byIngo Schwarze
hiding the system dependencies away in "sys.h" where they belong. No binary change on OpenBSD. Seems reasonable to christos at NetBSD, too.
2016-02-01ansify amd64_iopl()Jeremie Courreges-Anglas
2016-02-01ansify; ok sthen@ kettenis@Jeremie Courreges-Anglas
2016-02-01Sort cert.pem alphabetically, first by organisation, then by CA nameStuart Henderson
(CN if available, otherwise OU). Add a comment identifying the org. Now to get an easy-to-read list of certificates in the file you can use "grep ^[#=] cert.pem". Prepared with https://spacehopper.org/format-pem.20160201. If you would like to verify this commit to ensure that I didn't sneak in any other changes, it will be easier to use the script rather than do it by hand.
2016-01-31Revamp cert.pem certificate information formatting. Skip headers whichStuart Henderson
aren't really useful (the information can be obtained by feeding the cert into "openssl x509 -in filename -text") and add a separator between certs showing the CA's CN or OU (similar to the display format in web browsers). Include both SHA1 and SHA256 fingerprints for all certificates. ok beck@ zhuk@ jung@
2016-01-31remove some whitespace differences with NetBSD; no change with diff -bIngo Schwarze
2016-01-31trivial partial sync to NetBSD, no functional change:Ingo Schwarze
* remove unused ifdef'ed header junk * remove pointless cast of NULL * wrap two excessively long lines
2016-01-30Fifth step in synching with NetBSD:Ingo Schwarze
Delete the silly ptr_t and ioctl_t typedefs and delete some "#ifdef notdef" code from "sys.h". No functional change. This makes hist.h identical to the NetBSD version. It reduces the remaining diff from +1526 -734 to +1430 -592. OK czarkoff@
2016-01-30Fourth step in synching with NetBSD:Ingo Schwarze
KNF: Remove parentheses from return lines. No object change. This makes emacs.c and prompt.c identical to the NetBSD versions. It reduces the remaining diff from +2053 -1261 to +1526 -734. OK czarkoff@
2016-01-30delete "#ifdef notdef" code that is no longer present in NetBSD;Ingo Schwarze
no change in the generated source files
2016-01-30Third step in synching with NetBSD:Ingo Schwarze
* rename fkey_t to funckey_t and el_term_t to el_terminal_t * rename struct editline member el_term to el_terminal * rename many functions in terminal.c from term_*() to terminal_*(), for consistency with the file name and to not look related to <term.h> No functional change. This makes refresh.c and sig.c almost identical to the NetBSD versions. It reduces the remaining diff from +2446 -1805 to +2053 -1420. OK czarkoff@
2016-01-29Second step in synching with NetBSD:Ingo Schwarze
* 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@
2016-01-29Start synching with NetBSD:Ingo Schwarze
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.
2016-01-29Therefor -> Therefore (where appropriate)tb
from ray@, ok jmc@
2016-01-28sigsuspend is section 2, not 3.Jason McIntyre
2016-01-28The CSRG declared alarm(3) obsolete 30 years ago (before 4.2BSD),Ingo Schwarze
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@
2016-01-27Replace the malloc spinlock with a mutex. This lock is held over system callsMark Kettenis
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@
2016-01-27deprecate SSL_OP_SINGLE_DH_USEBob Beck
ok jsing@
2016-01-26Don't crash dumping malloc stats if malloc_init hasn't been called, noted byOtto Moerbeek
David CARLIER
2016-01-26When encoding fails in fputwc(3), set the error indicator as requiredIngo Schwarze
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
2016-01-19replace (void *)0 with NULLmmcc
2016-01-19remove a nop assignment that has been #if 0'd since 1996mmcc
ok millert@
2016-01-18adjust some syscalls in proc & id; from Carlin BinghamTheo de Raadt
2016-01-18Call BIO_sock_init() from tls_init() to ensure sockets are enabled on Windows.Brent Cook
This is of course a no-op on other platforms. Noted by equalsraf from github.
2016-01-09Replace "function call" with "function" when referring to a functionmmcc
(well, a syscall, but this is the established practice) in the general sense. ok jmc@
2016-01-09Make code fit in 80 columns, remove trailing spaces & tabs.Alexandre Ratchov
2016-01-09drop "abort" promise, and make it the default behaviour.Sebastien Marie
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@
2016-01-09revert manual additions of hid.h now that usbhid.h brings it inJoshua Stein
2016-01-08Zap extraneous SYNOPSIS sections.Vadim Zhukov
The gettytab(5) and termcap(5) get FILES, others don't need anything. With input from & okay schwarze@
2016-01-08pull in dev/hid/hid.h for moved HIO_* varsJoshua Stein
2016-01-07fix SEE ALSO;Jason McIntyre
2016-01-07Move sndiod man page to section 8.Alexandre Ratchov
suggested by deraadt, fixes from jmc, ok millert
2016-01-06add a bug that the path whitelist is not available at this time.Ted Unangst
2016-01-06Long ago, malloc internally had two kinds of failures, warnings and errors.Ted Unangst
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
2016-01-05Use "path" not "file" as the function arg to utimes() and utimensat().Todd C. Miller
The DESCRIPTION section already referred to "path" in some places.
2016-01-04Follow style(9) and drop lint /* NOTREACHED */ annotations fromtb
the examples. Diff from Juuso Lapinlampi < wub () partyvan ! eu >, thanks! ok schwarze@
2016-01-04Bugfix: When errno happens to be EILSEQ upon entry to fgetws(3),Ingo Schwarze
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@
2016-01-04Fix lots of bugs.Ingo Schwarze
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@
2016-01-04Calling clone(2) with CLONE_NEWPID yields multiple processes with pid=1.Brent Cook
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@
2015-12-30Document that the ssl free() functions are NULL safe. OK mmcc@Todd C. Miller
2015-12-30another case where bad things would happen after wrterrorTed Unangst
2015-12-30if somebody makes the mistake of disabling abort, don't deref null inTed Unangst
validate_junk. from Michal Mazurek
2015-12-29Verify that the section header size supplied in the ELF header is whatmmcc
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@
2015-12-29mention that ibuf_free() does not need a NULL check.Sebastian Benoit
2015-12-29check for NULL in ibuf_free().Sebastian Benoit
ok and slight improvement, mmcco@ ok semarie@ and encouragement tedu@ krw@
2015-12-28Remove NULL-checks before free() and needless argument casts.mmcc
ok tb@
2015-12-28Remove NULL-checks before free() and unnecessary argument casts.mmcc
ok tb@
2015-12-28Remove NULL-checks before free() and a few related dead assignments.mmcc
ok and valuable input from millert@
2015-12-28Switch login(3) from lseek+read/write to pread/pwrite and only do the pread()Philip Guenther
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@