summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* W^X violations are no longer permitted by default. A kernel log messagederaadt2016-05-273-6/+37
| | | | | | | | | | | | | | | | is generated, and mprotect/mmap return ENOTSUP. If the sysctl(8) flag kern.wxabort is set then a SIGABRT occurs instead, for gdb use or coredump creation. W^X violating programs can be permitted on a ffs/nfs filesystem-basis, using the "wxallowed" mount option. One day far in the future upstream software developers will understand that W^X violations are a tremendously risky practice and that style of programming will be banished outright. Until then, we recommend most users need to use the wxallowed option on their /usr/local filesystem. At least your other filesystems don't permit such programs. ok jca kettenis mlarkin natano
* Rename some of the internal error setting functions to more closely followjsing2016-05-273-14/+48
| | | | | | existing naming standards. Also provide functions for setting a struct tls_error * directly (rather than having to have a struct tls * or a struct tls_config *).
* Avoid leaking ca_mem when freeing a tls_config.jsing2016-05-271-1/+2
|
* Fix function parameters that do not have an underscore prefix.jsing2016-05-271-10/+10
|
* typo fixes; Anthony Coultersthen2016-05-272-5/+5
|
* The destination string is declared as "s" but referred to as "dst"millert2016-05-261-5/+5
| | | | | in some cases. Be consistent and use "dst" everywhere like for strlcat(3) and strncat(3). From Tim Kuijsten.
* Use "cc -E" instead of "cpp". OK deraadt@ natano@millert2016-05-261-3/+3
|
* Use S_ISDIR instead of doing it by hand. No binary change.millert2016-05-261-3/+2
|
* Make amaps use less kernel memory (2nd try)stefan2016-05-261-11/+53
| | | | | | | | | | | | | | | | | | | | | The original diff would crash at least i386 and powerpc, as spotted by guenther@ The reason was an incorrect use of sizeof in amap_lookups(). Confirmation that powerpc works by mpi@ and mglocker@ "throw it in" deraadt@ Original commit message: This is achieved by grouping amap slots into chunks that are allocated on-demand by pool(9). Endless "fltamapcopy" loops because of kmem shortage should be solved now. The kmem savings are also important to later enable vmm(4) to use larged shared memory mappings for guest VM RAM. This adapts libkvm also because the amap structure layout has changed. Testing and fix of libkvm glitch in initial diff by tb@ Feedback and "time to get this in" kettenis@
* fputs(3) now returns a non-negative number (as opposed to 0) on successfulmillert2016-05-261-10/+8
| | | | | completion, just like puts(3). Found the hard way in portable code. OK jmc@
* Calculate elapsed time in poll() and subtract that from the remaining timejmatthew2016-05-261-4/+19
| | | | | | | | | | when restarting poll() after receiving a signal. The ruby runtime send signals to threads periodically, so without accounting for elapsed time, the timeout would never expire if we didn't get a response from a nameserver. ok deraadt@ eric@
* Change the way regexec handles REG_STARTEND combined with REG_NOTBOL.martijn2016-05-262-20/+62
| | | | | | | | | | | | | The new code sees this combination as a continuation of string at offset pmatch[0].rm_so, instead of a new string which starts at that offset. This change fixes a search quirk in vi and is needed for upcoming fixes in ed/sed/vi. This new behaviour is also used in gnu regex. Lots of help from schwarze@ Manpage bits by schwarze@ OK schwarze@ and millert@
* KNF with respect to indentation; no code changeschwarze2016-05-251-28/+27
|
* Fix another one-byte buffer underflow (read access only).schwarze2016-05-251-7/+4
| | | | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with [[:<:]] or \< _and_ uses backreferences. Simplify the logic while here, already looking at the previous character if REG_STARTEND and REG_NOTBOL are both in use, in anticipation of martijn@'s upcoming patch which will further improve REG_STARTEND. OK millert@ martijn@ Also tested by Pedro Giffuni (pfg) on FreeBSD.
* el_map.alt can never be NULL, delete dead codeschwarze2016-05-251-4/+2
| | | | OK czarkoff@
* Saving errno in el_errno is only needed for one purpose:schwarze2016-05-253-35/+26
| | | | | | | | | | | | | | | | | Restoring the original errno found in el_wgetc() after el_wgets() did some cleanup that may have changed errno. Improve clarity and robustness of the code by not setting and inspecting el_errno where it isn't needed; in particular, let keymacro_get() properly report read failure to read_getcmd(). Move el_errno to el_read_t because it's only used in read.c. Never set errno back to zero. Checked with a test program installing a USR1 signal handler without SA_RESTART, for the cases read_getcmd(), ed_quoted_insert(), keymacro_get(), ed_command(), and EL_EDITMODE=0. OK czarkoff@
* use -nameopt esc_msb so "NetLock Kft" cert has the non-asciijsg2016-05-251-2/+2
| | | | | | and non-utf8 bytes escaped. ok sthen@
* NUL-terminate argv when parsing options, following otherokan2016-05-241-2/+3
| | | | | | | | implementations; fixes issue when exec*() is used for fuse_args, notably in sshfs; from Hiltjo Posthuma and reminded by ray. ok mpi@
* Add missing strdup NULL checks; from Ray Lai.okan2016-05-242-3/+9
| | | | ok mpi@ beck@ mlarkin@
* Remove debugging ifdefs.schwarze2016-05-242-72/+5
| | | | | | I'm debugging the read module for weeks now, but these ifdefs aren't helpful. OK cpp(1).
* More fixes from miodguenther2016-05-231-4/+4
|
* Include SYS.h instead of DEFS.h now that this does a direct syscallguenther2016-05-231-2/+2
|
* Major bump for the removal of the various locale, ruserok, andguenther2016-05-231-1/+1
| | | | longjmperror symbols
* Add XOR cookies for rp and sp. Switch from calling obsoleteguenther2016-05-231-77/+75
| | | | | | | | sig{block,setmask} to directly using the sigprocmask syscall. Remove longjmperror()-if-passed-real-sigcontext checks and the filling in of sigcontext fields that longjmp ignores. in snaps; ok deraadt@
* Make _fwalk and _cleanup completely internal to libcguenther2016-05-232-6/+3
| | | | ok deraadt@
* Stop supporting longjmperror(); it's not used, not portable, and the checksguenther2016-05-2311-106/+22
| | | | | | | longjmp performs can't really be relied upon, even after we got rid of the false positives... ok millert@ deraadt@
* Remove iruserok(_sa)? and __ivaliduser(sa)?guenther2016-05-234-97/+21
| | | | ok millert@ deraadt@
* Eliminate __check_rhosts_file and __rcmd_errstr: they were only used byguenther2016-05-232-7/+1
| | | | | | rlogind and rshd (remember them?) ok deraadt@
* Stop exposing <sys/localedef.h> and various symbols internal to the libcguenther2016-05-2312-39/+129
| | | | | | | locale implementation: _{Current,Default}*Locale, __[mn]locale_changed, __mb_len_max_runtime ok millert@ schwarze@ deraadt@
* Add XOR cookies for r1 (stack) and lr. Switch from calling obsoleteguenther2016-05-222-108/+209
| | | | | | | | sig{block,setmask} to directly using the sigprocmask syscall. Rewrite sig{set,long}jmp based on {set,long}jmp to avoid the deprecated store/load-multiple instructions. in snaps; ok deraadt@
* Improve modularization at the chared/read boundary, no functional change.schwarze2016-05-226-53/+63
| | | | | | | | | | | | Stop the read.c module from poking the el_chared.c_macro data structure that used to belong to the chared.c module. Given that no other module, not even chared itself, is using that data, move it into the read modules's own opaque data structure, struct el_read_t. That gets rid of one struct, one #define, one struct member, and one function argument in the chared.h interface. OK czarkoff@
* Revert previous: breaks i386 and powerpc, probably all non-PMAP_DIRECT archsguenther2016-05-221-53/+11
|
* Document el_wpush(3) and fix the description of el_push(3).schwarze2016-05-222-39/+42
| | | | | Improve precision in the description of the "bind" builtin command. Tweak terminology to better match editline(7).
* Make amaps use less kernel memorystefan2016-05-221-11/+53
| | | | | | | | | | | | This is achieved by grouping amap slots into chunks that are allocated on-demand by pool(9). Endless "fltamapcopy" loops because of kmem shortage should be solved now. The kmem savings are also important to later enable vmm(4) to use larged shared memory mappings for guest VM RAM. This adapts libkvm also because the amap structure layout has changed. Testing and fix of libkvm glitch in initial diff by tb@ Feedback and "time to get this in" kettenis@
* Oh right, actually delete this now that __cerror is unusedguenther2016-05-221-61/+0
|
* Simple sync with NetBSD, mostly to avoid confusion of arguments andschwarze2016-05-211-27/+36
| | | | return values.
* Fix the prototype used by EL_GETCFN, mention the associated typedef name,schwarze2016-05-211-19/+34
| | | | | document the return values, expand the list of affected functions, warn against using EL_GETCFN, and clarify some wording and notation.
* Fix a short-read bug in the previous version of asn1_d2i_read_biobcook2016-05-202-52/+56
| | | | The outer while() loop is missing, so we only read up to chunk_max bytes.
* Move the declaration of the function pointer type el_rfunc_tschwarze2016-05-205-28/+35
| | | | | | | | | | | | | | | from the private header "read.h" to the public header <histedit.h>. That's not an interface change, it was already used and documented publicly, merely not properly declared. Improve encapsulation: Make el_read a pointer to an opaque struct in struct editline, such that "read.h" no longer needs to be included from "el.h" but only from the two files using it, read.c and el.c. Only pass the required el_read_t to el_read_{s,g}etfn(), do not pass the full struct editline. OK czarkoff@, also proofread by Christian Heckendorf <mbie at ulmus dot me>.
* Delete the _SDA_BASE and _SDA2_BASE symbols: they're unnecessary inguenther2016-05-202-7/+1
| | | | shared libraries...and I misspelled them anyway
* no more v6only;jmc2016-05-191-12/+2
|
* Add ASM_NOERR for syscalls that never fail and thus don't need the errnoguenther2016-05-191-15/+36
| | | | | | | setting logic...which can significantly reduce the size of the stub on some archs; 20 syscalls get a trim with this. in snaps for a bit and ok deraadt@
* Save and restore 'gbr' register when enter/leaving the kernel, and useguenther2016-05-188-110/+35
| | | | | | it for the TCB pointer. Eliminate __cerror. "looks good" kettenis@, testing and ok deraadt@
* update links; from rayjmc2016-05-181-5/+7
|
* Reduce quadruple negation to double negation;schwarze2016-05-181-10/+10
| | | | | | | from Edgar Pettijohn <edgar at pettijohn minus web dot com>. OK jmc@ deraadt@ While here, remove two instances of inconsistent future tense.
* Remove obsolete caveat. OK deraadt@millert2016-05-181-9/+2
|
* Fix a one-byte buffer underflow (read access only).schwarze2016-05-171-4/+4
| | | | | | | | | | This change touches code that only runs when REG_BASIC is given and the regular expression is anchored with ^ _and_ uses backreferences. The segfault could only be triggered when the ^ anchor was inside a leading () subexpression quantified with *. OK martijn@ Patch also proofread by Pedro Giffuni <pfg at FreeBSD dot org>.
* ...and delete the GP setup. Should have been in previous commitguenther2016-05-161-4/+1
|
* Eliminate cerror: use PAL_rdunique to get the TCB address directlyguenther2016-05-163-59/+12
| | | | ok deraadt@ kettenis@
* Add END() to match ENTRY() macrosguenther2016-05-152-3/+8
| | | | ok kettenis@