summaryrefslogtreecommitdiffstats
path: root/lib/libutil (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Fail early if a (universal) primitive type identifies as constructed, or if arob2019-05-121-1/+17
| | | | | | boolean has a contents length other than 1. ok claudio@
* Enforce minimal number of octets for tag > 30.rob2019-05-121-1/+8
| | | | "sure" claudio@
* In long form encoding, explicitly prohibit an initial length octet of 0xffrob2019-05-121-1/+7
| | | | | | which is reserved for future use. ok claudio@
* The BER API is currently used by ldap, ldapd, ldapctl, ypldap, snmpd, androb2019-05-116-5/+1984
| | | | | | | | | | | | snmpctl. Separate copies of ber.[ch] have existed and been maintained in sync in ldap, ldapd, ypldap and snmpd. This commit moves the BER API into /usr/lib/libutil. All current consumers already link libutil. ldapd and snmpd regress passes, and release builds. With help from tb@ and guenther@. ok deraadt@, tb@
* missing dots after ".%P pp"; the case of btree(3) wasschwarze2019-04-231-3/+3
| | | | | reported by Fabio Scotoni <fabio at esse dot ch>; also garbage collect one .Tn while here
* I am retiring my old email address; replace it with my OpenBSD one.millert2019-01-251-3/+3
|
* Change imsg header definitions to use standard types.bcook2019-01-203-9/+11
| | | | ok deraadt@ claudio@
* Calling llabs(LLONG_MIN) is undefined behavior, llvm 7.0.1 does notbluhm2019-01-141-5/+9
| | | | | | work with our old code. In fmt_scaled() move the check before calling llabs(). found by regress/lib/libutil/fmt_scaled; OK deraadt@ millert@ tedu@
* explicitly mention local processes; from geoff hilljmc2018-09-261-3/+3
| | | | ok nicm
* delete volatile intended to silence whiny old compilers around vfork.deraadt2018-08-101-2/+2
| | | | | This variable is only used in the parent context so there is no issue. ok kettenis
* constrain fractional part to [0-9] (less confusing to static analysis); ok ian@djm2018-05-141-2/+5
|
* Fix function argument names, from Abel Abraham Camarillo Ojeda via jmc@.nicm2018-02-161-9/+9
|
* Adjust references for sysctl(3) to sysctl(2)deraadt2018-01-122-6/+6
|
* Make a few internal symbols static and add a Symbols.map version scriptkettenis2017-12-145-13/+107
| | | | | | to control which symbols are exported from the shared library. ok guenther@, deraadt@, jca@
* It's the imsg_compose(3) who accepts 'fd' argument, not imsg_create(3).zhuk2017-12-061-9/+9
|
* spacing (in EXAMPLES code)reyk2017-05-031-3/+3
|
* add previous to NAME;jmc2017-04-201-2/+5
|
* Add getptmfd(), fdopenpty(), fdforkpty() functions. These allow programsnicm2017-04-204-19/+96
| | | | | | | | | to separate the open(/dev/ptm) from the ioctl(PTMGET) for privilege separation or pledge(). Based on a diff from reyk@. ok deraadt millert
* use freezero() instead of explicit_bzero+freederaadt2017-04-181-3/+2
|
* Use freezero(3) for the imsg framework in imsg_free(3) and ibuf_free(3).reyk2017-04-112-4/+4
| | | | | | | | | | In our privsep model, imsg is often used to transport sensitive information between processes. But a process might free an imsg, and reuse the memory for a different thing. iked uses some explicit_bzero() to clean imsg-buffer but doing it in the library with the freezero() is less error-prone and also benefits other daemons. OK deraadt@ jsing@ claudio@
* Use C99 types (uint32_t) instead of BSD (u_int32_t) - the former arenicm2017-03-243-37/+37
| | | | | | more portable. Add stdint.h to the headers in imsg_init(3). No objections from millert@.
* Grow buffers using recallocarray, to avoid the potential dribble thatderaadt2017-03-171-2/+2
| | | | | | | the standard realloc*() functions can leave behind. imsg buffers are sometimes used in protocol stacks which require some secrecy, and layering violations would be needed to resolve this issue otherwise. Discussed with many.
* Fix overly-conservative overflow checks on mulitplications and add checksdtucker2017-03-161-3/+11
| | | | | on additions. This allows scan_scaled to work up to +/-LLONG_MAX (LLONG_MIN will still be flagged as a range error). ok millert@
* Collapse underflow and overflow checks into a single block.dtucker2017-03-151-7/+4
| | | | ok djm@ millert@
* Catch integer underflow in scan_scaled reported by Nicolas Iooss.dtucker2017-03-151-1/+6
| | | | ok deraadt@ djm@
* fix signed integer overflow in scan_scaled. Found by Nicolas Ioossdjm2017-03-111-1/+14
| | | | using AFL against ssh_config. ok deraadt@ millert@
* zap trailing whitespace;jmc2016-10-151-3/+3
|
* Fixup the example for msgbuf_write() and imsg_read() to check thereyk2016-10-101-5/+11
| | | | | | | | error cases for -1 and 0 explicitly (it initially only checked for -1, I updated it to also check for 0, and rzalamena@ figured out that 0 has to be checked in a differently). OK millert@ rzalamena@
* Use a constant format string and output the variable part with %sguenther2016-08-301-11/+11
| | | | ok krw@ millert@
* Use O_CLOEXEC when opening fds local to a functionguenther2016-08-304-12/+13
| | | | ok jca@ krw@
* Pull in <stdio.h> for NULLguenther2016-08-272-2/+4
| | | | ok deraadt@
* Refer to /etc/passwd consistently as the "legacy password file" andtb2016-08-142-8/+10
| | | | | | remove some references to differences between versions 6 and 7. ok jmc, millert, tedu
* Fix example: long long should be print with %lldjca2016-07-161-3/+3
|
* Remove obsolete caveat. OK deraadt@millert2016-05-181-9/+2
|
* for some time now mandoc has not required MLINKS to functionjmc2016-03-301-57/+1
| | | | | | | | | | | | correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
* 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@
* 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@
* Add a cast to silence a compiler warning by clang on FreeBSD.tb2015-12-091-2/+2
| | | | | From Craig Rodrigues. ok tedu@
* Do not loop on EAGAIN in imsg_read(). Better to return the error to theclaudio2015-12-052-9/+7
| | | | | caller and let him do another poll loop. This fixes spinning relayd processes seen on busy TLS relays. OK benno@ henning@
* Remove three NULL-checks before free(). ok millert@mmcc2015-11-273-11/+7
|
* Use the backchannel for all error messages instead of syslog(3).millert2015-11-261-16/+15
| | | | OK deraadt@ beck@
* creat() -> open equiv; from Frederic Nowakderaadt2015-11-111-2/+2
|
* update NAME section to include all documented functions,jmc2015-11-101-3/+3
| | | | | | or otherwise change Dt to reflect the name of an existing function; feedback/ok schwarze
* Don't Xr flock, since that is not the locking method used.deraadt2015-10-151-3/+2
| | | | ok millert
* Remove useless quoting from .Fo and .Fn function names, to preventschwarze2015-09-141-3/+3
| | | | | | development of a cargo cult in case people look at existing files for examples. This achieves a consistent .Fo and .Fn quoting style across the whole tree.
* in the SYNOPSIS, make void function arguments explicitschwarze2015-09-142-7/+7
|
* reduce more .Nd to one line and kill more .Tnschwarze2015-09-101-4/+3
|
* reduce .Nd to one line and kill .Tn while hereschwarze2015-09-102-10/+6
|
* Remove lies about openpty(4) searching for a free pseudo-tty by iteratingkettenis2015-08-281-12/+6
| | | | through all existing pseudo-tty devices in /dev.