summaryrefslogtreecommitdiffstats
path: root/lib/libutil/imsg-buffer.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* change the barrier so that fd's are always passed and received witheric2021-03-311-8/+10
| | | | | | the first byte of the imsg they belong to. idea, tweaks and ok claudio@
* Change imsg header definitions to use standard types.bcook2019-01-201-2/+2
| | | | ok deraadt@ claudio@
* Make a few internal symbols static and add a Symbols.map version scriptkettenis2017-12-141-7/+7
| | | | | | to control which symbols are exported from the shared library. ok guenther@, deraadt@, jca@
* Use freezero(3) for the imsg framework in imsg_free(3) and ibuf_free(3).reyk2017-04-111-2/+2
| | | | | | | | | | 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@
* 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.
* check for NULL in ibuf_free().benno2015-12-291-1/+3
| | | | | ok and slight improvement, mmcco@ ok semarie@ and encouragement tedu@ krw@
* Use memset instead of bzero for better portability.nicm2015-07-121-5/+5
| | | | ok gilles claudio doug
* bzero cmsgbuf before using it, silences valgrind warnings.brynet2015-07-031-1/+2
| | | | henning@ "sure"
* return ERANGE instead of ENOMEM, so callers can differentiate real oombenno2014-12-251-2/+2
| | | | | | from this case where we have a static buffer and cant realloc. ok phessler, claudio, reyk
* limits.h rather than sys/param.hderaadt2014-06-301-2/+3
|
* original bug diagnosed by sthen: automatic retry in msgbuf_write onbenno2013-11-131-3/+3
| | | | | | | | | | | EAGAIN causes spinning. fix from claudio: "Let msgbuf_write return -1 with errno EAGAIN. The users then must check if this was the case and readd the event or poll again. The current handling in the imsg code is wrong for sure." ok gilles
* in imsg_read() avoid calling recvmsg() if we detect that we will be shortgilles2012-06-021-15/+17
| | | | | | | | | | | | | on descriptors, this can be achieved thanks to the new getdtablecount() system call. application may provide a reserve count to ensure that the recvmsg() call is not called when they don't have enough descriptors to work properly. change the API so that transient errors that can be retried immediately are retried within the function right away, whereas transient errors for which the application may want to take action will set errno to EAGAIN. ok deraadt@ and henning@
* Move imsg into libutil and add a man page.nicm2010-05-261-0/+303
Minor bump for libutil. Previous versions of this diff and man page looked at by various people. "you should just commit" deraadt