Re: update logging in ifstated

2017-06-12 Thread Sebastian Benoit
Rob Pierce(r...@2keys.ca) on 2017.06.11 18:04:31 -0400: > This minimizes differences with the latest log.c. > > I was not sure how to handle verbosity, as the current implementation is > verbose by default in debug mode. The diff below requires actually > requesting (double) verbosity on the comma

Re: [patch] Use readpassphrase in ikectl

2017-06-12 Thread Matthew Martin
On Thu, Jun 08, 2017 at 10:33:07PM +1000, Jonathan Gray wrote: > On Fri, May 19, 2017 at 12:35:44AM -0500, Matthew Martin wrote: > > While making the last patch, I noticed ikectl uses getpass. Use > > readpassphrase instead and explicit_bzero the buffers. > > > > - Matthew Martin > > What is the

Re: [patch] Avoid system(3) in ikectl

2017-06-12 Thread Matthew Martin
On Thu, Jun 08, 2017 at 10:39:08PM +1000, Jonathan Gray wrote: > This would be simpler if the 'run' style function just took a NULL > terminated array. Closer to how other things work and could then > be passed directly to an exec call. Like so? Not sure if the indentation is correct or if it's

Re: KARL - kernel address randomized link

2017-06-12 Thread Theo de Raadt
For those who are curious, here is the surprisingly small diff. No C code. Perhaps in the future some valient soul will add a linker to the bootblocks, and we can boot a "bsd.a" file. For now this mechanism is easier; we can take a shot at adding KVA and KPA ASLR to the mix on a per-arch basis.

KARL - kernel address randomized link

2017-06-12 Thread Theo de Raadt
Over the last three weeks I've been working on a new randomization feature which will protect the kernel. The situation today is that many people install a kernel binary from OpenBSD, and then run that same kernel binary for 6 months or more. We have substantial randomization for the memory alloc

Re: ksh(1): custom completion for command containing hyphens

2017-06-12 Thread Klemens Nanni
On Fri, Jun 02, 2017 at 05:07:42PM +0200, Anton Lindqvist wrote: Custom completions in ksh is currently limited to commands that does not contain hyphens since such a character cannot be part of an identifier. We could cheat and replace hyphens with underscores upon performing completions. The mo

Re: pfctl: make functions return void, merge two ifs

2017-06-12 Thread Adam Wolk
On Mon, Jun 12, 2017 at 11:43:44PM +0200, Alexandr Nedvedicky wrote: > Hello Adam, > > > > > It was a rainy evening here, so here's the updated pfctl diff. > > I'm sorry to hear about the rainy weather [1]. > anyway, you might want to run regression test for pfctl. > > cd $SRC/sr

Re: pfctl: make functions return void, merge two ifs

2017-06-12 Thread Alexandr Nedvedicky
Hello Adam, > It was a rainy evening here, so here's the updated pfctl diff. I'm sorry to hear about the rainy weather [1]. anyway, you might want to run regression test for pfctl. cd $SRC/src/regress/sbin/pfctl cat Makefile # follow instructions just for s

savecore: use openat() and fstatat()

2017-06-12 Thread Todd C. Miller
Also use syslog's %m format instead of %s + strerror(). We can't use devname() because the database file may be out of date and savecore runs early in the boot sequence. - todd Index: sbin/savecore/savecore.c === RCS file: /cvs/src

Re: pfctl: make functions return void, merge two ifs

2017-06-12 Thread Adam Wolk
On Mon, Jun 12, 2017 at 01:59:07PM +0200, Mike Belopuhov wrote: > On Sun, Jun 11, 2017 at 15:03 +0100, Raymond wrote: > > Transform the following functions (which never return anything other than > > 0, and whose return value is never used) to void: > > > > * pfctl_clear_stats, pfctl_clear_interf

badsect: use devname()

2017-06-12 Thread Todd C. Miller
I started to convert this to openat() when I realized it should just use devname() instead. This should never fail since it operates on a mounted file system (and devname() will fall back to trawling /dev anyway if it needs to). I also changed a QUAD_MAX to INT64_T since daddr_t is int64_t. - t

Re: games/fortune: /usr/games/lib doesn't exist

2017-06-12 Thread Michal Mazurek
On 18:50:26, 12.06.17, Jason McIntyre wrote: > On Mon, Jun 12, 2017 at 07:13:43PM +0200, Michal Mazurek wrote: > > Can't have outdated paths in fortunes. > > > > OK? > > > > Index: games/fortune//datfiles/fortunes2 > > === > > RCS fi

locate/mklocatedb.sh: remove unused option

2017-06-12 Thread Michal Mazurek
This script has an option called -presort or -nosort, that appears to never be used, so remove it. This makes the $sort* options unneeded, remove them too. The script itself is used by updatedb and pkg_mklocatedb. Comments? OK? Index: usr.bin/locate/locate/mklocatedb.sh =

Re: Copying a file on msdos FS (fat32) changes content

2017-06-12 Thread Jacqueline Jolicoeur
> Please try if the attached patch fixes the problem. It reverts a likely > culprit. I sent my last email before I saw your patch. The patch resolves the issue for me. Thanks.

Re: Copying a file on msdos FS (fat32) changes content

2017-06-12 Thread Jacqueline Jolicoeur
> After upgrading to the latest snapshot there seems to be something wrong > with the msdos filesystem driver. When I copy a binary file on a msdos > (fat32) mounted partition the content changes e.g.: I seem to get similar results. It is consistent at char 4097 with every test. # mount /dev/sd2i

Re: locate: remove /usr/libexec/locate.concatdb

2017-06-12 Thread Todd C. Miller
Fine with me. OK millert@ - todd

Re: Copying a file on msdos FS (fat32) changes content

2017-06-12 Thread Stefan Fritsch
On Mon, 12 Jun 2017, Martijn Rijkeboer wrote: > After upgrading to the latest snapshot there seems to be something wrong > with the msdos filesystem driver. When I copy a binary file on a msdos (fat32) > mounted partition the content changes e.g.: > > # cp refind_x64.efi bootx64.efi > # ls -l

locate: remove /usr/libexec/locate.concatdb

2017-06-12 Thread Michal Mazurek
This file never sets the $locate variable, which means it's broken. There are some non-trivial patches to this file, but that happened because the same diffs were applied to another script in those commits. This is broken since 1996. FreeBSD fixed it, but since nobody complained for 21 years, perh

Re: games/fortune: /usr/games/lib doesn't exist

2017-06-12 Thread Jason McIntyre
On Mon, Jun 12, 2017 at 07:13:43PM +0200, Michal Mazurek wrote: > Can't have outdated paths in fortunes. > > OK? > > Index: games/fortune//datfiles/fortunes2 > === > RCS file: /cvs/src/games/fortune/datfiles/fortunes2,v > retrieving

printf(3): add dprintf/vdprintf to RETURN VALUES

2017-06-12 Thread Todd C. Miller
We neglected to add dprintf/vdprintf to RETURN VALUES when they were added to the manual. - todd Index: lib/libc/stdio/printf.3 === RCS file: /cvs/src/lib/libc/stdio/printf.3,v retrieving revision 1.75 diff -u -p -u -r1.75 printf.3

games/fortune: /usr/games/lib doesn't exist

2017-06-12 Thread Michal Mazurek
Can't have outdated paths in fortunes. OK? Index: games/fortune//datfiles/fortunes2 === RCS file: /cvs/src/games/fortune/datfiles/fortunes2,v retrieving revision 1.46 diff -u -p -r1.46 fortunes2 --- games/fortune//datfiles/fortunes2

games/hunt: /usr/games/lib doesn't exist

2017-06-12 Thread Michal Mazurek
It's very important to keep this README up to date. OK? Index: games/hunt//README === RCS file: /cvs/src/games/hunt/README,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 README --- games/hunt//README 21 Jan 1999 05:33:37 -

vi: use openat() in recovery mode

2017-06-12 Thread Todd C. Miller
Use openat() and unlinkat() instead of chdir(). The path in the .recover file is absolute and not relative so the existing stat() is fine. Also, since our vi always uses flock(), not fcntl locking, we can open recovery read-only. - todd Index: usr.bin/vi/common/recover.c ==

Re: sppp(4)/pppoe(4) dynamic address hack

2017-06-12 Thread Stefan Sperling
On Mon, Jun 12, 2017 at 02:59:46PM +0100, Stuart Henderson wrote: > This seems the "least worst" option to me. (It's still racy, the > connection could come up and change the dest before the route is > added, so route addition would fail as we now require a "correct" > address on the p-p route addi

Re: sppp(4)/pppoe(4) dynamic address hack

2017-06-12 Thread Stuart Henderson
On 2017/06/12 15:46, Stefan Sperling wrote: > On Sat, Jun 10, 2017 at 06:14:02PM +0200, Martin Pieuchot wrote: > > There's no need to fix the routing table, we could something like: > > > > - if (hisaddr == 1) { > > + if (hisaddr < 10) { > > > > Now I think you have a good poi

Re: sppp(4)/pppoe(4) dynamic address hack

2017-06-12 Thread Theo de Raadt
> > What about reusing the 'autoconf' toggle? Could we say: > > > > # ifconfig pppoe0 inet autoconf > > > > Instead of introducing 'dynaddr' and 'dyndest'? > > 'autoconf' is already used in a context where no addresses are configured > yet (apart from the mandatory link-local ones, which do

Re: sppp(4)/pppoe(4) dynamic address hack

2017-06-12 Thread Stefan Sperling
On Sat, Jun 10, 2017 at 06:14:02PM +0200, Martin Pieuchot wrote: > There's no need to fix the routing table, we could something like: > > - if (hisaddr == 1) { > + if (hisaddr < 10) { > > Now I think you have a good point that using a flag is better than a > magic address

Re: pfctl: make functions return void, merge two ifs

2017-06-12 Thread Mike Belopuhov
On Sun, Jun 11, 2017 at 15:03 +0100, Raymond wrote: > Transform the following functions (which never return anything other than 0, > and whose return value is never used) to void: > > * pfctl_clear_stats, pfctl_clear_interface_flags, pfctl_clear_rules, > pfctl_clear_src_nodes, pfctl_clear_states

Re: pfctl: make functions return void, merge two ifs

2017-06-12 Thread Adam Wolk
On Sun, Jun 11, 2017 at 03:03:56PM +0100, Raymond wrote: > Transform the following functions (which never return anything other than 0, > and whose return value is never used) to void: > > * pfctl_clear_stats, pfctl_clear_interface_flags, pfctl_clear_rules, > pfctl_clear_src_nodes, pfctl_clear_s

Copying a file on msdos FS (fat32) changes content

2017-06-12 Thread Martijn Rijkeboer
Hi, After upgrading to the latest snapshot there seems to be something wrong with the msdos filesystem driver. When I copy a binary file on a msdos (fat32) mounted partition the content changes e.g.: # cp refind_x64.efi bootx64.efi # ls -l refind_x64.efi bootx64.efi -rw-r--r-- 1 root w