tls_pending(3)

2021-09-16 Thread Kristaps Dzonsons
Hi, I'm porting a nonblocking, polling OpenSSL system to libtls. However, I'm not sure how this is non-hackily possible without SSL_pending(3) to detect if less data is read with tls_read() than is buffered. writer: tls_write(40) reader: poll(POLLIN, INFTIM) -> POLLIN /* descriptor ha

rpki-client: validate.c, roa.c, main.c docs

2019-11-17 Thread Kristaps Dzonsons
This causes validate.c's valid_cert() doc not to lie, makes the language consistent with other functions, and cleans a typo. In main.c, this documents tal_load_default() (which it marks static), moves a #define to the top of the page, and documents it too. In roa.c, this adds documentation. Index

rpki-client: remove unused variables

2019-11-17 Thread Kristaps Dzonsons
This removes some unused variables from the output files. ? remove-unused-variables.patch Index: output-bird.c === RCS file: /cvs/src/usr.sbin/rpki-client/output-bird.c,v retrieving revision 1.1 diff -u -p -u -r1.1 output-bird.c --- ou

rpki-client: check empty TAL file

2019-11-17 Thread Kristaps Dzonsons
If tal_read_file() returns a NULL buffer, which can happen with an empty file or one containing only comments, the NULL value eventually propogates to tal_parse_buffer() where it crashes on strchr(). This patch also adds/fixes documentation to the some functions, specifies a NUL terminator instead

Re: rsync: gettimeofday+TIMEVAL_TO_TIMESPEC -> UTIME_NOW

2019-03-22 Thread Kristaps Dzonsons
>> ... it says the modification time is a time_t. Which means we only >> have seconds, not subseconds. > > Fair enough. The protocol predates common availability of nanosecond > file timestamps. It's worse than that. It's 32-bit time_t.

openrsync: return codes

2019-03-22 Thread Kristaps Dzonsons
The following patch fixes exit codes, which became confused in the switch from returning a Boolean and an exit code. I actually prefer for these to become an enum to avoid further confusion, but this just gets it fixed. It also documents the return values in each function and unifies the protocol

fts and unveil issue

2019-02-03 Thread Kristaps Dzonsons
When I unveil(2), fts doesn't behave well. But only in a subtle way. Enclosed is a demonstration. I found this with openrsync, which unveils before using fts_open to scan for files. When run with a directory with only empty subdirectories or just files, this works fine. But when run with a dire

Re: ASN1_get_object.3

2019-01-30 Thread Kristaps Dzonsons
plate,v 1.15 2014/03/31 00:09:54 dlg Exp $ .\" .\" Copyright (c) 2019 Kristaps Dzonsons .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice an

ASN1_get_object.3

2019-01-30 Thread Kristaps Dzonsons
very easily take a BER-encoded string and parse out its ASN.1 data structures. The functions are defined in /usr/src/lib/libcrypto/asn1/asn1_lib.c. .\" $OpenBSD: mdoc.template,v 1.15 2014/03/31 00:09:54 dlg Exp $ .\" .\" Copyright (c) 2019 Kristaps Dzonsons .\" .\" Permis

Re: acme-client -t switch?

2017-03-11 Thread Kristaps Dzonsons
>>> Since this came up.. what does anyone think about adding the original >>> version back to ports? (personally, I could do with moving things away >>> from the python version, but I need dns-01..) >> >> I'm planing on re-introducing the [-t switch] functinality. > > What direction are you planni

"user" chroot (patch)

2017-03-10 Thread Kristaps Dzonsons
In running risky non-root applications, it'd be great to chroot(2) without needing to be root. But the manpage says no. So I added a system call, uchroot(2), that does the following: (1) performs the change-root w/o checking for root (2) disables setuid (flag is inherited) The (2) plugs the h

Re: vmd + httpd + meta-data

2017-02-27 Thread Kristaps Dzonsons
> I wrote this little tool for vmd that is not intended for the tree, > but will eventually go into ports (it uses kcgi which is not in base). Have you thought of writing this in a secure language like Rust or Swift? Writing cgi stuff in C seems just asking for trouble.

Add Suunto D6i over FTDI

2016-12-11 Thread Kristaps Dzonsons
Hi, Enclosed is a one-liner to get my Suunto D6i dive computer (FTDI) recognised by libdivecomputer, http://www.libdivecomputer.org/. Before it was just seen as a ugen. After: port 1 addr 6: full speed, power 300 mA, config 1, Suunto Sports Instrument(0xf680), Suunto(0x0403), rev 6.00, iSerial

Re: sqlite c api manpages?

2016-05-03 Thread Kristaps Dzonsons
>> We should provide documentation for at least the programmatic aspects >> of it. (The full extent of SQL language documentation may be beyond >> the scope of base, but C APIs are not.) > > I doubt it's worth wasting time on. Ingo, I can't speak for sqlite and inclusion (what is this `less bloa

Re: sqlite c api manpages?

2016-05-02 Thread Kristaps Dzonsons
>> If you're on OpenBSD, you started with "apropos -s3 sqlite3", were >> shocked that there's nothing there, then moved on to Google with a >> wounding confusion in your heart. > > Indeed. I see this didn't get much traction, but it sounds good to me. We are > shipping sqlite as a system interface

sqlite c api manpages?

2016-04-03 Thread Kristaps Dzonsons
Hi, If you've used the SQLite C library, you're familiar with where their docs live: https://www.sqlite.org/c3ref/intro.html If you're on OpenBSD, you started with "apropos -s3 sqlite3", were shocked that there's nothing there, then moved on to Google with a wounding confusion in your heart. Th

Re: toy zones for openbsd - an undergrad operating systems course assignment

2015-10-30 Thread Kristaps Dzonsons
> however, i found it interesting to get my head around this aspect > of the system, and i figured other people (such as this years > comp3301 students) would be interested too. i also felt sad i couldnt > find kritaps mult code anywhere, so i wanted this to be backed up > by everyone for future po

Re: Switch OpenBSD manuals to DocBook

2014-04-01 Thread Kristaps Dzonsons
:00 - +++ docbook2mdoc.1 1 Apr 2014 11:03:51 - @@ -0,0 +1,66 @@ +.\" $Id$ +.\" +.\" Copyright (c) 2014 Kristaps Dzonsons +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby grante

sftp and put'ing /dev/stdin.

2011-10-07 Thread Kristaps Dzonsons
Hi, Enclosed is a small patch that lifts the constraint on uploading only regular files in sftp(1). It's useful to me in dump(8)ing to a remote ChrootDirectory'd, ForceCommand sftp-internal server so that I needn't put dd(1) or something in the jail. This way, I can have an empty jail for b

Re: utrace(2)

2011-07-18 Thread Kristaps Dzonsons
Hi, Index: lib/libc/sys/utrace.2 === RCS file: lib/libc/sys/utrace.2 diff -N lib/libc/sys/utrace.2 --- /dev/null 1 Jan 1970 00:00:00 - +++ lib/libc/sys/utrace.2 18 Jul 2011 09:28:15 - @@ -0,0 +1,93 @@ +.\" $Ope

Re: isfdtype(3) man page bug

2011-04-20 Thread Kristaps Dzonsons
On 20/04/2011 08:40, Jason McIntyre wrote: On Tue, Apr 19, 2011 at 04:04:52PM -0700, Matthew Dempsky wrote: In the STANDARDS section, groff -Tascii -mandoc isfdtype.3 renders: The isfdtype() function is expected to conform to POSIX 1003.1g. whereas mandoc renders: The isfdtype() f