[PATCH] relayd, fix crash on Host: HTTP 400 Bad Request and use-after-free

2015-08-08 Thread Hiltjo Posthuma
Hi! I was testing relayd and found an issue which would make relayd crash. Reproduce: Test config /etc/relayd.conf: http protocol test { pass response block url host return error } relay testing { listen on 127.0.0.1 port 8080

httpd: fix/style: unbalanced va_start and va_end macros

2016-04-27 Thread Hiltjo Posthuma
Hi, The following patch for httpd fixes unbalanced va_start() and va_end() macros. This is in style with the rest of httpd. Also POSIX says: "Each invocation of the va_start() and va_copy() macros shall be matched by a corresponding invocation of the va_end() macro in the same function."

httpd: patch for portability asprintf use

2016-04-27 Thread Hiltjo Posthuma
Hi, The following patch for httpd makes sure the value of the asprintf buffer is zeroed on error and not relied upon, so at the 'done' label free(body) and free(hstsheader) is safe. from asprintf(3): "The asprintf() and vasprintf() functions return the number of characters that

httpd: httpd.conf(5): text/plain for .txt

2016-04-27 Thread Hiltjo Posthuma
Hi, For text content the response HTTP header "Content-Type: text/plain" is commonly used. This patch changes it in the httpd.conf(5) documentation: Index: httpd.conf.5 === RCS file: /cvs/src/usr.sbin/httpd/httpd.conf.5,v retrieving

Re: libfuse: null-terminate argv (fuse_opt_insert_arg)

2016-05-23 Thread Hiltjo Posthuma
On Fri, May 20, 2016 at 10:57:10PM +0800, Ray Lai wrote: > On Thu, 19 May 2016 18:57:50 +0200 > Hiltjo Posthuma <hil...@codemadness.org> wrote: > > > Hi peoples, > > > > This diff makes sure to NUL-terminate argv when parsing options in libfuse. > > The

libfuse: null-terminate argv (fuse_opt_insert_arg)

2016-05-19 Thread Hiltjo Posthuma
Hi peoples, This diff makes sure to NUL-terminate argv when parsing options in libfuse. The upstream/other libfuse does it this way. This fixes an issue with the sysutils/sshfs port, it uses execvp(3) on the fuse_args argv and this gave an error "bad address". Index: fuse_opt.c

Re: httpd: patch for portability asprintf use

2016-05-06 Thread Hiltjo Posthuma
On Wed, Apr 27, 2016 at 2:41 PM, Hiltjo Posthuma <hil...@codemadness.org> wrote: > Hi, > > The following patch for httpd makes sure the value of the asprintf buffer is > zeroed on error and not relied upon, so at the 'done' label free(body) and > free(hstsheader) is safe

Re: httpd: patch for portability asprintf use

2016-05-06 Thread Hiltjo Posthuma
On Fri, May 6, 2016 at 6:47 PM, Todd C. Miller <todd.mil...@courtesan.com> wrote: > On Fri, 06 May 2016 17:56:16 +0200, Hiltjo Posthuma wrote: > >> Any OK's for this? >> >> Please also see my mail with subject "httpd: fix/style: unbalanced >> va_sta

Re: vmctl: move some validations in start_vm()

2016-05-09 Thread Hiltjo Posthuma
On Sun, May 08, 2016 at 07:27:13PM +, Fabien Siron wrote: > Hi everyone, > > The following patch moves all the validations of the start command in > start_vm() as suggested in the comment. > > Index: vmctl.c > === > RCS file:

poll(2) man page example typo

2017-02-14 Thread Hiltjo Posthuma
Hi!, I noticed the poll(2) man page has a typo in the example. The below patch fixes this: diff --git a/lib/libc/sys/poll.2 b/lib/libc/sys/poll.2 index 1c622a450ab..21f46c549fd 100644 --- a/lib/libc/sys/poll.2 +++ b/lib/libc/sys/poll.2 @@ -295,7 +295,7 @@ if (nready == 0) errx(1, "time

relayd.conf.5: X-Forwarded-By $REMOTE_ADDR typo

2017-03-24 Thread Hiltjo Posthuma
Hey, I think there is a typo in relayd.conf(5). X-Forwarded-By should be the server $SERVER_ADDR instead of the client $REMOTE_ADDR. X-Forwarded-For is the client (correct). diff --git a/usr.sbin/relayd/relayd.conf.5 b/usr.sbin/relayd/relayd.conf.5 index 8bed93efa1f..5f3eb0b2f9a 100644 ---

relayd X-Forwarded-For configuration example: append -> set

2017-04-09 Thread Hiltjo Posthuma
Hey, In the relayd.conf(5) example it is better to set the X-Forwarded-For header (set) and not trust whatever the client sends in the headers (append). (Except ofcourse when the client is another trusted proxy) This is mentioned in a discussion on misc@ by Stuart Henderson in the thread

Re: cdce(4): replace CRC32 function with common ether_crc32_le

2017-04-09 Thread Hiltjo Posthuma
On Fri, Mar 31, 2017 at 04:41:27PM +0200, Hiltjo Posthuma wrote: > Hi, > > This patch removes the CRC32 function from the driver and uses the common > function ether_crc32_le. > > Maybe worth noting is that by testing in userspace using gcc -O0 the > specific cdce(4) CR

Re: delete pf states by exact flow info and speed it up

2017-04-22 Thread Hiltjo Posthuma
On Sat, Apr 22, 2017 at 08:14:06AM +0900, YASUOKA Masahiko wrote: > On Fri, 21 Apr 2017 13:52:51 +0900 (JST) > YASUOKA Masahiko wrote: > > +int > > +pfctl_parse_host(char *str, struct pf_rule_addr *addr) > > +{ > (snip) > > + if ((sbs = strchr(s, '[')) != NULL || (sbe =

www/61.html reallocarray(1) typo

2017-03-10 Thread Hiltjo Posthuma
Hey, I think a small typo slipped in the 6.1 notes. Patch below: diff --git a/61.html b/61.html index 4b5dadbd4..18208b588 100644 --- a/61.html +++ b/61.html @@ -244,7 +244,7 @@ to 6.1. New function http://man.openbsd.org/recallocarray.3;>recallocarray(3) to reduce the

cdce(4): replace CRC32 function with common ether_crc32_le

2017-03-31 Thread Hiltjo Posthuma
Hi, This patch removes the CRC32 function from the driver and uses the common function ether_crc32_le. Maybe worth noting is that by testing in userspace using gcc -O0 the specific cdce(4) CRC32 function is about twice as fast as ether_crc32_le. Apart from this no functional change is intended.

httpd: remove unused media_encoding field

2017-08-13 Thread Hiltjo Posthuma
Hi, This patch removes the unused media_encoding field, it was probably intended to be used to add text-encoding information. However: forcing a text-encoding can be useful in some cases. Currently in httpd.conf the text-encoding can be set with a hack for example: types { "text"/"plain;

ssl.8: small typo in last commit about subjectAltName

2017-07-08 Thread Hiltjo Posthuma
Fix small typo in the last commit of ssl(8): diff --git a/share/man/man8/ssl.8 b/share/man/man8/ssl.8 index 2a7641b921c..70c39e32767 100644 --- a/share/man/man8/ssl.8 +++ b/share/man/man8/ssl.8 @@ -95,7 +95,7 @@ You can also sign the key yourself, using the command: .Ed .Pp Note that some new

acme-client: revoke-proc tiny typo

2017-07-08 Thread Hiltjo Posthuma
Tiny typo in a comment in acme-client revokeproc.c diff --git a/usr.sbin/acme-client/revokeproc.c b/usr.sbin/acme-client/revokeproc.c index 66ccfa315a2..994ff768675 100644 --- a/usr.sbin/acme-client/revokeproc.c +++ b/usr.sbin/acme-client/revokeproc.c @@ -164,7 +164,7 @@ revokeproc(int fd, const

Re: [patch] mg: fix overflow on vteeol() (resend/bump)

2017-07-05 Thread Hiltjo Posthuma
On Sat, Jun 24, 2017 at 02:45:44PM +0200, Hiltjo Posthuma wrote: > On Sun, Jun 18, 2017 at 03:04:31PM +0200, Hiltjo Posthuma wrote: > > Hey, > > > > This is a resend/bump of a patch about a month ago, can it get applied? > > > > Original message below: >

Re: [patch] mg: fix overflow on vteeol()

2017-05-12 Thread Hiltjo Posthuma
On Sun, May 07, 2017 at 05:31:26PM +0200, Hiltjo Posthuma wrote: > Hey, > > mg crashes with certain (unicode) characters and moving the cursor to the > end of the line. > > The characters are printed to the screen as \nnn in vtpute() and vtcol is > updated, however vteeo

Re: [patch] mg: fix overflow on vteeol() (resend/bump)

2017-06-24 Thread Hiltjo Posthuma
On Sun, Jun 18, 2017 at 03:04:31PM +0200, Hiltjo Posthuma wrote: > Hey, > > This is a resend/bump of a patch about a month ago, can it get applied? > > Original message below: > > > mg crashes with certain (unicode) characters and moving the cursor to the > end of th

Re: [patch] mg: fix overflow on vteeol()

2017-05-26 Thread Hiltjo Posthuma
On Fri, May 12, 2017 at 12:01:52PM +0200, Hiltjo Posthuma wrote: > On Sun, May 07, 2017 at 05:31:26PM +0200, Hiltjo Posthuma wrote: > > Hey, > > > > mg crashes with certain (unicode) characters and moving the cursor to the > > end of the line. > > > > T

[PATCH] httpd: set line to NULL after free()

2017-05-28 Thread Hiltjo Posthuma
Hi, There is a bit spooky code I think in the server_read_http function after freeing the line buffer and parsing the line :) Right now I think a double-free bug is prevented because the maxiumum header length is checked using SERVER_MAXHEADERLENGTH (=8192). else an integer overflow of

[patch] mg: fix overflow on vteeol() (resend/bump)

2017-06-18 Thread Hiltjo Posthuma
Hey, This is a resend/bump of a patch about a month ago, can it get applied? Original message below: mg crashes with certain (unicode) characters and moving the cursor to the end of the line. The characters are printed to the screen as \nnn in vtpute() and vtcol is updated, however vteeol()

Re: OpenBSD 6.1: relayd does not start more than 3 processes

2017-05-07 Thread Hiltjo Posthuma
On Fri, May 05, 2017 at 04:05:09PM +0200, Maxim Bourmistrov wrote: > > > 5 maj 2017 kl. 15:55 skrev Maxim Bourmistrov <m...@alumni.chalmers.se>: > > > > > >> 5 maj 2017 kl. 14:41 skrev Hiltjo Posthuma <hil...@codemadness.org>: > >> &

[patch] mg: fix overflow on vteeol()

2017-05-07 Thread Hiltjo Posthuma
Hey, mg crashes with certain (unicode) characters and moving the cursor to the end of the line. The characters are printed to the screen as \nnn in vtpute() and vtcol is updated, however vteeol() will write beyond the buffer. A test file contains the data: —— It is printed to

relayd: use __func__ in log messages

2017-05-07 Thread Hiltjo Posthuma
Hey, This replaces the prefix in log messages to __func__. Some older code had the prefix still set to another name. Patch below: diff --git a/usr.sbin/relayd/ca.c b/usr.sbin/relayd/ca.c index 45bd5f3224b..de002488d9c 100644 --- a/usr.sbin/relayd/ca.c +++ b/usr.sbin/relayd/ca.c @@ -96,11 +96,11

Re: OpenBSD 6.1: relayd does not start more than 3 processes

2017-05-05 Thread Hiltjo Posthuma
On Fri, May 05, 2017 at 12:30:56PM +0200, Maxim Bourmistrov wrote: > > Hey, > on OpenBSD 6.0-stable I have following configuration for relayd: > > snip——— > interval 10 > timeout 1200 > prefork 15 > log all > —— > > Respective login.conf to spawn more relayd procs: > >

Re: Exec pledges

2017-10-08 Thread Hiltjo Posthuma
On Sun, Oct 08, 2017 at 02:43:48AM -0700, Ori Bernstein wrote: > And pax, because I can > > > > > diff --git bin/pax/ar_io.c bin/pax/ar_io.c > index 40a6492405e..ce53a9ae51b 100644 > --- bin/pax/ar_io.c > +++ bin/pax/ar_io.c > @@ -1281,6 +1281,11 @@ ar_start_gzip(int fd, const char

Re: httpd: remove unused media_encoding field

2017-08-31 Thread Hiltjo Posthuma
On Sun, Aug 13, 2017 at 03:53:53PM +0200, Hiltjo Posthuma wrote: > Hi, > > This patch removes the unused media_encoding field, it was probably intended > to > be used to add text-encoding information. > > However: forcing a text-encoding can be useful in some cases. >

Re: [patch]Use BUFSIZE instead of hard-code in netcat.c

2017-10-25 Thread Hiltjo Posthuma
On Tue, Oct 24, 2017 at 02:52:39PM +0200, Alexander Bluhm wrote: > On Tue, Oct 24, 2017 at 07:44:02PM +0800, Nan Xiao wrote: > > Use BUFSIZE instead of hard-code in netcat.c, FYI. Thanks! > > As this buffer is used with MSG_PEEK and its content is discarded, > the size does not really matter.

Re: cdce0 troubles on RPi3, few ways to fix, which one to choose?

2018-05-23 Thread Hiltjo Posthuma
On Mon, May 21, 2018 at 08:47:29PM +0200, Karel Gardas wrote: > > Hi, > > I do have 2 USB ethernet adapters based on Realtek 8153: > > TP-Link UE 300 > Lenovo Thinkpad USB 3.0 Gigabit Adapter > > both adapters work well with 6.3-current on amd64 platform. If however I try > to use them on

Re: httpd response mimetype bug

2018-06-15 Thread Hiltjo Posthuma
On Wed, Jun 13, 2018 at 08:07:11PM +0200, Reyk Floeter wrote: > On Sat, Jan 13, 2018 at 05:23:35PM +0100, Sebastian Benoit wrote: > > Hiltjo Posthuma(hil...@codemadness.org) on 2018.01.13 13:08:38 +0100: > > > On Sat, Jan 13, 2018 at 09:39:44AM +0100, Anton Lindqvist wrote: >

Re: httpd request rewrite

2018-05-29 Thread Hiltjo Posthuma
On Tue, May 29, 2018 at 06:48:31PM +0200, Reyk Floeter wrote: > Hi, > > it's about time. > > server "default" { > listen on * port 80 > location match "/de/(.*)" { > request rewrite "/ch/%1" > } > } > > You can also you

Re: [Patch] mg(1): Experimental UTF-8 support

2018-05-30 Thread Hiltjo Posthuma
On Tue, May 29, 2018 at 05:22:43PM +0300, Leonid Bobrov wrote: > On Tue, May 29, 2018 at 03:33:08PM +0200, Henning Brauer wrote: > > Hi, > > > > very welcome! > > > > I have applied the diff and don't notice immediate breakage. Pls poke > > You didn't notice cursor movement bugs? o_O > Well,

Re: SA_RESETHAND race (or the mpv(1) hanging story)

2018-06-23 Thread Hiltjo Posthuma
On Fri, Mar 16, 2018 at 02:40:00PM +0100, Hiltjo Posthuma wrote: > On Fri, Mar 16, 2018 at 02:29:24PM +0100, Hiltjo Posthuma wrote: > > On Thu, Mar 15, 2018 at 03:27:47PM +0100, Martin Pieuchot wrote: > > > On 05/03/18(Mon) 21:26, Hiltjo Posthuma wrote: > > > > &

Re: httpd response mimetype bug

2018-01-13 Thread Hiltjo Posthuma
On Sat, Jan 13, 2018 at 09:39:44AM +0100, Anton Lindqvist wrote: > On Tue, Jan 09, 2018 at 05:38:57PM +0100, Hidvégi Gábor wrote: > > >Synopsis: httpd reports wrong mimetype when item is in the browser cache > > >Category: httpd > > >Environment: > > System : OpenBSD 6.2 > >

Re: patterns.c question or possible bug

2018-01-30 Thread Hiltjo Posthuma
On Tue, Jan 30, 2018 at 07:48:17AM +0100, Otto Moerbeek wrote: > On Mon, Jan 29, 2018 at 11:23:18PM -0600, Edgar Pettijohn wrote: > > > I'm trying to use patterns.c for some pattern matching. The manual mentions > > captures using "()" around what you want to capture. I don't see how to get > >

Re: httpd: single FastCGI script handling all requests

2018-03-07 Thread Hiltjo Posthuma
On Tue, Mar 06, 2018 at 04:39:04PM -0300, Diogo Galvao wrote: > The following patch makes it possible to handle all FastCGI requests > with a single script so it can route clean URLs itself. > > Was it already possible some other way? > > And, regardless of this patch, is it even a feature you'd

Re: SA_RESETHAND race (or the mpv(1) hanging story)

2018-03-16 Thread Hiltjo Posthuma
On Fri, Mar 16, 2018 at 02:29:24PM +0100, Hiltjo Posthuma wrote: > On Thu, Mar 15, 2018 at 03:27:47PM +0100, Martin Pieuchot wrote: > > On 05/03/18(Mon) 21:26, Hiltjo Posthuma wrote: > > > > [...] > > > > I tried your patch on a source build of about 25 fe

Re: SA_RESETHAND race (or the mpv(1) hanging story)

2018-03-16 Thread Hiltjo Posthuma
On Thu, Mar 15, 2018 at 03:27:47PM +0100, Martin Pieuchot wrote: > On 05/03/18(Mon) 21:26, Hiltjo Posthuma wrote: > > > [...] > > > I tried your patch on a source build of about 25 februari on amd64. I > > > still > > > notice mpv hanging when I

Re: SA_RESETHAND race (or the mpv(1) hanging story)

2018-03-05 Thread Hiltjo Posthuma
On Fri, Mar 02, 2018 at 02:18:46PM +0100, Hiltjo Posthuma wrote: > On Wed, Feb 21, 2018 at 02:15:07PM +0100, Martin Pieuchot wrote: > > Diff below fixes a race in signal handling that can be triggered when > > a multi-threaded process installs a signal handler with SA_RESETH

Re: SA_RESETHAND race (or the mpv(1) hanging story)

2018-03-02 Thread Hiltjo Posthuma
On Wed, Feb 21, 2018 at 02:15:07PM +0100, Martin Pieuchot wrote: > Diff below fixes a race in signal handling that can be triggered when > a multi-threaded process installs a signal handler with SA_RESETHAND. > > I described a case of this problem on bugs@ a month ago: >

rcctl, tiny typo in comment

2018-10-21 Thread Hiltjo Posthuma
Hi, Below a patch for a very small typo in a comment in /usr/sbin/rcctl diff --git a/usr.sbin/rcctl/rcctl.sh b/usr.sbin/rcctl/rcctl.sh index 61ad76a4987..3b2f0cabe49 100644 --- a/usr.sbin/rcctl/rcctl.sh +++ b/usr.sbin/rcctl/rcctl.sh @@ -263,7 +263,7 @@ svc_get() fi

small timespec_get(3) man page typo

2018-10-31 Thread Hiltjo Posthuma
Hi, Below is a patch to fix a small typo in the man page for timespec_get(3). diff --git a/lib/libc/gen/timespec_get.3 b/lib/libc/gen/timespec_get.3 index 1092344a666..c698d10926a 100644 --- a/lib/libc/gen/timespec_get.3 +++ b/lib/libc/gen/timespec_get.3 @@ -40,7 +40,7 @@ .Fn timespec_get

httpd: fix/consistency cast for ctype function

2018-11-02 Thread Hiltjo Posthuma
Hi, I noticed many ctype functions (such as isalpha, isdigit, tolower) are cast to unsigned char in httpd. This patch changes it also for one remaining check. I'm not sure the cast is neccessary on OpenBSD, but it is undefined behaviour I think as described in the man page isalpha(3): "CAVEATS

Re: mg: Delete region

2018-12-23 Thread Hiltjo Posthuma
On Sun, Dec 23, 2018 at 01:58:16PM +, Mark Lumsden wrote: > On Sun, 23 Dec 2018, Hiltjo Posthuma wrote: > > > Date: Sun, 23 Dec 2018 13:43:32 +0100 > > From: Hiltjo Posthuma > > To: Mark Lumsden > > Cc: Leonid Bobrov , tech@openbsd.org > > Subject: Re: mg

Re: mg: Delete region

2018-12-23 Thread Hiltjo Posthuma
On Thu, Dec 20, 2018 at 06:44:15AM +, Mark Lumsden wrote: > hmm, you are correct. I'm trying to remember which machine I tested > on that made me come to that conclusion. > > On Thu, 20 Dec 2018, Leonid Bobrov wrote: > > > Date: Thu, 20 Dec 2018 06:43:02 +0200 > > From: Leonid Bobrov > >

malloc.3: remove left-over from malloc_usable_size commit

2018-12-05 Thread Hiltjo Posthuma
Hi, In the malloc_usable_size() revert commit it was forgotten to remove one line. The below patch fixes this: diff --git a/lib/libc/stdlib/malloc.3 b/lib/libc/stdlib/malloc.3 index 49a5b993f44..cc71560739a 100644 --- a/lib/libc/stdlib/malloc.3 +++ b/lib/libc/stdlib/malloc.3 @@ -63,7 +63,6 @@

Re: [patch] improve strptime(3) %z timezone parsing

2019-03-24 Thread Hiltjo Posthuma
On Sun, Feb 24, 2019 at 01:11:39PM +0100, Hiltjo Posthuma wrote: > Hi, > > I noticed some things in the strptime(3) implementing when parsing timezone > strings using the %z format string. > > 1. I noticed the tm_gmtoff value is not correctly set in some cases. It shou

Re: introduce 'pfctl -FR' to reset settings to defaults

2019-04-05 Thread Hiltjo Posthuma
On Wed, Apr 03, 2019 at 11:10:21AM +0200, Alexandr Nedvedicky wrote: > Hello, > > On Tue, Apr 02, 2019 at 11:28:43AM +0200, Petr Hoffmann wrote: > > Hi, > > > > seeing this in the manpage > > --8<-- > > +.It Fl F Cm Reset >

[patch] improve strptime(3) %z timezone parsing

2019-02-24 Thread Hiltjo Posthuma
Hi, I noticed some things in the strptime(3) implementing when parsing timezone strings using the %z format string. 1. I noticed the tm_gmtoff value is not correctly set in some cases. It should set tm_gmtoff to the offset from UTC in seconds (as described in mktime(3)). 2. The

Re: [patch] improve strptime(3) %z timezone parsing

2019-03-03 Thread Hiltjo Posthuma
On Sun, Feb 24, 2019 at 01:11:39PM +0100, Hiltjo Posthuma wrote: > Hi, > > I noticed some things in the strptime(3) implementing when parsing timezone > strings using the %z format string. > > 1. I noticed the tm_gmtoff value is not correctly set in some cases. It shou

Re: [patch] improve strptime(3) %z timezone parsing

2019-03-17 Thread Hiltjo Posthuma
On Sun, Mar 10, 2019 at 04:16:37PM -0400, Ted Unangst wrote: > Hiltjo Posthuma wrote: > > 2. The military/nautical UTC offsets are also reversed. This was also > > actually > > a bug in RFC822: > > > > RFC5322 (referenced in strptime(3) man page): > &

Re: Option for alternative escape character with cu(1)

2019-03-15 Thread Hiltjo Posthuma
On Fri, Mar 15, 2019 at 02:43:04PM +, Nicholas Marriott wrote: > . > Another couple of minor changes below, with those it looks good to > me. Any OK for this? > > > On Fri, Mar 15, 2019 at 01:49:52PM +0200, Artturi Alm wrote: > > On Thu, Mar 14, 2019 at 10:18:57AM +, Nicholas Marriott

Re: [patch] improve strptime(3) %z timezone parsing

2019-03-10 Thread Hiltjo Posthuma
On Sun, Mar 03, 2019 at 09:01:58PM +0100, Hiltjo Posthuma wrote: > On Sun, Feb 24, 2019 at 01:11:39PM +0100, Hiltjo Posthuma wrote: > > Hi, > > > > I noticed some things in the strptime(3) implementing when parsing timezone > > strings using the %z format st

[patch] (open)rsync small patch for whitespace fixes

2019-02-16 Thread Hiltjo Posthuma
Hi, Some trailing whitespace fixes for rsync. Patch below: diff --git usr.bin/rsync/extern.h usr.bin/rsync/extern.h index 1ea81ef47ea..221ec24f9b4 100644 --- usr.bin/rsync/extern.h +++ usr.bin/rsync/extern.h @@ -267,9 +267,9 @@ int rsync_client(const struct opts *, int, const struct

[patch] openrsync blk_flush() fd leak in blk_match()

2019-02-11 Thread Hiltjo Posthuma
Hi, I think the fd can leak when blk_flush() fails in blocks.c blk_match(), because ERR and ERRX1 does not to terminate. Am I correct? I also (hopefully) simplified the logic a bit (set nfd = -1 and goto out). Thanks for working on (open)rsync! Patch below: diff --git

Re: httpd.conf(5) man page

2019-02-02 Thread Hiltjo Posthuma
On Sat, Feb 02, 2019 at 12:20:03PM +0100, Daniel Gracia wrote: > Hi there! > > httpdd FastCGI interface can connect seamlessly to a local TCP port, > but this is not documented on the man page. > > Went to the source and found the syntax to be a little awkward (maybe > a quick fix?). Anyway,

Question about xenodm Xresources config default

2019-04-15 Thread Hiltjo Posthuma
Hi, I noticed in the default config file /etc/X11/xenodm/Xresources there is a rule: xlogin*login.translations: #override \ CtrlR: abort-display()\n\ [...] The xenodm(1) man page says: " abort-display Terminates the server, disabling it. This action is not

[patch] remove reference to HOSTALIASES in hostname(7)

2019-04-15 Thread Hiltjo Posthuma
Hi, I noticed the man page hostname(7) still references the environment variable HOSTALIASES. This functionality seems to be removed in the commit: https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/asr/asr.c?rev=1.50=text/x-cvsweb-markup Below is a patch to change it in the man page. I'm

[patch] rsync: fix free() on uninitialized pointer with -rx and same device

2019-06-03 Thread Hiltjo Posthuma
Hi, I noticed a free() issue on an uninitialized pointer on a certain condition. To reproduce: mkdir -p /tmp/test /tmp/plop openrsync -rx /tmp/test/ /tmp/plop/ Result: openrsync(3470) in free(): bogus pointer (double free?) 0x7f7dcdc8 Abort trap (core

Re: [patch] rsync: fix free() on uninitialized pointer with -rx and same device

2019-06-06 Thread Hiltjo Posthuma
On Thu, Jun 06, 2019 at 12:37:13AM +0200, Christian Weisgerber wrote: > Christian Weisgerber: > > > > To reproduce: > > > > > > mkdir -p /tmp/test /tmp/plop > > > openrsync -rx /tmp/test/ /tmp/plop/ > > > > > > Result: > > > > > > openrsync(3470) in free(): bogus pointer (double free?)

[patch] rsync: fix another double close socket descriptor

2019-06-02 Thread Hiltjo Posthuma
Hi, I noticed when using openrsync with a remote and a ssh_prog set (-e option) the socket is closed twice also. Reproducable with: ktrace openrsync -e echo -av rsync://127.0.0.1/ftp/ a kdump: 70262 openrsync CALL close(3) 70262 openrsync RET close 0 > 70262 openrsync CALL close(3) >

[patch] rsync: fix for closing uninitialized file descriptor

2019-05-28 Thread Hiltjo Posthuma
Hi, I noticed the following with the reproducable command: openrsync -av rsync://127.0.0.1/ftp/ a ktrace: -> 99882 openrsync CALL close(1249939456) -> 99882 openrsync RET close -1 errno 9 Bad file descriptor 99882 openrsync CALL kbind(0x7f7f7a50,24,0x281ae61c4bf1563c) 99882

Re: [patch] rsync: fix free() on uninitialized pointer with -rx and same device

2019-06-12 Thread Hiltjo Posthuma
On Thu, Jun 06, 2019 at 02:14:05PM +0200, Christian Weisgerber wrote: > Björn Ketelaars: > > > Diff below is based on the latest diff from naddy@. Changes: > > - reallocarray likes type_t, as such changes type of nxdev and i; > > - use reallocarray instead of malloc as xdev is initialised as

Re: [patch] rsync: fix free() on uninitialized pointer with -rx and same device

2019-06-21 Thread Hiltjo Posthuma
On Wed, Jun 12, 2019 at 06:58:31PM +0200, Hiltjo Posthuma wrote: > On Thu, Jun 06, 2019 at 02:14:05PM +0200, Christian Weisgerber wrote: > > Björn Ketelaars: > > > > > Diff below is based on the latest diff from naddy@. Changes: > > > - reallocarray likes type

Re: [patch] improve strptime(3) %z timezone parsing

2019-05-09 Thread Hiltjo Posthuma
On Thu, May 09, 2019 at 08:38:43PM +0200, Ingo Schwarze wrote: > Hi, > > Theo de Raadt wrote on Sun, Mar 24, 2019 at 12:48:03PM -0600: > > Hiltjo Posthuma wrote: > >> On Sun, Feb 24, 2019 at 01:11:39PM +0100, Hiltjo Posthuma wrote: > > >>&g

[patch] ftp: tiny typo in comment

2019-05-13 Thread Hiltjo Posthuma
Tiny typo in a fancy word :) Patch below: diff --git usr.bin/ftp/ftp.c usr.bin/ftp/ftp.c index afb6514efd7..5690f4dbfb9 100644 --- usr.bin/ftp/ftp.c +++ usr.bin/ftp/ftp.c @@ -343,7 +343,7 @@ ftp_eprt(FILE *fp) return -1; } - /* Find out the ephermal port chosen

Re: sysupgrade: select sets to install

2019-07-10 Thread Hiltjo Posthuma
On Tue, Jul 09, 2019 at 05:09:12PM +0200, Klemens Nanni wrote: > I think sysupgrade should, if at all, use the same semantics as the > installer. That is, something like `sysugprade -S '-* b*'" to upgrade > nothing but kernels and base. > > Such options offer great potential for users to shoot

[patch] openrsync: improve unveil(2) for multiple sources and also symlink behaviou

2019-06-29 Thread Hiltjo Posthuma
Hi, I've noticed an issue with openrsync and more than 1 source arguments and with it's symlink behaviour (separate issues). Reproduce: cd /tmp mkdir -p a b openrsync -av a/ b/ c/ Output: /usr/src/usr.bin/rsync/flist.c:823: error: b/: lstat: No such file or

Re: Questions about syspatch(8) mtree(8) behaviour

2019-09-03 Thread Hiltjo Posthuma
On Tue, Sep 03, 2019 at 08:51:09AM +0200, Antoine Jacoutot wrote: > On Mon, Sep 02, 2019 at 08:58:01PM +0200, Hiltjo Posthuma wrote: > > On Mon, Sep 02, 2019 at 12:07:59PM -0600, Theo de Raadt wrote: > > > Hiltjo Posthuma wrote: > > > > > > > Hi, > >

[patch] vmd: fix possible small memleak in vm_claimid() error path

2019-08-29 Thread Hiltjo Posthuma
Hi, This fixes a small possible memory leak in an error handling path in vmd.c vm_claimid(). diff --git usr.sbin/vmd/vmd.c usr.sbin/vmd/vmd.c index 654af5974d3..81be6b356d6 100644 --- usr.sbin/vmd/vmd.c +++ usr.sbin/vmd/vmd.c @@ -1197,6 +1197,7 @@ vm_claimid(const char *name, int uid, uint32_t

Questions about syspatch(8) mtree(8) behaviour

2019-09-02 Thread Hiltjo Posthuma
Hi, I have three questions regarding a behaviour of syspatch(8) with mtree(8). 1. I noticed when applying patches it resets some permissions of new, but also of existing directories on the system using mtree(8). In the shellscript syspatch(8) there is a function: trap_handler(): # in

Re: Questions about syspatch(8) mtree(8) behaviour

2019-09-02 Thread Hiltjo Posthuma
On Mon, Sep 02, 2019 at 12:07:59PM -0600, Theo de Raadt wrote: > Hiltjo Posthuma wrote: > > > Hi, > > > > I have three questions regarding a behaviour of syspatch(8) with mtree(8). > > > > 1. I noticed when applying patches it resets some permissions o

Re: fix rpki-client regress

2019-11-02 Thread Hiltjo Posthuma
On Sat, Nov 02, 2019 at 02:24:26PM +0100, Claudio Jeker wrote: > Refactor the TAL loading code a bit (move the file parsing back into > tal.c) and adjust the regress test to use this new function. This fixes > the regress test and makes the code a bit nicer. > > OK? > -- > :wq Claudio > >

Re: [patch] ftp: improve SMALL and NOSSL #ifdefs

2019-11-06 Thread Hiltjo Posthuma
On Wed, Nov 06, 2019 at 08:33:09PM +0100, Jan Klemkow wrote: > Hi Hiltjo, > > On Wed, Nov 06, 2019 at 07:53:02PM +0100, Hiltjo Posthuma wrote: > > The below patch fixes the #ifndef's for usr.bin/ftp so any combination of > > SMALL > > and NOSSL will compile again.

[patch] ftp: improve SMALL and NOSSL #ifdefs

2019-11-06 Thread Hiltjo Posthuma
Hi, The below patch fixes the #ifndef's for usr.bin/ftp so any combination of SMALL and NOSSL will compile again. Patch: diff --git usr.bin/ftp/fetch.c usr.bin/ftp/fetch.c index 4c7e14b04bd..15927471f1a 100644 --- usr.bin/ftp/fetch.c +++ usr.bin/ftp/fetch.c @@ -201,14 +201,14 @@ url_get(const

ripd: memory leak and double free/use-after-free

2019-12-10 Thread Hiltjo Posthuma
Hi, While looking at the code of ripd: I think there are (also) 2 small memleaks in a debug/error path (IMSG_REQUEST_ADD and IMSG_RESPONSE_ADD). It breaks out before adding the struct rip_route as an entry by the add_entry function (which adds it and adds a reference count) in the log_debug

[patch] ftp: disallow redirect and reading from file://

2019-12-18 Thread Hiltjo Posthuma
Hi, I noticed with the ftp program when downloading via HTTP or HTTPS it can be redirected to read from a local file directly. While testing using a CGI program that responds with the HTTP headers: Status: 301 Moved Permanently Location: file:///dev/urandom The patch below

Re: httpd: allow $REQUEST_SCHEME in redirect targets

2020-02-25 Thread Hiltjo Posthuma
On Tue, Feb 25, 2020 at 12:16:22PM +, Stuart Henderson wrote: > Sometimes you want to redirect a request to another site but maintaining > the same type of connection (http or https) as the original request. > Currently to do this in httpd you have to duplicate the whole server block > (once

Re: [patch] smtpd: fix for ctype casts

2020-02-24 Thread Hiltjo Posthuma
*ping* Any feedback for the below patch is appreciated. Thanks, On Sat, Feb 01, 2020 at 05:01:48PM +0100, Hiltjo Posthuma wrote: > Hi, > > This (pedantic) patch fixes a few casts for ctype functions/macros, like > isspace, isalpha and isdigit. > > The isspace(3) man page s

Re: [patch] signify's file name parsing broken

2020-01-26 Thread Hiltjo Posthuma
On Tue, Jan 21, 2020 at 05:22:17PM -0500, Ted Unangst wrote: > Ted Unangst wrote: > > MarcusMüller wrote: > > > I've just stumbled across a malfunction in signify: It cannot handle > > > file names that contain a `)` character, when checking a list of hashes > > > generated by `sha256` command

[patch] smtpd: fix for ctype casts

2020-02-01 Thread Hiltjo Posthuma
Hi, This (pedantic) patch fixes a few casts for ctype functions/macros, like isspace, isalpha and isdigit. The isspace(3) man page says: "CAVEATS The argument c must be EOF or representable as an unsigned char; otherwise, the result is undefined." POSIX says: "The c argument is an int, the

Re: ftp(1): separate file:/ URL handling

2019-12-30 Thread Hiltjo Posthuma
On Thu, Dec 26, 2019 at 10:53:45AM +0100, Jeremie Courreges-Anglas wrote: > On Thu, Dec 19 2019, Jeremie Courreges-Anglas wrote: > > A bit late... > > > > Move file: URL handling into its own function. This simplifies > > url_get() and would have prevented problems with bogus redirections. > > >

Re: [patch] smtpd: fix for ctype casts

2020-03-15 Thread Hiltjo Posthuma
On Tue, Feb 25, 2020 at 12:09:19AM +0100, Joerg Jung wrote: > > > On 24. Feb 2020, at 20:31, Todd C. Miller wrote: > > > > I have a mostly-identical patch in my tree, though I tried to improve > > readability a bit. > > ok jung@ > > > - todd > > > > Index: usr.sbin/smtpd/mta_session.c > >

Re: JSON support for bgpctl(8)

2020-05-01 Thread Hiltjo Posthuma
On Fri, May 01, 2020 at 01:18:03PM +0200, Claudio Jeker wrote: > This diff add JSON output support for bgpctl. > Most commands should produce now a resonable JSON object. > The individual objects can probably be improved and extended. > I'm at a point where I'm happy with the result and looking

Re: httpd(8): add a "dark mode" in directory listings and error pages

2020-05-11 Thread Hiltjo Posthuma
On Mon, May 11, 2020 at 11:20:58AM +0200, Charlene Wendling wrote: > Hi, > > Similarly to what has been done for the OpenBSD project pages [0], this > diff adds a "dark mode" to directory listings and error pages in httpd, > using OpenBSD's dark color scheme. > > The goal is to avoid switching

Ncurses: issue with "rep" capability and --enable-bsdpad (BSD_TPUTS)

2020-05-25 Thread Hiltjo Posthuma
ted as BSD-style padding when --enable-bsdpad is configured (report/patch by Hiltjo Posthuma)." A small program to reproduce it: #include #include #include int main(void) { WINDOW *win; win = initscr(); printw("Z000"); refresh();

Re: Port httpd(8) 'strip' directive to relayd(8)

2020-10-24 Thread Hiltjo Posthuma
On Sat, Oct 24, 2020 at 05:04:20PM +0200, Denis Fondras wrote: > The 'strip' directive from httpd(8) is useful when forwarding to another > server. > > This diff adds the feature to relayd(8). > > With : > > match request path "/server/*" tag psonoserver > match request tagged

Re: Port httpd(8) 'strip' directive to relayd(8)

2021-01-07 Thread Hiltjo Posthuma
On Sun, Jan 03, 2021 at 11:40:42AM +0100, Denis Fondras wrote: > Le Fri, Dec 11, 2020 at 10:53:56AM +, Olivier Cherrier a écrit : > > > > Hello tech@, > > > > Is there any interest for this feature to be commited? > > I find it very useful. Thank you Denis! > > > > Here is an up to

Re: Port httpd(8) 'strip' directive to relayd(8)

2021-01-07 Thread Hiltjo Posthuma
On Thu, Jan 07, 2021 at 04:56:14PM +0100, Denis Fondras wrote: > Le Thu, Jan 07, 2021 at 12:03:54PM +0100, Hiltjo Posthuma a écrit : > > Hi Denis, > > > > I like this feature. For example it would be useful for using relayd as a > > reverse-proxy to forward it to

Re: libcurses: don't return ERR if resize didn't change size

2021-01-21 Thread Hiltjo Posthuma
On Thu, Jan 21, 2021 at 11:06:05AM -0700, Todd C. Miller wrote: > This is a backport of the ncurses 5.9 20120707 patch. > https://github.com/mirror/ncurses/commit/471bc007361fd4bc8d2fae060c7d5b09828ed541 > > Previously, getch() would return ERR if SIGWINCH was received but > the window didn't

Re: ftp: make use of getline(3)

2021-01-29 Thread Hiltjo Posthuma
On Fri, Jan 29, 2021 at 07:22:11PM +0100, Christian Weisgerber wrote: > Make use of getline(3) in ftp(1). > > Replace fparseln(3) with getline(3). This removes the only use > of libutil.a(fparseln.o) from the ramdisk. > Replace a complicated fgetln(3) idiom with the much simpler getline(3). > >

Re: ftp: make use of getline(3)

2021-01-30 Thread Hiltjo Posthuma
On Sat, Jan 30, 2021 at 12:22:04AM +0100, Christian Weisgerber wrote: > Hiltjo Posthuma: > > > > @@ -75,19 +74,8 @@ cookie_load(void) > > > if (fp == NULL) > > > err(1, "cannot open cookie file %s", cookiefile); > > > date = t

Re: ftp: make use of getline(3)

2021-01-30 Thread Hiltjo Posthuma
On Sat, Jan 30, 2021 at 11:57:01AM +0100, Claudio Jeker wrote: > On Sat, Jan 30, 2021 at 11:52:15AM +0100, Hiltjo Posthuma wrote: > > On Sat, Jan 30, 2021 at 12:22:04AM +0100, Christian Weisgerber wrote: > > > Hiltjo Posthuma: > > > > > > >

Re: patch: make ld.so aware of pthread_key_create destructor - Re: multimedia/mpv debug vo=gpu crash on exit

2021-05-06 Thread Hiltjo Posthuma
On Thu, May 06, 2021 at 09:32:28AM +0200, Sebastien Marie wrote: > Hi, > > Anindya, did a good analysis of the problem with mpv using gpu video > output backend (it is using EGL and mesa if I correctly followed). > > > For people not reading ports@ here a resume: the destructor function > used

Re: ssh(1) -v gives debug1: pledge: filesystem full

2021-05-20 Thread Hiltjo Posthuma
On Thu, May 20, 2021 at 12:15:54PM +0200, Marcus MERIGHI wrote: > Hello Hiltjo, > > thanks for looking further than I did... > > Moving to tech@... > > hil...@codemadness.org (Hiltjo Posthuma), 2021.05.19 (Wed) 16:59 (CEST): > > On Wed, May 19, 2021 at 01:20:34PM

btrace: fflush(stdout) after printf

2021-05-05 Thread Hiltjo Posthuma
Hi, Thanks for the wonderful work on dt(4) and the btrace tool. I noticed while using the btrace program: btrace -e 'tracepoint:uvm:malloc { printf("%s[%d]: malloc(%d)\n", comm, pid, arg0); }' | \ grep -v Xorg The output of btrace is unbuffered and grep does not filter the line, until

  1   2   >