Re: netcat: IPv6 address support for proxy

2017-02-04 Thread Klemens Nanni
On Sun, Feb 05, 2017 at 12:27:19AM +0100, Jeremie Courreges-Anglas wrote: The colons used in IPv6 addresses conflicts with the proxy port specification. Do the right thing for -x ::1:8080, [::1] and [::1]:8080. With this patch '-x ::1' is still broken. I think we should either require/enforce

ssh_config.5: Remove ambigious dot

2017-02-27 Thread Klemens Nanni
no is the default, not (yes or no). diff --git a/usr.bin/ssh/ssh_config.5 b/usr.bin/ssh/ssh_config.5 index 016adbc7343..799af3a4190 100644 --- a/usr.bin/ssh/ssh_config.5 +++ b/usr.bin/ssh/ssh_config.5 @@ -1147,7 +1147,7 @@ However, this option disables host authentication for localhost. The

Re: pfctl: Fix function name in errx(3) message

2017-03-27 Thread Klemens Nanni
On Mon, Mar 27, 2017 at 07:39:09PM +0200, Sebastian Benoit wrote: i commited a err(1, "calloc") instead. What about the other calls to calloc(3); shouldn't we keep their respective error messages consistent?

pfctl: Fix function name in errx(3) message

2017-03-25 Thread Klemens Nanni
Index: pfctl.c === RCS file: /cvs/src/sbin/pfctl/pfctl.c,v retrieving revision 1.338 diff -u -p -r1.338 pfctl.c --- pfctl.c 26 Jan 2017 08:24:34 - 1.338 +++ pfctl.c 25 Mar 2017 11:37:01 - @@ -753,7 +753,7 @@

ifconfig.8: Small improvement, typofix

2017-04-04 Thread Klemens Nanni
Hey, blocknonip's description is a tad clearer that way, the rest is mostly cosmetical but still. Index: sbin/ifconfig/ifconfig.8 === RCS file: /cvs/src/sbin/ifconfig/ifconfig.8,v retrieving revision 1.280 diff -u -p -r1.280

sysctl.3: Fix file path

2017-04-13 Thread Klemens Nanni
Index: lib/libc/gen/sysctl.3 === RCS file: /cvs/src/lib/libc/gen/sysctl.3,v retrieving revision 1.277 diff -u -p -r1.277 sysctl.3 --- lib/libc/gen/sysctl.3 16 Mar 2017 14:57:15 - 1.277 +++ lib/libc/gen/sysctl.3

sshd: Remove authorized_keys2 file

2017-04-17 Thread Klemens Nanni
Now that protocol version 1 was finally dropped in sshd(8), get rid of this file completely. Our default sshd_config(5) overwrites AuthorizedKeysFile to ignore it anyway and sshd(8)'s FILES section doesn't mention it either. Index: etc/changelist

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-14 Thread Klemens Nanni
On Mon, Aug 14, 2017 at 11:21:03AM -0400, Ted Unangst wrote: > Klemens Nanni wrote: > > > + case 'z': > > > + autoaction = AUTO_SUSPEND; > > > + autolimit = strtonum(optarg, 1, 100, ); > > &g

Re: [patch] Add -z and -Z to apmd for automatic suspend/hibernate

2017-08-14 Thread Klemens Nanni
On Sun, Aug 13, 2017 at 02:13:42PM +0200, Jesper Wallin wrote: > On Sun, Aug 13, 2017 at 09:52:22AM +0200, Martijn van Duren wrote: > > I've also been bitten by this a couple of times, but you can also solve > > this via the sensorsd framework, which is how I've done it. > > Yeah, someone on IRC

Re: rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-17 Thread Klemens Nanni
On Mon, Jul 17, 2017 at 11:57:02AM +0300, Vadim Zhukov wrote: > > + for _liba in /usr/lib/lib{c,crypto}; do > > + _libas="$_libas $(ls $_liba.so.+([0-9.]).a | sort -V | tail > > -1)" > > done > > + _libas=${_libas# } > > > > # Remount read-write, if

Re: rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-17 Thread Klemens Nanni
On Mon, Jul 17, 2017 at 02:14:26PM +0300, Vadim Zhukov wrote: > 2017-07-17 14:03 GMT+03:00 Klemens Nanni <k...@posteo.org>: > > On Mon, Jul 17, 2017 at 11:57:02AM +0300, Vadim Zhukov wrote: > >> > + for _liba in /usr/lib/lib{c,crypto}; do > >> > +

Re: rc: reorder_libs: [1/2] Drop unused _l, exit early on failure

2017-07-17 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 09:09:44AM +, Robert Peichaer wrote: > The rationale to picking the library versions before remounting was > to keep the time window having rw /usr as small as possible. > If that's deemed ok, I'm too OK with switching the steps. Considering the fact that the now

Re: rc: Use here document for temporary pf rule set

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 12:41:09PM +, Robert Peichaer wrote: > On Sun, Jul 16, 2017 at 02:28:59PM +0200, Klemens Nanni wrote: > > On Sun, Jul 16, 2017 at 12:11:55PM +, Robert Peichaer wrote: > > > On Sun, Jul 16, 2017 at 01:37:56PM +0200, Klemens Nanni wrote: > > &

Re: rc: Use here document for temporary pf rule set

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 03:24:19PM +0200, Klemens Nanni wrote: > + print -- "$RULES" | pfctl -nf - That should be 'pfctl -ef -' of course.

rc: Use here document for temporary pf rule set

2017-07-16 Thread Klemens Nanni
This removes on level of indent, avoids the ugly RULES="$RULES ..." repitition and spares a print. We could do a 'pfctl -ef -' right away but I kept changing and enabling clearly seperated. Regarding the leading newlines and tabs of the inner echo: pf perfectly munges those, no need to clear

Re: rc: Use here document for temporary pf rule set

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 12:11:55PM +, Robert Peichaer wrote: > On Sun, Jul 16, 2017 at 01:37:56PM +0200, Klemens Nanni wrote: > > This removes on level of indent, avoids the ugly RULES="$RULES ..." > > repitition and spares a print. > > > > We could do

Re: rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 10:26:25AM +, Robert Peichaer wrote: > On Sun, Jul 16, 2017 at 03:37:15AM +0200, Klemens Nanni wrote: > > Why looping over all existing archives, picking the latest version of > > the current archive, skipping it in case it's already in our list of >

Re: rc: reorder_libs: [1/2] Drop unused _l, exit early on failure

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 07:18:00AM +0200, Theo Buehler wrote: > On Sun, Jul 16, 2017 at 03:34:07AM +0200, Klemens Nanni wrote: > > $_l is not used and picking the latest archive versions is of no use > > if /usr/lib cannot be written to. > > > > This patch applies

Re: rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 11:55:09AM +, Robert Peichaer wrote: > To the contrary what my previous answer might indicate, I don't care > that much either. If you want to explicitely remove the blank, go for > it. Most problems I ever encountered while writing shell code were related to (nested)

rc: Use IFS when looking for carp interfaces

2017-07-17 Thread Klemens Nanni
The Internal Field Seperator is meant for this so use it instead of reading and stripping ':' again. Feedback? Comments? Index: rc === RCS file: /cvs/src/etc/rc,v retrieving revision 1.508 diff -u -p -r1.508 rc --- rc 17 Jul 2017

Re: tee: Replace hand-rolled list with SLIST_*

2017-07-10 Thread Klemens Nanni
On Mon, Jul 10, 2017 at 07:49:10PM +0200, Alexander Bluhm wrote: > On Sun, Jul 02, 2017 at 04:29:39AM +0200, Klemens Nanni wrote: > > No functional change or bugfix but queue(3) is the for a reason. That > > way the code even is a tad clearer to me (and two lines shorter). >

intel.4: Typofix

2017-07-17 Thread Klemens Nanni
Add missing verb and period. Index: driver/xf86-video-intel/man/intel.man === RCS file: /cvs/xenocara/driver/xf86-video-intel/man/intel.man,v retrieving revision 1.9 diff -u -p -r1.9 intel.man ---

Re: intel.4: Typofix

2017-07-18 Thread Klemens Nanni
On Mon, Jul 17, 2017 at 10:38:22PM -0400, Bryan Steele wrote: > This is an upstream Xorg manual. > > https://lists.x.org/mailman/listinfo/xorg-devel Reported upstream, thanks.

innovations: Typofix

2017-07-09 Thread Klemens Nanni
Is tech@ the right place for www diffs? Index: innovations.html === RCS file: /cvs/www/innovations.html,v retrieving revision 1.51 diff -u -p -r1.51 innovations.html --- innovations.html3 Jul 2017 23:47:21 - 1.51 +++

Re: install.sub: Fix scrambled address list in v6_defroute()

2017-07-09 Thread Klemens Nanni
On Wed, Jun 14, 2017 at 03:00:11AM +0200, Klemens Nanni wrote: > Installing -current the other day showed a broken list when picking > the IPv6 default route just like reported on bugs@ five days ago[1]. 1: http://marc.info/?l=openbsd-bugs=149704197715791 > > This behaviour can b

Re: rc: Use here document for temporary pf rule set

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 08:15:38PM +, Robert Peichaer wrote: > > + ifconfig lo0 inet6 >/dev/null 2>&1 && > > Please leave the if-then-fi construct intact. This short form is > mostly used for on-line commands (with only a few exceptions). OK. > > + RULES="$RULES"' > > What is

Re: rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-16 Thread Klemens Nanni
On Sun, Jul 16, 2017 at 10:26:25AM +, Robert Peichaer wrote: > But I'd like to stay strict matching the filenames. > > + for _liba in /usr/lib/lib{c,crypto}; do > + _libas="$_libas $(ls $_liba.so.+([0-9.]).a | sort -V | tail -1)" > + done > > > + _libas=${_libas# }

rc: reorder_libs: [1/2] Drop unused _l, exit early on failure

2017-07-15 Thread Klemens Nanni
$_l is not used and picking the latest archive versions is of no use if /usr/lib cannot be written to. This patch applies cleanly before my next one but not vice versa. Feedback? OK? Index: rc === RCS file: /cvs/src/etc/rc,v

rc: reorder_libs: [2/2] Pick archive versions more efficiently

2017-07-15 Thread Klemens Nanni
Why looping over all existing archives, picking the latest version of the current archive, skipping it in case it's already in our list of selected latest versions or adding it otherwise? The current code runs ls|sort|tail about n * (v - 1) times for n different libraries and v versions

Re: magic.5: Add missing types

2017-07-25 Thread Klemens Nanni
On Mon, Jul 03, 2017 at 05:36:52PM +0100, Nicholas Marriott wrote: > Hi > > On Thu, Jun 29, 2017 at 09:29:57PM +0200, Klemens Nanni wrote: > > While reading file(1)'s code in #openbsd-daily mulander noted that the > > 'name' and 'use' types were missing from magic(5). >

Re: magic.5: Add missing types

2017-07-25 Thread Klemens Nanni
On Tue, Jul 25, 2017 at 09:43:48PM +0100, Stuart Henderson wrote: > On 2017/07/25 20:57, Klemens Nanni wrote: > > I didn't touch the manual's first sentence mentioning file(1)'s version > > since nicm@ reimplemented file(1) with revision 1.11 on 2015/04/24. He > > or someone e

calendar: Remove support for non-UTF-8 locales

2017-07-25 Thread Klemens Nanni
5.9 is out, KOI8 isn't supported anymore. Index: io.c === RCS file: /cvs/src/usr.bin/calendar/io.c,v retrieving revision 1.44 diff -u -p -r1.44 io.c --- io.c31 Aug 2016 09:38:47 - 1.44 +++ io.c25 Jul 2017

Re: calendar: Remove support for non-UTF-8 locales

2017-07-25 Thread Klemens Nanni
On Tue, Jul 25, 2017 at 11:56:42PM +0200, Theo Buehler wrote: > On Tue, Jul 25, 2017 at 11:38:59PM +0200, Klemens Nanni wrote: > > 5.9 is out, KOI8 isn't supported anymore. > > It's at least the third time I see this diff. Pretty sure that Jan Stary > sent the same quite a w

Re: kill: Use __dead, declare functions static

2017-07-24 Thread Klemens Nanni
On Mon, Jul 24, 2017 at 06:11:32PM -0400, Ted Unangst wrote: > Klemens Nanni wrote: > > usage() never returns, all functions are to be used within this unit > > only. > > > > Since changes are conflicting, I'll wait for this diff first, but I'd > > like to

Re: kill: Use __dead, declare functions static

2017-07-24 Thread Klemens Nanni
On Mon, Jul 24, 2017 at 03:27:05PM -0600, Theo de Raadt wrote: > this addiction to static is entirely pointless. Consider it a matter of taste and leave it out, then. I assume you're fine with __dead, though? Index: kill.c === RCS

kill: Use __dead, declare functions static

2017-07-24 Thread Klemens Nanni
usage() never returns, all functions are to be used within this unit only. Since changes are conflicting, I'll wait for this diff first, but I'd like to remove the void casts for fprintf and use getprogname(3) over __progname as well. Feedback? Comments? Index: kill.c

Re: kill: Use __dead, declare functions static

2017-07-24 Thread Klemens Nanni
On Mon, Jul 24, 2017 at 04:17:46PM -0600, Theo de Raadt wrote: > > I know, this sounds silly. Isn't bringing the code up to modern standards > > part > > of maintaining it? > > I suppose that's my question: > > What is it about __dead that makes it part of "modern standards", when it > isn't

Re: test: Add "<" and ">" to grammar comment, adjust alignment

2017-07-24 Thread Klemens Nanni
On Mon, Jul 24, 2017 at 08:31:26PM +0200, Klemens Nanni wrote: > Add missing operators and make the grammar more readable while using > spaces and tabs consistently. Missing bits: operands can be more than "any legacy UNIX file name" of course, correct that as well. One might jus

test: Catch integer overflow, fail on trailing whitespaces

2017-07-24 Thread Klemens Nanni
test's internal getn() makes integers out of strings although boundaries are checked for long which leads to wrong test results when operands are greater than INT_MAX but smaller than LONG_MAX: $ t() { /bin/test "$1" -lt 0 && : overflow; } $ t 1 + /bin/test 1 -lt 0

test: Add "<" and ">" to grammar comment, adjust alignment

2017-07-24 Thread Klemens Nanni
Add missing operators and make the grammar more readable while using spaces and tabs consistently. Feedback? Comments? Index: test.c === RCS file: /cvs/src/bin/test/test.c,v retrieving revision 1.17 diff -u -p -r1.17 test.c ---

tech: use getprogname(3)

2017-07-24 Thread Klemens Nanni
As done in other places already, replace __progname with getprogname(3). Feedback? Comments? Index: test.c === RCS file: /cvs/src/bin/test/test.c,v retrieving revision 1.17 diff -u -p -r1.17 test.c --- test.c 21 Jan 2017

Re: less(1) - segmentation fault with '-g'

2017-07-27 Thread Klemens Nanni
On Thu, Jul 27, 2017 at 10:31:51AM +0100, Larry Hynes wrote: > $ env | grep LESS > LESSHISTFILE=- > LESS="-i -M -R -g -c" > LESSCHARSET=utf-8 > > $ unset LESS > $ unset LESSCHARSET > $ unset LESSHISTFILE > > $ LESS="-g" > $ echo 'foo\nbar\nfoo\nbar\nfoo\nbar' | less > > While in less, '/' to

Re: w: Remove XXX'ed check

2017-07-27 Thread Klemens Nanni
On Thu, Jul 27, 2017 at 02:03:05PM +0200, Jeremie Courreges-Anglas wrote: > On Thu, Jul 27 2017, Klemens Nanni <k...@posteo.org> wrote: > > Only main() calls pr_args() in L330 with ep->kp as argument which in > > turn is set in L257 or L266 for every utmp entry. kp is

w: Remove XXX'ed check

2017-07-27 Thread Klemens Nanni
Only main() calls pr_args() in L330 with ep->kp as argument which in turn is set in L257 or L266 for every utmp entry. kp is checked against NULL already in L229. Even if kp was somehow NULL chances are high we'd fail before pr_args() was called anyway since L244, L256 and L265 would then cause a

magic.5: Add missing types

2017-06-29 Thread Klemens Nanni
While reading file(1)'s code in #openbsd-daily mulander noted that the 'name' and 'use' types were missing from magic(5). I'm not entirely sure yet whether this is complete, so here's what I did: magic(5) provided by devel/magic documents version 5.31 while base's magic(5) is at 4.24. Here are

Re: ktrace: Following symlinks

2017-06-29 Thread Klemens Nanni
On Thu, Jun 29, 2017 at 09:50:25PM -0700, Philip Guenther wrote: On Thu, Jun 22, 2017 at 7:17 PM, Klemens Nanni <k...@posteo.org> wrote: So I just wrapped my head around vfs(9) with regard to making ktrace following symlinks again, however I don't quite understand what problems may occu

file: Simplify Makefile

2017-06-28 Thread Klemens Nanni
No need for multiple echos or xargs (wich runs cat only once anyway) here. The {post-,}magic files stay unchanged. In magic target don't specify dependencies twice. OK? Index: Makefile === RCS file:

Re: brconfig: Unify/fix strtoul(3) handling

2017-07-01 Thread Klemens Nanni
On Sun, Jul 02, 2017 at 01:09:19AM +0100, Ricardo Mestre wrote: You're blindly replacing strtoul with strtonum without taking the base 0 into account. I'd recommend you take a look at strtoul's manpage first and check what using base 0 means (strtonum always use base 10). Don't worry, I can

tee: Replace hand-rolled list with SLIST_*

2017-07-01 Thread Klemens Nanni
No functional change or bugfix but queue(3) is the for a reason. That way the code even is a tad clearer to me (and two lines shorter). Feedback/OK? Index: tee.c === RCS file: /cvs/src/usr.bin/tee/tee.c,v retrieving revision 1.11

Re: brconfig: Unify/fix strtoul(3) handling

2017-07-01 Thread Klemens Nanni
On Fri, Jun 09, 2017 at 08:33:16PM +0200, Klemens Nanni wrote: No need for temporary variables either, strtonum guarantees through maxval that its return value won't overflow when casted. Index: brconfig.c === RCS file: /cvs/src

Re: install.sub: Clean v[46]_info() ouput

2017-07-03 Thread Klemens Nanni
On Mon, Jul 03, 2017 at 10:47:31PM +, Robert Peichaer wrote: Dokument explicitely possible outputs and tweak the sed expressions to remove the superfluous whitespaces. I guess that does the trick. Index: install.sub === RCS

install.sub: Typo/whitespace nit

2017-07-03 Thread Klemens Nanni
Remove duplicate full stop and add space after function name. Feedback/OK? Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1019 diff -u -p -r1.1019 install.sub --- install.sub 2 Jul

Re: magic.5: Add missing types

2017-07-03 Thread Klemens Nanni
On Mon, Jul 03, 2017 at 05:36:52PM +0100, Nicholas Marriott wrote: Hi On Thu, Jun 29, 2017 at 09:29:57PM +0200, Klemens Nanni wrote: [...] What about the current version being 4.21? We're clearly ahead of this, it seems magic(5) wasn't updated when nicm@ reimplemented things. This patch

Re: ping: Style fixes/cleanups

2017-07-04 Thread Klemens Nanni
Purely cosmetic/style(9) fixes: Remove unneeded indent in prototypes, add space after return keyword. Feedback/OK? Index: ping.c === RCS file: /cvs/src/sbin/ping/ping.c,v retrieving revision 1.220 diff -u -p -r1.220 ping.c ---

Re: install.sub: ieee80211_{scan,config}: Allow quoted SSIDs

2017-07-04 Thread Klemens Nanni
On Mon, Jul 03, 2017 at 12:45:32AM +0200, Klemens Nanni wrote: Thanks for looking into it. On Sun, Jul 02, 2017 at 04:32:43PM +, Robert Peichaer wrote: ieee80211_scan() - Extract the needed information (nwid, bssid) using a very specific sed expression. Any line, not matching this expr

Re: ping: Style fixes/cleanups

2017-07-04 Thread Klemens Nanni
On Tue, Jul 04, 2017 at 03:58:13PM +, Florian Obser wrote: I like most (all? of the correct ones), can you have another go at trying to fix the pointed out changes in behaviour? Thanks natano for pointing out these stupid mistakes. Unify option checking, check for F_RROUTE only if

Re: ping: Style fixes/cleanups

2017-07-04 Thread Klemens Nanni
On Tue, Jul 04, 2017 at 04:00:43PM +, Florian Obser wrote: yeah, this is arse backwards, I'm willing to commit the oposite though, i.e. get rid of the void casts for printf Casts removed, cosecutive calls merged where suitable. Feedback/OK? Index: ping.c

Re: install.sub: ieee80211_{scan,config}: Allow quoted SSIDs

2017-07-02 Thread Klemens Nanni
Thanks for looking into it. On Sun, Jul 02, 2017 at 04:32:43PM +, Robert Peichaer wrote: ieee80211_scan() - Extract the needed information (nwid, bssid) using a very specific sed expression. Any line, not matching this expr is ignored. - Remove leading and trailing double-quotes in

install.sub: No need for subshell in feed_random()

2017-07-01 Thread Klemens Nanni
A simple command list suffices as this is just about redirecting all output at once. Feedback/OK? Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1016 diff -u -p -r1.1016 install.sub

Re: install.sub: No need for subshell in feed_random()

2017-07-01 Thread Klemens Nanni
On Sat, Jul 01, 2017 at 09:35:09PM -0700, Philip Guenther wrote: On Sat, Jul 1, 2017 at 9:27 PM, Klemens Nanni <k...@posteo.org> wrote: A simple command list suffices as this is just about redirecting all output at once. Feedback/OK? ... + {dmesg; cat $CGI_INFO /*.conf; sysctl;

Re: install.sub: No need for subshell in feed_random()

2017-07-01 Thread Klemens Nanni
On Sat, Jul 01, 2017 at 11:01:00PM -0600, Theo de Raadt wrote: Don't understand your point. What is this fixing? Nothing gets "fixed", it just avoids unnecessary forking and makes clear that the inner commands do not require a subshell - there are no side effects on the environment so a

Re: install.sub: No need for subshell in feed_random()

2017-07-01 Thread Klemens Nanni
On Sat, Jul 01, 2017 at 10:13:45PM -0700, Philip Guenther wrote: I've lost track of how many times at work and in OpenBSD I've tested a diff, made a final modification and then committed...a change broken by that final modification. Once you've tested a diff, either don't make a "this is easy!"

Re: install.sub: No need for subshell in feed_random()

2017-07-01 Thread Klemens Nanni
On Sat, Jul 01, 2017 at 11:17:55PM -0600, Theo de Raadt wrote: On Sat, Jul 01, 2017 at 11:01:00PM -0600, Theo de Raadt wrote: >Don't understand your point. What is this fixing? Nothing gets "fixed", it just avoids unnecessary forking and makes clear that the inner commands do not require a

strmode.3: Remove return values section

2017-07-05 Thread Klemens Nanni
strmode(3) is void and thus never returns anything. Feedback/OK? Index: strmode.3 === RCS file: /cvs/src/lib/libc/string/strmode.3,v retrieving revision 1.16 diff -u -p -r1.16 strmode.3 --- strmode.3 5 Jun 2013 03:39:23 -

swab: Swap bytes directly, simplify

2017-07-05 Thread Klemens Nanni
No need for buffers t0, t1 here. This way we only have to step/move the current position instead of the total bytes left as well as both source and destination position. Always swap an even number of bytes by clearing the length's last bit and never write past it. The , operator can be used

Re: swab: Swap bytes directly, simplify

2017-07-05 Thread Klemens Nanni
On Wed, Jul 05, 2017 at 05:27:18PM +0200, Ingo Schwarze wrote: Hi Klemens, Klemens Nanni wrote on Wed, Jul 05, 2017 at 05:02:05PM +0200: No need for buffers t0, t1 here. Your patch changes behaviour in some cases where the buffers do overlap. For example, if src == dst, right now, the code

Re: swab: Swap bytes directly, simplify

2017-07-05 Thread Klemens Nanni
On Wed, Jul 05, 2017 at 09:47:11AM -0600, Theo de Raadt wrote: > > So I'd say for cases like src == dst we don't have to guarantee that > > bytes are swapped. > > and you've audited all the callers to this function? > > > Agreed, I haven't checked for bad/dangerous usage in existing code for > >

Re: dhcp-options(5) conflict with dhcpd.conf(5)

2017-06-28 Thread Klemens Nanni
On Mon, Jun 26, 2017 at 08:26:03PM -0500, Edgar Pettijohn wrote: I found the following conflict between dhcp-options(5) and dhcpd.conf(5). From dhcpd.conf: As you can see in Example 2, it's legal to specify host addresses in parameters as hostnames rather than as numeric IP addresses. If

Re: ktrace: Following symlinks

2017-07-04 Thread Klemens Nanni
On Thu, Jun 29, 2017 at 11:33:36PM -0700, Philip Guenther wrote: On Thu, Jun 29, 2017 at 10:42 PM, Klemens Nanni <k...@posteo.org> wrote: On Thu, Jun 29, 2017 at 09:50:25PM -0700, Philip Guenther wrote: On Thu, Jun 22, 2017 at 7:17 PM, Klemens Nanni <k...@posteo.org> wrote:

faq/ports/guide: Remove stray comment

2017-08-08 Thread Klemens Nanni
Index: guide.html === RCS file: /cvs/www/faq/ports/guide.html,v retrieving revision 1.73 diff -u -p -r1.73 guide.html --- guide.html 8 Aug 2017 15:48:56 - 1.73 +++ guide.html 9 Aug 2017 00:13:22 - @@ -808,7 +808,7 @@

faq/ports/guide: Missing space

2017-08-07 Thread Klemens Nanni
Index: faq/ports/guide.html === RCS file: /cvs/www/faq/ports/guide.html,v retrieving revision 1.71 diff -u -p -r1.71 guide.html --- faq/ports/guide.html26 Jun 2017 17:18:58 - 1.71 +++ faq/ports/guide.html7 Aug

faq/ports/guide: Improve wording

2017-08-08 Thread Klemens Nanni
This way it's feels much more natural to say. Feedback? Index: guide.html === RCS file: /cvs/www/faq/ports/guide.html,v retrieving revision 1.72 diff -u -p -r1.72 guide.html --- guide.html 7 Aug 2017 22:27:51 - 1.72 +++

xenocara readme: xdm -> xenodm

2017-08-18 Thread Klemens Nanni
Found while looking for the core dump bits. Feedback? Index: README === RCS file: /cvs/xenocara/README,v retrieving revision 1.39 diff -u -p -r1.39 README --- README 24 Feb 2017 03:07:03 - 1.39 +++ README 18 Aug

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

Re: ktrace: Allow appending to FIFOs

2017-06-20 Thread Klemens Nanni
On Tue, Jun 20, 2017 at 09:10:17PM -0400, Ted Unangst wrote: Klemens Nanni wrote: I wanted to quickly debug some program without actually dumping to disk by using FIFOs, however ktrace(2) wouldn't accept anything but regular files. Are there any pitfalls or limitations I am currently not aware

ktrace: Allow appending to FIFOs

2017-06-20 Thread Klemens Nanni
I wanted to quickly debug some program without actually dumping to disk by using FIFOs, however ktrace(2) wouldn't accept anything but regular files. Are there any pitfalls or limitations I am currently not aware of that justify this strict behaviour? $ ln -s some.file link $

ktrace: Following symlinks

2017-06-22 Thread Klemens Nanni
So I just wrapped my head around vfs(9) with regard to making ktrace following symlinks again, however I don't quite understand what problems may occur when doing so. May anyone enlighten me on this? This feature was explicitly disabled 17 years ago[1] appearently because FreeBSD did so[2] but I

install.sub: Remove redundant check for NIFS

2017-06-23 Thread Klemens Nanni
NIFS is checked inside start_cgiinfo() already, this nicely aligns with the rest of the list in do_install(). Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1015 diff -u -p -r1.1015

Re: Finish the link-kit job

2017-06-24 Thread Klemens Nanni
=== RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1014 diff -u -p -u -r1.1014 install.sub --- distrib/miniroot/install.sub3 Jun 2017 22:27:41 - 1.1014 +++ distrib/miniroot/install.sub

Re: [PATCH] ffs: always assign random inode generation numbers

2017-06-25 Thread Klemens Nanni
On Sun, Jun 25, 2017 at 10:47:08PM -0600, Theo de Raadt wrote: :-) Speaking of signed integers, does it really need to be signed? Perhaps not. Anyone know for sure? Of course this number should probably exclude 0 in it's range. Probably [0, 3] completely as those are reserved for

Re: [PATCH] ffs: always assign random inode generation numbers

2017-06-26 Thread Klemens Nanni
On Sun, Jun 25, 2017 at 11:21:50PM -0600, Theo de Raadt wrote: On Sun, Jun 25, 2017 at 10:47:08PM -0600, Theo de Raadt wrote: >> :-) Speaking of signed integers, does it really need to be signed? > >Perhaps not. Anyone know for sure? > >Of course this number should probably exclude 0 in it's

brconfig: Unify/fix strtoul(3) handling

2017-06-02 Thread Klemens Nanni
Besides fixing a tautological 'v < 0' and using more descriptive/less errorprone sizeof(target) this patch unifies strtoul(3) handling both logically and cosmetically. Index: brconfig.c === RCS file:

Makefile: Use -exec not xargs(1) with find(1)

2017-06-03 Thread Klemens Nanni
-exec has been around since 2012 is cleaner and shorter, I don't see why xargs(1) should be used for such simple cases. Besides that don't walk the tree twice. Index: include/Makefile === RCS file: /cvs/src/include/Makefile,v

chmod.1: Correct =X behaviour

2017-06-03 Thread Klemens Nanni
=X actually works quite fine despite the mentioned condition: $ touch f; mkdir d $ chmod =X f d $ ls -ld f d d--x--x--x 2 kle wheel 512 Jun 3 15:11 d/ -- 1 kle wheel0 Jun 3 15:11 f One of the given examples has been updated to reflect

Re: sshd: Remove authorized_keys2 file

2017-06-05 Thread Klemens Nanni
Bump: Feeback? OK? On Mon, Apr 17, 2017 at 09:28:29PM +0200, Klemens Nanni wrote: Now that protocol version 1 was finally dropped in sshd(8), get rid of this file completely. Our default sshd_config(5) overwrites AuthorizedKeysFile to ignore it anyway and sshd(8)'s FILES section doesn't mention

Re: brconfig: Unify/fix strtoul(3) handling

2017-06-07 Thread Klemens Nanni
On Wed, Jun 07, 2017 at 01:17:10PM -0400, Ted Unangst wrote: Klemens Nanni wrote: Besides fixing a tautological 'v < 0' and using more descriptive/less errorprone sizeof(target) this patch unifies strtoul(3) handling both logically and cosmetically. A great deal of these look like exac

ifconfig: Fix/improve settimeslot(), simplify get_ts_map() out

2017-06-08 Thread Klemens Nanni
This fixes the primitive parsing route of settimeslot() to allow any possible list of slots and/or ranges, see the update manual section. The old code would happily mask "1,2-" into 0b11, settimeslot() now fails on such broken ranges and also checks for inconsistencies like "4-1", etc.

install.sub: Clean v[46]_info() ouput

2017-06-14 Thread Klemens Nanni
With this patch, v[46]_info() both output exactly what their description says. As of now, these functions are only used through set -- $(v4_info $_if) which gracefully handles any constellation of whitespaces in the output just fine. However future usage might change (or not) and being

Re: install.sub: Fix scrambled address list in v6_defroute()

2017-06-13 Thread Klemens Nanni
On Wed, Jun 14, 2017 at 03:00:11AM +0200, Klemens Nanni wrote: Installing -current the other day showed a broken list when picking the IPv6 default route just like reported on bugs@ five days ago[1]. Missed the link. 1: http://marc.info/?l=openbsd-bugs=149704197715791

install.sub: Fix scrambled address list in v6_defroute()

2017-06-13 Thread Klemens Nanni
Installing -current the other day showed a broken list when picking the IPv6 default route just like reported on bugs@ five days ago[1]. This behaviour can be reproduced manually running the code from v6_defroute(): $ # source/define bsort() $ _if=trunk0 $ bsort $(ping6

Re: Add support for rdonly keyword in fstab

2017-06-14 Thread Klemens Nanni
On Wed, Jun 14, 2017 at 07:54:48PM +0200, Jérôme FRGACIC wrote: I recently realized that the word "rdonly" is not an alias for "ro" in the fstab file, which is inconsistent with the mount(1) command. I would suggest to add support for it with this small patch. fstab(5) has always used ro/rw

install.sub: ieee80211_{scan,config}: Allow quoted SSIDs

2017-06-14 Thread Klemens Nanni
Instead of ignoring SSIDs containing whitespaces, slightly adjust the commands to take everything in between 'nwid ' and ' chan' as SSID; if it has double quotes at start *and* end, simply remove those. This enables users to select networks such as "Unitymedia WifiSpot" "FRITZ!Box 7490" for

Re: install.sub: ieee80211_{scan,config}: Allow quoted SSIDs

2017-06-15 Thread Klemens Nanni
No need for quoting $_nwid within [[ ... ]] since field splitting is not applied. Index: install.sub === RCS file: /cvs/src/distrib/miniroot/install.sub,v retrieving revision 1.1014 diff -u -p -r1.1014 install.sub --- install.sub 3

arp: Fix synopsis

2017-06-19 Thread Klemens Nanni
'arp -[d]a' do not require hostname as told in the manual page. A single fprintf() is both shorter and cleaner. Index: arp.8 === RCS file: /cvs/src/usr.sbin/arp/arp.8,v retrieving revision 1.39 diff -u -p -r1.39 arp.8 --- arp.8

Re: ping: Style fixes/cleanups

2017-06-13 Thread Klemens Nanni
On Tue, Jun 13, 2017 at 10:45:57AM -0600, Theo de Raadt wrote: Sorry, but that type of diff is a no-go. You've made a large variety of different decisions on your own and mixed them up with ones which are personal taste, and then touched so many lines of the code that future study of historical

Re: ping: Style fixes/cleanups

2017-06-13 Thread Klemens Nanni
Do not clear the unneeded dst[46] structure. Index: ping.c === RCS file: /cvs/src/sbin/ping/ping.c,v retrieving revision 1.218 diff -u -p -r1.218 ping.c --- ping.c 22 Feb 2017 13:43:35 - 1.218 +++ ping.c 13 Jun

Re: ping: Style fixes/cleanups

2017-06-13 Thread Klemens Nanni
printf's return value is ignored allmost all the times so do the same for the rest of them as well for consistency. Subsequent calls got merged where I think is appropiate and readability improves. The usage format string now looks like it's actual put. Index: ping.c

Re: ping: Style fixes/cleanups

2017-06-13 Thread Klemens Nanni
The intent here is to get the highest multiple of four smaller or equal than i + 3. Instead of relying on integer division to get rid of the remainder just to "undo" everything, simply clear the lowest two bits (0b11 = 3) leaving multiples of four. Index: ping.c

Re: ping: Style fixes/cleanups

2017-06-13 Thread Klemens Nanni
Unify option checking and simply logic. F_HDRINCL and F_ROUTE are mutually exclusive, thus check the latter only if the former one is not set. Index: ping.c === RCS file: /cvs/src/sbin/ping/ping.c,v retrieving revision 1.218 diff

Re: brconfig: Unify/fix strtoul(3) handling

2017-06-09 Thread Klemens Nanni
No need for temporary variables either, strtonum guarantees through maxval that its return value won't overflow when casted. Index: brconfig.c === RCS file: /cvs/src/sbin/ifconfig/brconfig.c,v retrieving revision 1.15 diff -u -p

  1   2   3   4   5   6   7   8   9   >