Re: libc/regex: const'r'us

2020-12-31 Thread Todd C . Miller
On Thu, 31 Dec 2020 07:27:49 +, Miod Vallat wrote: > Spencer's code was written before const was a thing, but we can do > better. Neither regcomp(3) nor regex(3) modify the strings they are > being passed, so we can keep internal pointers as const as well and > avoid {dub,spur}ious casts. > >

Re: login_passwd.c (etc.) and auth_mkvalue(3) returning NULL

2020-12-31 Thread Todd C . Miller
On Thu, 31 Dec 2020 15:27:02 +1100, Ross L Richardson wrote: > It could, of course, just use a fixed string rather than the "%s" format, > although the latter is certainly clear(er) and consistent. I originally had a fixed string but decided that using the "%s" format was clearer. > With

Re: login_passwd.c (etc.) and auth_mkvalue(3) returning NULL

2020-12-30 Thread Todd C . Miller
On Wed, 30 Dec 2020 15:34:34 +1100, Ross L Richardson wrote: > auth_mkvalue(3) may return NULL (if no memory is available), but > login_passwd.c and friends use the return value without checking. Yes, that should be checked. In the case of login_passwd.c there is really no reason to use

Re: [diff] src/usr.sbin/smtpd: change process names

2020-12-30 Thread Todd C . Miller
On Wed, 30 Dec 2020 09:27:34 +0100, Martijn van Duren wrote: > On Tue, 2020-12-29 at 08:57 +0100, Giovanni Bechis wrote: > > On 12/20/20 12:21 AM, gil...@poolp.org wrote: > > > December 19, 2020 11:26 PM, "Martijn van Duren" alat.at> wrote: > > > > > > > Personally I'd rather wait to keep the

Re: Rename SIMPLEQ_ to STAILQ_, diff 1/7

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 12:36:22 -0700, Todd C. Miller wrote: > That looks something like this. I used the FreeBSD macros which > incorporate STAILQ_NEXT and STAILQ_FIRST but I can inline things > if someone has a strong opinion on this. Here is the updated man page. The table doesn'

Re: Rename SIMPLEQ_ to STAILQ_, diff 1/7

2020-12-29 Thread Todd C . Miller
On Sat, 26 Dec 2020 15:07:36 -0700, "Theo de Raadt" wrote: > Well in that case this should still be a multistep process. > > Add STAILQ > > Convert things, including everything in ports > > No diff should change a line of code before it's time That looks something like this. I used the FreeBSD

Re: libc/regex: safer pointer arithmetic

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 10:33:26 +, Miod Vallat wrote: > regcomp.c uses the "start + count < end" idiom to check that there are > "count" bytes available in an array of char "start" and "end" both point > to. > > This is fine, unless "start + count" goes beyond the last element of the > array. In

Re: libc/regex: regerror minor tweaks

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 10:35:08 +, Miod Vallat wrote: > The following diff constifies the strings in regerror.c and also makes > use of the strlcpy() return value to avoid a redundant strlen() call. OK millert@ - todd

Re: libc/regex: remove dead code

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 09:50:16 +, Miod Vallat wrote: > cclasses[] multis field is always an empty string. Remove it and code > dealing with it. This code was incomplete anyway. OK millert@ - todd

Re: libc/regex: constify more data

2020-12-29 Thread Todd C . Miller
On Tue, 29 Dec 2020 09:49:11 +, Miod Vallat wrote: > The following diff constifies the strings in cnames[]. No functional > change. OK millert@ - todd

Re: smtpd: trim down on filter processes

2020-12-27 Thread Todd C . Miller
On Sun, 27 Dec 2020 18:41:22 +0100, Martijn van Duren wrote: > Because filters use system(3) after forking we get 2 processes for every > filter: one for waiting for system(3) to return and one running the actual > filter. > > Since the extra smtpd process does absolutely nothing we can just as

Re: Rename SIMPLEQ_ to STAILQ_, diff 1/7

2020-12-26 Thread Todd C . Miller
On Sat, 26 Dec 2020 10:45:21 -0700, "Theo de Raadt" wrote: > > This diff renames SIMPLEQ_* to STAILQ_* in /usr/src/sys/sys to unify > > with FreeBSD and Linux. > > More than half the stuff being touched doesn't exist in FreeBSD or Linux. > > SIMPLEQ_ goes back to 97. STAILQ goes back to 96.

Re: Rename SIMPLEQ_ to STAILQ_, diff 1/7

2020-12-26 Thread Todd C . Miller
I read through all the diffs and they look fine to me. My only comment is that it would be nice if the whitespace changes to queue.h were done separately as they makes it more difficult to see the important changes. I was pleasntly surprised to find the nothing in the tree reaches into the data

Re: [diff] usr.sbin/smtpd: fix event handling upon exit

2020-12-22 Thread Todd C . Miller
OK millert@ - todd

Re: [diff] src/usr.sbin/smtpd: add a forward-file option

2020-12-19 Thread Todd C . Miller
I like this direction but I worry about breaking existing configs. How are we going to alert existing users that they need to update their configs if the behavior silently changes? - todd

Re: [diff] src/usr.sbin/smtpd: change process names

2020-12-19 Thread Todd C . Miller
I like it. I always forget which role the pony process performs. - todd

Re: WITNESS panic: acquiring blockable sleep lock with spinlock or critical section held (rwlock) kmmaplk

2020-12-19 Thread Todd C . Miller
On Sat, 19 Dec 2020 18:07:41 -0300, Martin Pieuchot wrote: > A solution based on a comment and a non-enabled by option seems very > fragile to me. I came up with the idea of poisoning the ipl of the > mutex. What do you think? Even better. OK millert@ - todd

Re: WITNESS panic: acquiring blockable sleep lock with spinlock or critical section held (rwlock) kmmaplk

2020-12-18 Thread Todd C . Miller
On Fri, 18 Dec 2020 13:34:39 +0100, Mark Kettenis wrote: > Anyway, your analysis is right. When a kernel thread wants to use > pmap_extract(9) on a userland pmap, it needs to lock pm_apte_mtx to > prevent another thread from simultaniously activating a userland pmap > too. So indeed,

Re: [diff] src/usr.sbin/smtpd: plug two memory leaks

2020-12-17 Thread Todd C . Miller
On Thu, 17 Dec 2020 15:02:41 +, gil...@poolp.org wrote: > a- in lka_filter.c, the name of the filter chain for a session is strdup()-ed > upon session allocation but not released upon session release. free() it > in lka_filter_end(). > > b- in smtp_session.c, filter io channel should be

Re: libcurses: --enable-const

2020-12-12 Thread Todd C . Miller
On Sat, 12 Dec 2020 16:28:18 +0100, Christian Weisgerber wrote: > ncurses has a configure option that adds a few more consts to its > headers by way of the NCURSES_CONST define. Starting with version > 6.0, this has become the default. OpenBSD is still on ncurses 5.7, > but FreeBSD and I guess

Re: cat(1): -n flag: support files with more than INT_MAX lines

2020-12-10 Thread Todd C . Miller
On Thu, 10 Dec 2020 22:12:49 -0600, Scott Cheloha wrote: > If we bump 'line' from an int to an unsigned long long we will > correctly number files with more than INT_MAX lines instead of > wrapping to a negative number. OK millert@ - todd

Re: rpki-client: reject bad URLs in cert files

2020-12-02 Thread Todd C . Miller
On Wed, 02 Dec 2020 17:18:49 +0100, Theo Buehler wrote: > Should this also check isascii() to ensure that this works as intended > in the -portable version? The ENVIRONMENT section of the isalnum() and > ispunct() manuals suggests that the characters satisfying this could be > locale-dependent

Re: rpki-client: reject bad URLs in cert files

2020-12-02 Thread Todd C . Miller
On Wed, 02 Dec 2020 15:17:43 +0100, Claudio Jeker wrote: > Be stricter in what we accept as URL. Nobody should use silly encodings > like UTF-8 or other crap in the embedded URLs. I also consider any kind of > space as a failure (use %20 instead if that is really needed). > > This makes later

Re: Better overflow check in bgpd

2020-12-02 Thread Todd C . Miller
On Wed, 02 Dec 2020 12:19:11 +0100, Claudio Jeker wrote: > The overflow check for the relative metric adjustments of filtersets > assumes a certain overflow behaviour of signed integers. I think it is > better to write this in a way that does not involve an overflow. OK millert@ though I think >

Re: [PATCH] __rec_open() should set the type

2020-12-01 Thread Todd C . Miller
On Tue, 01 Dec 2020 14:07:18 +0100, "Boudewijn Dijkstra" wrote: > According to dbopen(3), the 'type' field of struct DB holds the "type of > the underlying access method (and file format)." In __bt_open() it is set > to DB_BTREE and in __hash_open() it is set to DB_HASH, so one might expect

Re: find -exec util {} arg + confusion

2020-11-21 Thread Todd C . Miller
On Sat, 21 Nov 2020 17:02:05 +0100, Alexander Hall wrote: > So this is it. Any other objections? OK? OK millert@ - todd

Re: Import seq(1) from FreeBSD

2020-11-16 Thread Todd C . Miller
On Mon, 16 Nov 2020 16:14:31 +0100, Ingo Schwarze wrote: > are you really sure this is a good idea? The version you sent is > wildly incompatible with GNU sed. So we add a non-standard utility > that exhibits different behaviour on different systems even though > a standard utility already

Import seq(1) from FreeBSD

2020-11-16 Thread Todd C . Miller
This is originally from NetBSD but FreeBSD appears to have some additional fixes. I know we have jot(1) but seq(1) is considerably easier to use for simple things and at this point, most other systems have it. - todd Index: usr.bin/seq/Makefile

Re: Convert sysctl_sysvsem to sysctl_bounded_args

2020-11-16 Thread Todd C . Miller
On Sat, 14 Nov 2020 21:09:59 -0800, Greg Steuck wrote: > I went a tiny bit beyond pure textual conversion and moved a bit of code. OK millert@ - todd

Re: Convert fusefs_sysctl to sysctl_bounded_args

2020-11-16 Thread Todd C . Miller
On Sat, 14 Nov 2020 21:05:39 -0800, Greg Steuck wrote: > This is trivial more-of-the-same. If somebody spots a bug, do speak > up. I feel pretty good about committing this promptly. OK millert@ - todd

Re: Remove the cases folded into sysctl_bounded_args but left behind

2020-11-16 Thread Todd C . Miller
On Sat, 14 Nov 2020 21:08:09 -0800, Greg Steuck wrote: > This an "oops" moment... The code remained correct, but I forgot to > remove junk after converting it. OK millert@ - todd

Re: Convert ffs_sysctl to sysctl_bounded_args

2020-11-06 Thread Todd C . Miller
On Sun, 01 Nov 2020 20:16:35 -0800, Greg Steuck wrote: > How does the encoding of sysctl_rdint as [1,0] sound? I think this is OK. We already have the special case where min == max. OK millert@ - todd

Re: bpf_sysctl for sysctl_int_bounded

2020-11-02 Thread Todd C . Miller
On Sun, 01 Nov 2020 19:31:16 -0800, Greg Steuck wrote: > Mildly different in flavor due to the special check. OK? OK millert@ - todd

Re: Move TCPCTL_ALWAYS_KEEPALIVE into tcpctl_vars

2020-11-02 Thread Todd C . Miller
On Sun, 01 Nov 2020 19:29:23 -0800, Greg Steuck wrote: > This one was an omission from the earlier conversion, should be an easy > OK? OK millert@ - todd

Re: basename(3) should have non-const arg, says POSIX

2020-10-19 Thread Todd C . Miller
On Mon, 19 Oct 2020 22:06:52 +0200, Christian Weisgerber wrote: > The patch below aligns the function prototypes with POSIX. All > resulting warnings "passing 'const char *' to parameter of type > 'char *' discards qualifiers" in the base system have been cleaned > up. It successfully passes

Re: Non-const basename: usr.bin/cvs

2020-10-19 Thread Todd C . Miller
On Sat, 17 Oct 2020 00:15:54 +0200, Christian Weisgerber wrote: > Accommodate POSIX basename(3) that takes a non-const parameter and > may modify the string buffer. > > There were only two compiler warnings about discarded const, but > there are numerous instances where the code assumes non-POSIX

Re: _exit(2), execve(2): cancel interval timers MP-safely

2020-10-15 Thread Todd C . Miller
On Wed, 14 Oct 2020 20:06:50 -0500, Scott Cheloha wrote: > ... should I shove the for-loop into the helper function too? Maybe > call it "cancel_all_itimers()"? I have a vague feeling that showing > the reader that there are multiple timers is a good thing here, but > then again maybe I'm wrong

Re: Non-const basename: usr.bin/rcs

2020-10-15 Thread Todd C . Miller
On Wed, 14 Oct 2020 22:19:52 +0200, Christian Weisgerber wrote: > Accommodate POSIX basename(3) that takes a non-const parameter and > may in fact modify the string buffer. OK millert@ - todd

Re: Non-const basename: bin/chio

2020-10-13 Thread Todd C . Miller
On Tue, 13 Oct 2020 21:37:11 +0200, Christian Weisgerber wrote: > As far as I understand, the basename() here is specifically intended > to skip a leading "/dev/". So how about doing this expressly? That works for me. > Do we want to use _PATH_DEV or "/dev/"? There's a "/dev/rst%d" a > few

Re: Non-const basename: libkvm

2020-10-13 Thread Todd C . Miller
On Tue, 13 Oct 2020 11:05:42 +0200, Christian Weisgerber wrote: > Accommodate a basename(3) that takes a non-const parameter and may > in fact modify the string buffer. > > Note that strlen(uf) >= PATH_MAX is already checked by the caller > in _kvm_open(). OK. - todd

Re: Non-const basename: usr.bin/patch

2020-10-10 Thread Todd C . Miller
On Sat, 10 Oct 2020 16:50:56 +0200, Christian Weisgerber wrote: > Here's a fix to accommodate a basename(3) that takes a non-const > parameter and may in fact modify the string buffer. This is > originally from Joerg Sonnenberger for DragonFly BSD and has since > spread to the other BSDs. >

Re: Non-const basename: usr.bin/compress

2020-10-10 Thread Todd C . Miller
On Sat, 10 Oct 2020 22:24:58 +0200, Christian Weisgerber wrote: > Accommodate POSIX basename(3) that takes a non-const parameter and > may in fact modify the string buffer. > > Following martijn@'s comment for the sed diff, we don't need to > check for truncation because the "in" path has already

/etc/daily: use find -delete

2020-10-08 Thread Todd C . Miller
We can use find's built-in -delete primary to remove old /tmp files and directories. This is somewhat less error-prone than execing rm or rmdir. - todd Index: etc/daily === RCS file: /cvs/src/etc/daily,v retrieving revision 1.93

Re: ls: match historic behavior listing empty directories

2020-10-07 Thread Todd C . Miller
Anyone? - todd > This is adapted from FreeBSD revs 130236 and 130237 which have the > following log message: > > If we are asked to print the total number of blocks, do so even if we > have no entries to print (either due to an empty directory or an > error). This makes the -l and

libexec/security: don't prune mount points

2020-10-07 Thread Todd C . Miller
The recent changes to the daily security script will result in it not traversing file systems where the parent mount point is mounted with options nodev,nosuid but the child is mounted with setuid enabled. For example, if /var/www is a separate file system that allows setuid but /var is mounted

ls: match historic behavior listing empty directories

2020-10-03 Thread Todd C . Miller
This is adapted from FreeBSD revs 130236 and 130237 which have the following log message: If we are asked to print the total number of blocks, do so even if we have no entries to print (either due to an empty directory or an error). This makes the -l and -s options more consistent,

Re: setpriority(2): booleans are not scalars

2020-09-25 Thread Todd C . Miller
On Fri, 25 Sep 2020 13:58:01 -0500, Scott Cheloha wrote: > `found' serves as a boolean here. I'd prefer to simple and set it to > 1 instead of incrementing it when we find what we're looking for. Makes sense to me, the use of var++ instead of var=1 is old-school style ;-) - todd

Re: ksh "clear-screen" for vi mode

2020-09-20 Thread Todd C . Miller
Does this look better? I don't think we need to refer to the emacs clear-screen command in both cases; once should be sufficient. - todd Index: bin/ksh/ksh.1 === RCS file: /cvs/src/bin/ksh/ksh.1,v retrieving revision 1.209 diff -u

Re: ksh "clear-screen" for vi mode

2020-09-20 Thread Todd C . Miller
On Sun, 20 Sep 2020 05:39:02 +0200, Theo Buehler wrote: > This works and appears to match bash's behavior in that it only works > in normal mode. I would slightly prefer to also add the command to the > nonstandard vi commands in the switch around line 650 to have it > available from insert mode

Re: ksh "clear-screen" for vi mode

2020-09-19 Thread Todd C . Miller
The vi and emacs edit code are completely separate. Try the following diff. I had to rename a few things to avoid clashing with ncurses.h. - todd Index: bin/ksh/vi.c === RCS file: /cvs/src/bin/ksh/vi.c,v retrieving revision 1.56

Re: drop support for afs, nnpfs, and procfs from security(8)

2020-09-16 Thread Todd C . Miller
On Wed, 16 Sep 2020 18:17:36 +0200, Ingo Schwarze wrote: > Does anyone think that explicitely excluding these file system > types might still be useful, or is the following simplification > OK? No functional change intended. I think those bits can go. OK millert@ - todd

Re: cap_mkdb: remove igetnext prototype for the function does not exist

2020-09-15 Thread Todd C . Miller
On Tue, 15 Sep 2020 11:35:13 +0800, Kevin Lo wrote: > ok? OK millert@ - todd

Re: syslogd listen keep alive

2020-09-14 Thread Todd C . Miller
On Mon, 14 Sep 2020 21:49:07 +0200, Alexander Bluhm wrote: > A while ago dhill@ pointed out that syslogd TCP sockets will stay > open forever if a client aborts the connection silently. As syslogd > does not write anything into incoming connections, it will not > recognize failure and the socket

Re: smtp(1) fix for usernames containing '@' symbols

2020-09-14 Thread Todd C . Miller
On Mon, 14 Sep 2020 16:55:43 -, Josh Rickmar wrote: > Some email accounts use account names that include the @host portion, > and this broke the server and credentials parsing in smtp(1). Sometimes > I see these @ characters encoded as %40, but smtp(1) was not decoding > these url escape

Re: smtpd: document "pki" option for relay delivery in smtpd.conf(5)

2020-09-14 Thread Todd C . Miller
On Sun, 13 Sep 2020 20:45:35 +0800, Nick Gasson wrote: > I struggled a bit to configure smtpd to relay to a remote server that > requires SSL client certificates. The solution is to just add a "pki > host.example.org" option, but "pki" is not listed as a valid option for > the relay delivery

Re: smtpd: document "pki" option for relay delivery in smtpd.conf(5)

2020-09-13 Thread Todd C . Miller
On Sun, 13 Sep 2020 20:45:35 +0800, Nick Gasson wrote: > I struggled a bit to configure smtpd to relay to a remote server that > requires SSL client certificates. The solution is to just add a "pki > host.example.org" option, but "pki" is not listed as a valid option for > the relay delivery

Re: basename(3) should have non-const arg, says POSIX

2020-09-12 Thread Todd C . Miller
On Sat, 12 Sep 2020 17:05:02 +0200, Christian Weisgerber wrote: > A make build with the patch below succeeds, but gains some new > warnings "passing 'const char *' to parameter of type 'char *' > discards qualifiers". > > This is a portability trap. Code written on OpenBSD may not be > prepared

Re: httpd: use the original uri for REQUEST_URI

2020-09-11 Thread Todd C . Miller
On Fri, 11 Sep 2020 16:55:35 +0900, YASUOKA Masahiko wrote: > Anyone? > > This is a tiny change but makes httpd(8) more correct. > The diff is not so complicated. OK millert@ - todd

Re: Format string check for dprintf(3)

2020-09-10 Thread Todd C . Miller
On Thu, 10 Sep 2020 20:19:14 +0200, Christian Weisgerber wrote: > Absent -Werror, I do not expect any fallout from this, but I ran a > successful amd64 make build with it anyway. OK millert@ - todd

Re: clang warning in vmctl

2020-09-02 Thread Todd C . Miller
Looks correct, OK millert@ - todd On Wed, 02 Sep 2020 21:43:47 +0200, Theo Buehler wrote: > clang 10 complains: > > /usr/src/usr.sbin/vmctl/vmctl.c:792:35: warning: comparing a pointer to a nul > l character > constant; did you mean to compare to NULL? [-Wpointer-compare] >

Re: shrinking and growing reallocs: a theoretical? bad case for performance

2020-08-31 Thread Todd C . Miller
On Mon, 31 Aug 2020 08:39:56 +0200, Otto Moerbeek wrote: > 1. I do not put high pages of shrinking reallocs into to cache, but > directly unmap. > > 2. For small shrinking reallocs realloc become a no-op. Pro: no > syscalls at all, cons: the actual allocation is larger, so less > overflow

Re: make(1): anchors in :S/old_string/new_string/

2020-08-25 Thread Todd C . Miller
On Thu, 20 Aug 2020 20:31:03 +0200, Theo Buehler wrote: > I think the fix should be as simple as the diff below. I added a small > extension of a regress test for this. Unpatched make fails, patched > make passes. That looks good to me, I can't think of any problems that moving the logic into

Re: unbound(8): disable explicit port randomisation

2020-08-24 Thread Todd C . Miller
On Mon, 24 Aug 2020 15:39:09 +0200, Florian Obser wrote: > With the update sthen@ just put in we can enable this: > > --disable-explicit-port-randomisation > disable explicit source port randomisation and rely > on the kernel to provide random

awk: implement mktime() function

2020-08-23 Thread Todd C . Miller
Both gawk and mawk include mktime() in their time functions. We have strftime() and systime() but no mktime(). The following diff makes our awk more compatible with other implementations. - todd Index: usr.bin/awk/awk.1 === RCS

Re: top: filter by routing table

2020-08-22 Thread Todd C . Miller
This looks good to me but I've refrained from commenting simply because I don't use rtables at all myself. Can we get some feedback from people who actually use rtables? - todd

Re: bug on fmemopen(3)

2020-08-14 Thread Todd C . Miller
Fix append mode and expand regress. I've added an append flag to the state but we could just as easily store the open flag instead. - todd Index: lib/libc/stdio/fmemopen.c === RCS file: /cvs/src/lib/libc/stdio/fmemopen.c,v

Re: setitimer(2): write new timer value once

2020-08-11 Thread Todd C . Miller
Makes sense, OK millert@. - todd

Re: brconfig: strto*l -> strtonum()

2020-08-08 Thread Todd C . Miller
On Sat, 08 Aug 2020 05:09:22 +0200, Klemens Nanni wrote: > Alternatively, we can avoid duplicating the ioctl specific min/max > values in strtonum(3) calls, just use the struct member type's *_MAX > defines and rely on the kernel for appropiate boundary checks - this is > what the code does now.

Re: mountd: Avoid reading one byte before buffer

2020-08-06 Thread Todd C . Miller
Length checks should generally be done before the dereference :-) OK millert@ - todd

lex: reset yy_at_bol in yyless() if yyleng is non-zero.

2020-08-04 Thread Todd C . Miller
Fixes a bug where calling yyless() to unput all the chars before a newline would not reset the beginning of line marker. Otherwise, flex won't match rules that start with a caret (^) after calling yyless() in thise case. AT lex behaves correctly. Upstream PR:

Re: LOCALE_HOME for strtime(3)

2020-08-01 Thread Todd C . Miller
On Sat, 01 Aug 2020 17:29:11 +0200, Jan Stary wrote: > ping This was already committed. revision 1.33 date: 2020/07/16 20:08:12; author: millert; state: Exp; lines: +1 -146; commitid: LVVrFB1zB8C0gLBS; Remove obsolete LOCALE_HOME code we have never used (and never will). Upstream removed

Re: A concerning commit which breaks compatibility

2020-07-23 Thread Todd C . Miller
Go away troll. - todd

Re: top: add / as alias for g (grep)

2020-07-23 Thread Todd C . Miller
On Thu, 23 Jul 2020 22:04:24 +0200, Klemens Nanni wrote: > I've somehow hit the slash way to often for searching a particular > command, would anyone object if I added it as a command character? No objection from me. - todd

Re: mailwrapper: hostsat and purgestat symlinks

2020-07-23 Thread Todd C . Miller
On Thu, 23 Jul 2020 21:41:53 +0200, Klemens Nanni wrote: > Ping. > > Feedback? Objections? OK? Not OK as-is. This will break hoststat/purgestat for anyone who uses the sendmail port. See mail/sendmail/files/mailer.conf.sendmail in ports for how this is used. However, since these are really

Re: Potential grep bug?

2020-07-22 Thread Todd C . Miller
On Wed, 22 Jul 2020 20:57:56 +0200, Martijn van Duren wrote: > Any takers? OK millert@ - todd

Re: join(1) remove redundant memory copy

2020-07-22 Thread Todd C . Miller
On Wed, 22 Jul 2020 20:29:06 +0200, Martijn van Duren wrote: > When r1.28 converted join(1) to getline(3) it left the old intermediate > line variable. This means using an additional memcpy and reallocing. > I reckon this is wasted cycles and screen filling. > > Major difference is that our

Re: LOCALE_HOME for strtime(3)

2020-07-15 Thread Todd C . Miller
Upstream tzcode removed the LOCALE_HOME bits in 2014. There's no reason for us to keep it. - todd

Re: readlink "/etc/localtime" vs unveil

2020-07-11 Thread Todd C . Miller
On Sat, 11 Jul 2020 13:35:57 -0700, Greg Steuck wrote: > The problem seems to be due to Chromium doing a readlink (likely at > [1]) on /etc/localtime, which fails. There's a workaround that > happens to work for chromium (and firefox). Just set TZ in your > environment. You could just add a

Re: disable libc sys wrappers?

2020-07-08 Thread Todd C . Miller
On Wed, 08 Jul 2020 23:14:17 +0300, Paul Irofti wrote: > I don't see the original mail here either. Is it me or Ted, or a forward from > a private conversation? Anyway, I am OK with this and Robert had a similar d > iff two months ago when this started. Just make sure this is off by default f >

Re: ksh(1) set -o pipefail

2020-07-06 Thread Todd C . Miller
On Mon, 06 Jul 2020 22:22:36 +0200, Jeremie Courreges-Anglas wrote: > Requested by ajacoutot@, here's an attempt at implementing set -o > pipefail. As pointed by sthen@ this option should be included in the > next POSIX standard: > > https://www.austingroupbugs.net/view.php?id=789 > > There

Re: awk FS behaviour change

2020-06-27 Thread Todd C . Miller
On Sat, 27 Jun 2020 06:50:39 +0100, Jason McIntyre wrote: > i'm not sure it reads better when we switch the emphasis from whitespace > to FS. i think it's better that people see how it normally works, then > the gories about FS. so i'd have kept the first part of the sentence, > but maybe

Re: awk FS behaviour change

2020-06-26 Thread Todd C . Miller
On Fri, 26 Jun 2020 23:56:23 +0200, Klemens Nanni wrote: > How about adding something like "Therefore, FS should be set with -F or > in a BEGIN block before input is read." as second sentence in this > paragraph? That whole section is missing important details. I've tried to add the missing

Re: top: add missing scroll keys to help page, name default signal

2020-06-26 Thread Todd C . Miller
On Fri, 26 Jun 2020 23:39:25 +0200, Klemens Nanni wrote: > The order of commands is not in sync between help page and manual, but > I refrained from reordering to avoid churn. OK millert@ - todd

Re: awk FS behaviour change

2020-06-26 Thread Todd C . Miller
On Fri, 26 Jun 2020 21:41:57 +0100, Stuart Henderson wrote: > I don't know which is "correct" (the manpage isn't enlightening) but > it was a bit unexpected so I wanted to at least draw attention to it > in case it breaks somebody else's script. The awk manual leaves a lot of things unspecified

Re: awk FS behaviour change

2020-06-26 Thread Todd C . Miller
On Fri, 26 Jun 2020 21:41:57 +0100, Stuart Henderson wrote: > The Sep 10, 2019 version of awk introduced a change in handling this: > > ifconfig egress | awk '/inet / {FS="[ .]"; print "host-"$4"-"$5"}' > > Given a line like > > inet 10.20.30.40 netmask 0xff00 broadcast 10.20.30.255

Re: top: remove redundant NULL check

2020-06-23 Thread Todd C . Miller
On Tue, 23 Jun 2020 18:31:03 +0200, Klemens Nanni wrote: > I'd like to remove a NULL check in get_process_info() for the sake of > simplicity and to reflect that the process list is *always* sorted > (default is "cpu"), even if not explicitly requested; this makes it > easier to argue about the

Re: use libc base64 code instead of libcrypt for ifconfig wg key handling

2020-06-21 Thread Todd C . Miller
On Mon, 22 Jun 2020 11:01:05 +1000, David Gwynne wrote: > libc has undocumented base64 encoding and decoding funtionality. this > cuts ifconfig over to using it instead of the code in libcrypto. > > whether the libc functionality should be "blessed" and documented is a > separate issue. OK

Re: userland clock_gettime proof of concept

2020-06-19 Thread Todd C . Miller
On Fri, 19 Jun 2020 18:52:40 +0200, Mark Kettenis wrote: > There is one other issue that I wanted to raise. An that is whether > we really need to implement CLOCK_UPTINME as a userland clock. If we > don't do that we can drop tk_naptime from the shared struct. I > mention this because

Re: New EVFILT_EXCEPT for POLLPRI & POLLRDBAND

2020-06-16 Thread Todd C . Miller
On Tue, 16 Jun 2020 10:13:11 -0600, "Theo de Raadt" wrote: > Everytime someone did poll on select, or select on poll, or something > on something, the emulation ended up being dangerously buggy in the > first round. Agreed. > I hope such emulation isn't a goal in libc. What happens in the

Re: New EVFILT_EXCEPT for POLLPRI & POLLRDBAND

2020-06-16 Thread Todd C . Miller
On Tue, 16 Jun 2020 16:21:14 +0300, Vitaliy Makkoveev wrote: > https://github.com/apple/darwin-xnu Note that the poll emulation in xnu was incomplete the last time I checked. Granted, that was 10 years ago so it might be better now, but at the time you couldn't poll much more than sockets. I

Re: New EVFILT_EXCEPT for POLLPRI & POLLRDBAND

2020-06-16 Thread Todd C . Miller
On Tue, 16 Jun 2020 12:48:58 +0200, Martin Pieuchot wrote: > The diff below implements DragonFly's approach of adding a new kind of > filter, EVFILT_EXCEPT, to report such conditions. This extends the > existing kqueue interface which is questionable. On the one hand this > allows userland

Re: Extend filt_dead() with __EV_HUP

2020-06-15 Thread Todd C . Miller
On Mon, 15 Jun 2020 08:41:00 +0200, Martin Pieuchot wrote: > This extends the existing dead filter to add __EV_HUP in order to make > it usable by deadfs. OK millert@ - todd

Re: __EV_HUP to emulate POLLHUP

2020-06-15 Thread Todd C . Miller
On Mon, 15 Jun 2020 08:36:32 +0200, Martin Pieuchot wrote: > Here's an updated diff that does that and move the defines under _KERNEL > as suggested by visa@. I left the dead-filter for another diff to match > another suggestion. The fifo_vnops.c doesn't check for __EV_POLL. Otherwise OK

Re: symmetric toeplitz hashing

2020-06-13 Thread Todd C . Miller
On Sat, 13 Jun 2020 15:19:28 +0200, Theo Buehler wrote: > Others have pointed out off-list that one can use __builtin_popcount(), > but __builtin_parity() is exactly what I want. Is it available on all > architectures? I don't think it is available on gcc 3.x for m88k but someone with an m88k

Re: __EV_HUP to emulate POLLHUP

2020-06-13 Thread Todd C . Miller
On Sat, 13 Jun 2020 10:05:19 +0200, Martin Pieuchot wrote: > Diff below extends the existing kqfilter handlers to be able to set > POLLHUP in the new poll(2) implementation. > > __EV_HUP is introduced and now set for this purpose. A new kqfilter > for deadfs is introduced to match the existing

awk: fix support for unescaped '/' in a character class

2020-06-11 Thread Todd C . Miller
POSIX doesn't permit an unescaped '/' in an extended regular expression. Unlike upstream awk, ours has historically allowed unescaped '/' inside a bracket expression for compatibility with other awk implementations but the check was too simple-minded. This improves the matching to allow things

Re: libkern: ffs() for arm64

2020-06-08 Thread Todd C . Miller
On Mon, 08 Jun 2020 22:35:42 -, Christian Weisgerber wrote: > Style question: > Since this mostly comes down to embedding a single special instruction > in between normal C operations, I wonder whether I should just do .c > with asm() instead of .S, and leave all the boilerplate to the >

Re: smtpd: make smarthost to use SNI when relaying

2020-05-30 Thread Todd C . Miller
On Sat, 30 May 2020 17:40:43 +0200, Sebastien Marie wrote: > I am looking to make smtpd to set SNI (SSL_set_tlsext_host_name) > when connecting to smarthost when relaying mail. > > After digging a bit in libtls (to stole the right code) and smtpd (to > see where to put the stolen code), I have

Re: filesystem code integer and many inodes

2020-05-28 Thread Todd C . Miller
On Thu, 28 May 2020 20:53:07 +0200, Otto Moerbeek wrote: > Here's the separate diff for the prefcg loops. From FreeBSD. OK millert@ - todd

Re: filesystem code integer and many inodes

2020-05-26 Thread Todd C . Miller
On Tue, 26 May 2020 12:07:21 +0200, Otto Moerbeek wrote: > Apart from the noting the strange Subject: I also like to mention one > change in the way cylinder groups are scanned. The current code scans > forward and backward, which causes an uneven distribution of full cgs > (the upper end of the

<    1   2   3   4   5   6   7   8   9   10   >