Commit Graph

11 Commits

Author SHA1 Message Date
Nicholas J. Kain
f8773742c9 ncmlib: Cosmetic cleanups to chroot.c. 2013-05-08 06:58:55 -04:00
Nicholas J. Kain
930b92a268 Remove strlc(at|py). 2013-05-06 07:32:02 -04:00
Nicholas J. Kain
7ab11e8295 Add strnkcpy() and strnkcat(). These are similar to strlcpy and strlcat,
but simply return a bool indicating whether the destination received
a truncated copy of the source (true if truncation occurs else false).

The change in return value semantics allows these functions to stop
scanning the source string early when truncation occurs, stopping the
program from scanning a possibly arbitrary-length source string.

I rarely use these return values in my own programs, so it won't be
very hard to bulk convert with no risk of regressions.

Further, the different namespace allows me to not depend on the presence
or absence of strlc(py|at) in the standard libraries.
2013-05-06 07:06:33 -04:00
Nicholas J. Kain
f4f9d02afd Enforce seccomp syscall restrictions when kernel support exists. 2012-07-20 07:05:56 -04:00
Nicholas J. Kain
27524d9d34 Use the new libc_random_u32() in ncmlib to replace random_xid(). 2011-06-27 15:07:00 -04:00
Nicholas J. Kain
bd49819f28 Fix a bug in safe_read() that would cause short reads on an async socket
to return failure rather than the number of characters read.
2011-06-10 13:53:05 -04:00
Nicholas J. Kain
9dce1a0378 Make sure our assigned address is unique on our segment by using arp. 2010-11-15 20:06:50 -05:00
Nicholas J. Kain
693c9256e4 Add safe_read() to ncmlib and use it in ndhc. 2010-11-13 08:37:33 -05:00
Nicholas J. Kain
a43e69c7ae Factor out safe_write() into ncmlib and use it in ndhc as well. 2010-11-13 08:18:23 -05:00
Nicholas J. Kain
955031bce1 Somehow not all of ncmlib was version controlled. Fix. 2010-11-12 18:46:45 -05:00
Nicholas J. Kain
b2daf09c10 Move set_cap() to ncmlib/cap.[ch]. 2010-11-12 09:04:43 -05:00