summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-03-21Rename the system call sendsyslog2 to sendsyslog. Keep the old oneAlexander Bluhm
as osendsyslog for a while. The three argument variant is the only one that will stay. input kettenis@; OK deraadt@
2016-03-21Christos Zoulas just rescinded clauses 3 & 4 of his licenses, seeIngo Schwarze
NetBSD chartype.c rev. 1.23, chartype.h rev. 1.25, eln.c rev. 1.28. No code change.
2016-03-21Markup fixes: use .Ev and .Er where appropriate.Ingo Schwarze
While here, also use \-1 rather than -1; not sure that's really better, but Thomas is right it should at least be consistent within a page. From Thomas Klausner <wiz @ NetBSD>.
2016-03-21fix el_{w,}getc documentation;Ingo Schwarze
OK czarkoff@
2016-03-21Make the read_char() function always take a wchar_t * argument.Ingo Schwarze
On first sight, it might look as if this required a bump because it seems to change the public type el_rfunc_t. But we only compile with WIDECHAR, and in that case, there is no change in the interface. This also simplifies some logic by getting rid of the NARROW_READ flag which was broken anyway. OK czarkoff@
2016-03-21Reduce the FUN() macro madness by no longer applying it to el_[w]getc(3).Ingo Schwarze
Always use el_wgetc(3) internally. In the !WIDECHAR case, casting the result to (Char) is safe because the function returns a byte rather than a character in that case. No functional change except for fixing a printf(3) format string issue when compiled with DEBUG_READ and WIDECHAR. OK czarkoff@
2016-03-21Return zero from two functions on allocation failure instead of alwaysmmcc
returning one (indicating success). Each function has only a single usage, and both usages check the return value. Merged from BoringSSL 0ce78a757d815c0dde9ed5884229f3a5b2cb3e9c: https://boringssl.googlesource.com/boringssl/+/0ce78a757d815c0dde9ed5884229f3a5b2cb3e9c%5E!/#F0 ok beck@
2016-03-21The asm in the MD_DISABLE_KBIND macro was too fragile and broke alpha and hppa.Philip Guenther
So instead, do the kbind disabling with syscall(). debugging and ok deraadt@, ok kettenis@
2016-03-21Merge a few simple fixes from NetBSD:Ingo Schwarze
NetBSD rev. 1.68 2012/09/10 christos (bugfixes from Steffen Nurpmeso) * el_wgetc(): set el_errno after read_char() failure * el_wgets(): flag error condition after read_getcmd() failure NetBSD rev. 1.69 2012/09/11 christos (bugfix from Christos Zoulas) * read_getcmd(): return failure after el_wgetc() failure NetBSD rev. 1.75 2016/02/12 christos (cleanup from Christos Zoulas) * read_getcmd(): use a constant rather than a magical number
2016-03-20Cleanup of standard header inclusion:Ingo Schwarze
1. Add the missing <errno.h> to sig.c. 2. Do not include standard headers from private headers "chared.h" and "el.h", include them directly where needed. 3. Delete a few needless inclusions of <ctype.h>. 4. Sort the standard headers. 5. Delete _GNU_SOURCE weirdness from histedit.h, that file doesn't even need the access to wcsdup(3) mentioned in the comment. 6. Delete some trailing blanks and blanks before tabs. OK czarkoff@
2016-03-20delete useless "typedef int bool_t", use int directly;Ingo Schwarze
OK czarkoff@
2016-03-20Cleanup of private header inclusion:Ingo Schwarze
1. Do not include private headers from "chared.h", "hist.h", "prompt.h", "refresh.h", "search.h", "sig.h", "terminal.h", "tty.h". The only private header having to include other private headers is "el.h". 2. Do not include "common.h", "parse.h", "help.h" from "el.h", and do not include "emacs.h" and "vi.h" from "chared.h", include them directly where needed. 3. Do include "fcns.h" from "el.h" because el_func_t is needed for "map.h". 4. Do not include private headers again that are already included by "el.h". 5. Include private headers after standard headers. OK czarkoff@
2016-03-20support WIDECHAR;Ingo Schwarze
OK czarkoff@
2016-03-20Use getline(3) rather than fgetln(3) because it is standardizedIngo Schwarze
and simpler and safer to use. Implemented by Christos Zoulas following my suggestion, with a bug fix by me.
2016-03-20minor simplifactions, style fixes, and trivial syncs from NetBSDIngo Schwarze
2016-03-20Fix the same bug again that was already fixed in:Ingo Schwarze
OpenBSD tokenizer.c rev. 1.8 2003/08/11 18:21:40 deraadt Don't increase amax on realloc() failure. The original fix got lost in a merge along the way. This fix from Christos Zoulas via NetBSD tokenizer.c rev. 1.23 2016/02/15. OK czarkoff@
2016-03-20Delete the useless Int datatype and always use the standard wint_tIngo Schwarze
directly. This is not a problem because <wchar_t> is required all over the place anyway, even when WIDECHAR is not defined. No functional change except that it fixes a few printf(3) format string issues, %c vs. %lc. OK czarkoff@
2016-03-20Get rid of "#ifdef WIDECHAR" and one goto in read_char(),Ingo Schwarze
making the code more readable. Instead, provide an mbrtowc(3) replacement function in chartype.[hc], files that encapsulate such system dependencies anyway. No functional change. OK czarkoff@
2016-03-20Delete the weird IGNORE_EXTCHARS flag, simplifying the codeIngo Schwarze
in the generic low-level function read_char(). Until we fully enable UTF-8 support, instead filter out non-ASCII characters in the more logical place in the high-level function el_gets(3). OK czarkoff@.
2016-03-20Fix the public interface function el_getc(3).Ingo Schwarze
On OpenBSD, the effects are to set the return argument to the NUL byte in case of a read failure (for robustness) and to properly set errno when the character is out of range and cannot be stored in a byte. Once we enable UTF-8, this will be needed to avoid returning bogus bytes for valid Unicode characters. On systems where the internal representation of wchar_t doesn't match UCS-4, breakage was potentially even worse. OK czarkoff@.
2016-03-20Fix read_char() for the non-UTF-8 case, in particular for systemsIngo Schwarze
supporting other multibyte locales or having an internal representation of wchar_t that doesn't match UCS-4. No functional change on OpenBSD, but it makes the code less confusing. OK czarkoff@.
2016-03-20Fix the CHARSET_IS_UTF8 case in read_char().Ingo Schwarze
For now, this mainly help programs explicitly using wide-character functions like el_wgetc(3) and el_wgets(3). 1. After reading an invalid byte sequence, do not throw away additional valid bytes; fix by me using mbrtowc(3), obsoleting utf8_islead(). 2. When read(2) returns EOF, return that information to the caller, do not prod on and potentially access garbage data in the buffer; from Linas Vepstas via NetBSD read.c rev. 1.70 2013/05/27. 3. After read__fixio() failure, restore errno to the one set by read(); from Steffen Nurpmeso via NetBSD read.c rev. 1.68 2012/09/10. 4. After read__fixio() success, restore errno to the initial state upon function entry; fix by me. OK czarkoff@. Also committed to NetBSD.
2016-03-20" the the " -> " the ", or in a couple of cases replace the superfluousKenneth R Westerback
"the" with the obviously intended word. Started with a "the the" spotted by Mihal Mazurek.
2016-03-20LOCALE_CHARSETS has been unused for some time nowJeremie Courreges-Anglas
so no need to include share/locale/ctype/Makefile.inc to get it. ok guenther@ stsp@ (who had the same diff)
2016-03-20__thrsleep.2 is contained in section 2natano
ok jmc
2016-03-20It's libpthread, not librthread, and __tfork(2) lets you set the TCBPhilip Guenther
address of the new thread
2016-03-20Add $OpenBSD linePhilip Guenther
2016-03-20Rearrange C runtime bits: now that ld.so exports environ and __progname,Philip Guenther
move their definitions and initialization in static links to libc.a Make crt0 always invoke a new func _csu_finish() in libc to process the auxv and to either register the ld.so cleanup function (in dynamic links) or initialize environ and __progname and do MC_DISABLE_KBIND (in static links). In libc, get pagesize from auxv; cache that between getpagesize() and sysconf(_SC_PAGESIZE) ok mpi@ "good time" deraadt@
2016-03-20Prepare for future ld.so/libc bump: update <tib.h> with the definitionsPhilip Guenther
that will be needed and make libpthread work when ld.so/libc.a provide an initial TIB.
2016-03-20Currently we have about a 50/50 split over fcntl(n, F_GETFL [,0])Kenneth R Westerback
idioms. Adopt the more concise fcntl(n, F_GETFL) over fcntl(n, F_GETFL, 0) where it is obvious further investigation will not yield and even better way. Obviousness evaluation and ok guenther@
2016-03-19Add STANDARDS and HISTORY blurbs for SOCK_{NONBLOCK,CLOEXEC,DNS}Philip Guenther
2016-03-19This is thrkill, not __thrsigdivertPhilip Guenther
2016-03-17remove NOTREACHEDmmcc
2016-03-17'miliseconds' -> 'milliseconds' in comments.Kenneth R Westerback
if_atu.c noted by Michal Mazurek.
2016-03-17properly guard to macrosmmcc
ok otto@
2016-03-17explicit_bzero for asn1 objects on free. Too often these contain sensitive ↵Bob Beck
information and they should not be a performance bottleneck ok miod@ krw@
2016-03-15'accomodate' -> 'accommodate' in comments.Kenneth R Westerback
Started by diff from Mical Mazurek.
2016-03-15remind people rewind is seldom a good choiceMarc Espie
okay jmc@
2016-03-14small step towards multiple pools: move two globls into the struct dir_infoOtto Moerbeek
ok @stefan armani@
2016-03-14Remove doaccess variable and access(2) call since this interfers withmestre
applications like zdump(8) because pledge(2) doesn't allow access(2) to /usr/share/zoneinfo. millert@ better described why this call can go away: "This looks like an attempt to do access checks based on the real uid instead of the effective uid. Basically for setuid programs we don't want to allow a user to set TZ to a path they should not be able to otherwise access. However, we already have a check for issetugid() above so I think the doaccess bits can just be removed and we can rely on open()." After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them
2016-03-14(char *)0 -> NULLmmcc
2016-03-13crt0.c is already setting environ, so don't set it in MD_START_SETUPPhilip Guenther
ok kettenis@ mpi@
2016-03-13environ and __progname are not declared in a public header; declare themPhilip Guenther
in libc's hidden/stdlib.h instead of in each .c file that needs one ok deraadt@ gsoares@ mpi@
2016-03-13Fix examples for EVP_PKEY_CTX_set_rsa_padding.Brent Cook
Noted here, https://github.com/libressl-portable/portable/issues/161, we document a non-existent constant in the examples for EVP_PKEY_CTX_set_rsa_padding. ok deraadt@
2016-03-12Call mprotect() via its hidden _lib_mprotect alias to avoid accidentalPhilip Guenther
overriding ok deraadt@ kettenis@
2016-03-12Add error handling to the remaining calls to bn_wexpand().Brent Cook
Noticed by pascal-cuoq from Github: https://github.com/libressl-portable/openbsd/issues/56 ok beck@
2016-03-12Remove sentences in RETURN VALUES sections saying that functions withmmcc
void return types 'return no value'. This is obvious and therefore unneccessary to mention. We spare rewind(3)'s sentence because espie@ pointed out that it's a warning - the function masks a potential error. This commit also adds a sentence to X509_free clarifying that it's NULL-safe. This bit was discussed with doug@. ok martijn@, sentiment supported by schwarze@
2016-03-12Bump for LibreSSL 2.4.0Brent Cook
2016-03-12Fix markup problem introduced in the previous commit. Solution andtb
explanations provided by schwarze@.
2003-05-11import 0.9.7b (without idea and rc5)Markus Friedl