Re: add uid_from_user/gid_from_group [1/3]

2018-09-12 Thread Philip Guenther
On Wed, 12 Sep 2018, Todd C. Miller wrote: > Thanks for the feedback, here's an updated diff that eliminates > pwcache.h, gracefully handles table allocation failure and massages the > comments to be a bit more general. > > I can take a look at supporting arbitrary length names in the future. o

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Michael Mikonos
On Wed, Sep 12, 2018 at 11:33:11AM -0700, Ori Bernstein wrote: > On Wed, 12 Sep 2018 15:36:32 +0800 > Michael Mikonos wrote: > > > On Wed, Sep 12, 2018 at 12:13:35AM -0700, Ori Bernstein wrote: > > > On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein > > > wrote: > > > > > > > static ssize_t >

pcb refcount

2018-09-12 Thread Alexander Bluhm
Hi, When I tried to add a lock to the inet pcb, I realized that we have to do reference counting. Start with the obvious cases. An inp can be referenced by the PCB queue and hashes, by a pf mbuf header, or by a pf state key. ok? bluhm Index: kern/uipc_mbuf.c ==

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Ori Bernstein
On Wed, 12 Sep 2018 15:36:32 +0800 Michael Mikonos wrote: > On Wed, Sep 12, 2018 at 12:13:35AM -0700, Ori Bernstein wrote: > > On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein > > wrote: > > > > > static ssize_t > > > @@ -362,8 +377,9 @@ qc2_close(void *p) > > > struct qcdisk *disk; > > >

Re: fdformat: reformat usage()

2018-09-12 Thread d . rauschenb
Hi, > unrelated question: anyone know why the argument to -g is "gap3len"? The gap between the sectors. More info at https://en.wikipedia.org/wiki/Floppy_disk_format#Sectoring -dra

Re: fdformat: reformat usage()

2018-09-12 Thread Sascha Paunovic
On Wed, Sep 12, 2018 at 05:40:49PM +0100, Jason McIntyre wrote: > hi. > > i'm all for the diff but... generally usage() does not spit out a > description of the options (with some exceptions). if you look at the > man page, the irony is that the usage seems more verbose. > > anyone object to remo

Re: pfctl: prevent modifying internal anchors through their tables

2018-09-12 Thread Stuart Henderson
On 2018/09/12 17:38, Jason McIntyre wrote: > On Wed, Sep 12, 2018 at 02:05:25PM +0200, Alexander Bluhm wrote: > > > > > + warnx("anchors apply to -f, -F, -t and -s only"); > > > > If I understand English comma rules correctly, there is also a comma > > before the " and". At least

Re: fdformat: reformat usage()

2018-09-12 Thread Jason McIntyre
On Wed, Sep 12, 2018 at 11:50:18AM +0200, Sascha Paunovic wrote: > Since C99, string literal concatenation is provided, allowing the number > of printf() calls to be greatly reduced (20 -> 1). > > This is my first diff I'm sending, feedback would be very appreciated. > hi. i'm all for the diff

Re: pfctl: prevent modifying internal anchors through their tables

2018-09-12 Thread Jason McIntyre
On Wed, Sep 12, 2018 at 02:05:25PM +0200, Alexander Bluhm wrote: > > > + warnx("anchors apply to -f, -F, -t and -s only"); > > If I understand English comma rules correctly, there is also a comma > before the " and". At least this is what we do in the man page. > > bluhm > h

Re: add uid_from_user/gid_from_group [1/3]

2018-09-12 Thread Todd C. Miller
Thanks for the feedback, here's an updated diff that eliminates pwcache.h, gracefully handles table allocation failure and massages the comments to be a bit more general. I can take a look at supporting arbitrary length names in the future. - todd Index: include/pwd.h ==

Re: [patch] Fix file descriptor leak in nohup.c

2018-09-12 Thread Alexander Bluhm
On Sun, Sep 09, 2018 at 11:13:40AM +0800, Nan Xiao wrote: > Honestly, I am still a little confused: Let's explain more context. Recently I found some deamons that accidently closed stdin, so I am sensible for this kind of error. nohup(1) tries to use nohup.out for stdout or stderr in some cases.

Re: add missing break on kern_pledge.c

2018-09-12 Thread Sebastien Marie
On Wed, Sep 12, 2018 at 10:56:19AM +0100, Ricardo Mestre wrote: > Hi, > > When unveil(2) was introduced one break from SYS_stat case was removed on > kern_pledge.c, this adds it back. Noticed by Coverity 1471854. > > OK? the removal was introduced by 1.236 on Jul 13, 2018 - https://cvsweb.openb

Re: pfctl: prevent modifying internal anchors through their tables

2018-09-12 Thread Alexander Bluhm
On Tue, Sep 11, 2018 at 12:17:05PM +0200, Klemens Nanni wrote: > Now `t' under the anonymous anchors (internally named "_1") must not be > modified through pfctl: > > # pfctl -a _1 -t t -T flush > 0 addresses deleted. Why do you think that this semantic is wrong? Why should tables wi

Re: pfctl: avoid unneeded variable in gen_dynnode()

2018-09-12 Thread Alexander Bluhm
On Wed, Sep 12, 2018 at 12:02:02AM +0200, Klemens Nanni wrote: > OK? OK bluhm@ > Index: pfctl_parser.c > === > RCS file: /cvs/src/sbin/pfctl/pfctl_parser.c,v > retrieving revision 1.336 > diff -u -p -r1.336 pfctl_parser.c > --- pfctl

Re: pcb inet6ctlerrmap

2018-09-12 Thread Claudio Jeker
On Wed, Sep 12, 2018 at 01:08:35PM +0200, Alexander Bluhm wrote: > On Wed, Sep 12, 2018 at 09:01:41AM +0200, Claudio Jeker wrote: > > Why u_char instead of int? The errors in that list are used in errno which > > is an int. So my usual feeling is to use the type which is naturally used > > and don'

Re: pcb inet6ctlerrmap

2018-09-12 Thread Alexander Bluhm
On Wed, Sep 12, 2018 at 09:01:41AM +0200, Claudio Jeker wrote: > Why u_char instead of int? The errors in that list are used in errno which > is an int. So my usual feeling is to use the type which is naturally used > and don't try to optimize for space. Basically I want to have it the same for in

add missing break on kern_pledge.c

2018-09-12 Thread Ricardo Mestre
Hi, When unveil(2) was introduced one break from SYS_stat case was removed on kern_pledge.c, this adds it back. Noticed by Coverity 1471854. OK? Index: kern_pledge.c === RCS file: /cvs/src/sys/kern/kern_pledge.c,v retrieving revisio

Re: slow vim and malloc

2018-09-12 Thread Stuart Henderson
On 2018/09/12 12:49, Manolis Tzanidakis wrote: > Hello Stuart, > > On Wed (06/06/18), Stuart Henderson wrote: > > I've been finding vim with my standard settings really slow on OpenBSD. > > It's been bugging me for a while, but it just took about 1.2s to open > > and display a 20k patch, which was

fdformat: reformat usage()

2018-09-12 Thread Sascha Paunovic
Since C99, string literal concatenation is provided, allowing the number of printf() calls to be greatly reduced (20 -> 1). This is my first diff I'm sending, feedback would be very appreciated. diff --git usr.sbin/fdformat/fdformat.c usr.sbin/fdformat/fdformat.c index c2566992e..2d6afbd3f 100644

Re: slow vim and malloc

2018-09-12 Thread Manolis Tzanidakis
Hello Stuart, On Wed (06/06/18), Stuart Henderson wrote: > I've been finding vim with my standard settings really slow on OpenBSD. > It's been bugging me for a while, but it just took about 1.2s to open > and display a 20k patch, which was bad enough to make me dig into it > again. Try this: set

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Michael Mikonos
On Wed, Sep 12, 2018 at 12:13:35AM -0700, Ori Bernstein wrote: > On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein wrote: > > > static ssize_t > > @@ -362,8 +377,9 @@ qc2_close(void *p) > > struct qcdisk *disk; > > > > disk = p; > > - pwrite(disk->fd, disk->l1, disk->l1sz, disk->l1of

Re: vmd: add some NULL checks after {c,m}alloc()

2018-09-12 Thread Ori Bernstein
On Tue, 11 Sep 2018 23:29:53 -0700, Ori Bernstein wrote: > static ssize_t > @@ -362,8 +377,9 @@ qc2_close(void *p) > struct qcdisk *disk; > > disk = p; > - pwrite(disk->fd, disk->l1, disk->l1sz, disk->l1off); > - close(disk->fd); > + if (disk->base) > + qc2_

Re: pcb inet6ctlerrmap

2018-09-12 Thread Claudio Jeker
On Tue, Sep 11, 2018 at 06:12:03PM +0200, Alexander Bluhm wrote: > On Sun, Sep 09, 2018 at 09:53:59PM +0200, Alexander Bluhm wrote: > > My goal is to get in6_pcb and in_pcb in sync. > > > > Let's make both inetctlerrmap and inet6ctlerrmap u_char. That is > > what FreeBSD does. There it is also i