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: 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 m

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 releas

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, pm_apte_mtx

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: [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: [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] usr.sbin/smtpd: fix event handling upon exit

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

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 s

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. NetB

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 ea

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: 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: 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: 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: 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 m

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: [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 na

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 auth_mkv

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 auth_mk

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: libc/regex: drop more unused data

2020-12-31 Thread Todd C . Miller
On Thu, 31 Dec 2020 07:25:19 +, Miod Vallat wrote: > re_guts catspace[] is only written to (via categories[]), and never used > for anything, so don't bother keeping that. OK millert@ - todd

Re: libc/regex: more regular error handling

2020-12-31 Thread Todd C . Miller
On Thu, 31 Dec 2020 07:29:51 +, Miod Vallat wrote: > The REQUIRE macro is used to check for a condition, and set an error in > the parse struct if it is not satisfied. > > This changes it from ((condition) || function call) to a, IMHO more > readable, if() test. OK millert@ - todd

Re: libc/regex: const'r'us

2020-12-31 Thread Todd C . Miller
All three committed, thanks. - todd

Re: libc/regex: turn unsafe macros to inline functions

2021-01-02 Thread Todd C . Miller
On Sat, 02 Jan 2021 20:33:51 +, Miod Vallat wrote: > That code was written before inline functions were supported by > compilers; now that they are even part of the language standard, turn > macros into inline functions so that there is no need to document in > comments that they will evaluate

Re: libc/regex: turn unsafe macros to inline functions

2021-01-03 Thread Todd C . Miller
On Sun, 03 Jan 2021 17:51:56 +0100, Theo Buehler wrote: > Thanks. Here's the diff rebased on top of -current. This is > > ok tb OK millert@ as well if you'd like to do the honors. - todd

Re: sleep(3): don't bypass nanosleep(2)

2021-01-06 Thread Todd C . Miller
On Wed, 06 Jan 2021 10:31:28 -0600, Scott Cheloha wrote: > Other benefits: > > - sleep(3) now *always* shows up in ktrace. > > - sleep(3) with a zero input now blocks for up to 1 tick, just like > nanosleep(2) does with a zero input (more intuitive behavior). > > - Neither NetBSD nor FreeBSD byp

Re: Fix -Wincompatible-pointer-types-discards-qualifiers

2021-01-07 Thread Todd C . Miller
On Fri, 08 Jan 2021 00:29:32 +0100, Theo Buehler wrote: > Thanks. Unfortunately the patch was mangled by your MUA (line wrapping > and expanded tabs). > > Below is a version that applies. OK millert@ as well. - todd

Re: [PATCH]es sysctl_int_bounded goodness

2021-01-09 Thread Todd C . Miller
On Fri, 18 Dec 2020 12:31:54 -0800, Greg Steuck wrote: > I'm scraping the bottom of the barrel with these, so dumped them all > together for ease of review. Will submit piecemeal as reviews happen. > > All verified manually with sysctl -w. Even bothered to find an i386 > machine with watchdog and

Re: [PATCH] Reduce case duplication in kern_sysctl

2021-01-09 Thread Todd C . Miller
On Sun, 20 Dec 2020 15:52:07 -0800, Greg Steuck wrote: > I tested this by diff'ing sysctl output before/after on amd64. Since > there's a bunch of ifdef'ness I verified RAMDISK still builds. > > I deliberately didn't fix the indentation to keep this diff a pure line > motion (would run over 80 cha

Re: [PATCH] Reduce case duplication in kern_sysctl

2021-01-09 Thread Todd C . Miller
On Mon, 28 Dec 2020 22:00:55 -0800, Greg Steuck wrote: > Here's an updated version to account from an intervening change since I > posted this first. Updated diff looks good to me. OK millert@ but it would be good to get feedback from Marcus too. - todd

Re: [PATCH] Reduce case duplication in kern_sysctl

2021-01-09 Thread Todd C . Miller
On Sat, 09 Jan 2021 14:39:53 -0800, Greg Steuck wrote: > How's this instead? OK? > > Tested with the usual diff of before/after sysctl outputs and a random > sysctl -w poke. > > Subject: [PATCH] Split hierarchical calls into kern_sysctl_dirs > > Removed a rash of +/-1 and made both functions short

games/canfield bug

2021-01-21 Thread Todd C . Miller
Paul Janzen reported that if you try to resize an xterm while canfield is running, canfield suspends itself. This is due to the curses getch() function returning KEY_RESIZE. However, canfield only expects to read 7-bit ascii characters and so uses a mask of 0x7f. Since KEY_RESIZE & 0x7f == 0x1a (

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

2021-01-21 Thread Todd C . Miller
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 actually change size. This can happen, for example, when the xterm font is ch

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

2021-01-21 Thread Todd C . Miller
On Thu, 21 Jan 2021 19:53:48 +0100, Hiltjo Posthuma wrote: > Yes please!, I've also run into this issue on OpenBSD with the "catpoint" > presentation program. I've been meaning to send the exact same backport patch > . > > The upstream snapshot version of ncurses compiles fine on OpenBSD and I've

ldapd(8): Xr ldap(1)

2021-01-28 Thread Todd C . Miller
Add ldap(1) to SEE ALSO in ldapd(8). I don't think there is a need to add it to ldapctl(8) or ldapd.conf(5). - todd Index: usr.sbin/ldapd/ldapd.8 === RCS file: /cvs/src/usr.sbin/ldapd/ldapd.8,v retrieving revision 1.14 diff -u -p -

Re: sed: make use of getline(3)

2021-01-30 Thread Todd C . Miller
On Sat, 30 Jan 2021 00:43:02 +0100, Christian Weisgerber wrote: > Replace fgetln(3) with getline(3) in sed. > > The mf_fgets() part is from Johann Oskarsson for Illumos/FreeBSD. > > Passes our sed regression tests. OK millert@ - todd

Re: disklabel: pointer deref fix

2021-01-30 Thread Todd C . Miller
On Sat, 30 Jan 2021 01:01:37 +0100, Christian Weisgerber wrote: > Fix a pointer dereference in disklabel(8). > > This looks like somebody wrote *s[0] in place of (*s)[0]. > Which in this case happens to be equivalent, but it still looks > wrong. Probably my bug. OK millert@ - todd

Re: fdisk: make use of getline(3)

2021-01-30 Thread Todd C . Miller
On Sat, 30 Jan 2021 18:02:10 +0100, Christian Weisgerber wrote: > Replace fgetln(3) with getline(3). OK millert@ - todd

Re: disklabel: make use of getline(3)

2021-02-01 Thread Todd C . Miller
On Sun, 31 Jan 2021 15:43:32 +0100, Christian Weisgerber wrote: > Replace fgetln(3) with getline(3). > > Since getline() returns a C string, we don't need to carry around > the length separately. OK millert@ - todd

Re: if calloc() needs nmemb and size, why doesn't freezero()?

2021-02-19 Thread Todd C . Miller
On Fri, 19 Feb 2021 10:38:13 -0600, Luke Small wrote: > In malloc(3): > “If you use smaller integer types than size_t for ‘nmemb’ and ‘size’, then > multiplication in freezero() may need to be cast to size_t to avoid integer > overflow: > freezero(ptr, (size_t)nmemb * (size_t)size);” > Or maybe ev

Re: smtpd: use mx name for sni

2021-03-07 Thread Todd C . Miller
On Sun, 07 Mar 2021 21:47:45 +0100, Eric Faurot wrote: > As spotted by krw@, the mta should use the mx hostname for sni, not > the reverse dns for the peer address. Yes, this matches the previous behavior with ssl_check_name(). OK millert@ - todd

Re: ksh: [vi.c] "clear-screen" bug + patch

2021-03-09 Thread Todd C . Miller
On Tue, 09 Mar 2021 17:53:06 +0100, Benjamin Baier wrote: > Ping I think that in do_clear_screen() full should not be set unless neednl is 0. That is, we should only print the entire prompt if the screen was actually cleared. Otherwise looks good to me. - todd Index: bin/ksh/vi.c ===

Re: mg: Fix Coverity Scan warning: Insecure data handling

2021-03-09 Thread Todd C . Miller
On Tue, 09 Mar 2021 20:14:19 +, Mark Lumsden wrote: > Here is a diff from Joachim Wiberg's version of mg. > > "The strlcpy() function is guaranteed to never copy more than 'len - 1' > bytes, so there is no need to check if we copied more. This is a bogus > warning since the introduction of st

Re: quiz: Fix multi-line questions (trailing newline)

2021-03-09 Thread Todd C . Miller
On Tue, 09 Mar 2021 22:04:42 +0100, Christian Weisgerber wrote: > Thanks a lot for figuring this out! I finally got around to looking > at your patch. Once we have nul-terminated lines, appdstr() can > be replaced with realloc() and strlcat(). I don't think your use of qlen is safe since it is

Re: ksh: [vi.c] "clear-screen" bug + patch

2021-03-10 Thread Todd C . Miller
Now the the clear screen change has been committed, here's the insert mode ^R (redraw) diff again with a man page update. Note that ^R is already supported in command mode. OK? - todd Index: bin/ksh/ksh.1 === RCS file: /cvs/src/bi

Re: quiz: Fix multi-line questions (trailing newline)

2021-03-10 Thread Todd C . Miller
On Wed, 10 Mar 2021 21:15:13 +0100, Christian Weisgerber wrote: > Right. Next iteration: Looks better, one minor nit inline. - todd > Index: quiz.c > === > RCS file: /cvs/src/games/quiz/quiz.c,v > retrieving revision 1.30 > diff

Re: Remove extra pointer to gzFile in grep(1)

2021-03-10 Thread Todd C . Miller
On Wed, 10 Mar 2021 16:46:32 -0500, Josh Rickmar wrote: > The compress(3) family of utility functions return and operate on > gzFile, a typedef for void*. The extra pointer to this gzFile in > grep(1) can be removed. Other uses of these compress(3) functions in > tree (spamd, mandoc, smtpd) do n

Re: quiz: Fix multi-line questions (trailing newline)

2021-03-10 Thread Todd C . Miller
On Wed, 10 Mar 2021 22:49:13 -0500, Alex Karle wrote: > > This would now be clearer as: > > > > if (qlen > 0 && qp->q_text[qlen - 1] == '\\') { > > I agree this is clearer, but I think we'll need a `qlen = 0` > initialization up above the while loop if we go with this variatio

Re: ksh vi.c: define CTRL locally

2021-03-11 Thread Todd C . Miller
On Thu, 11 Mar 2021 12:44:18 +0100, Benjamin Baier wrote: > lets's sync up vi.c with emacs.c and define CTRL locally. > Makes the portable version work on FreeBSD https://github.com/ibara/oksh/issu > es/59 > And as a bonus makes ksh -DSMALL compile with -DVI. Thanks, I committed this without the

pppoe(4): describe what happens if RFC 4638 is not supported

2021-03-16 Thread Todd C . Miller
I think it is helpful to tell the user what happens if the remote endpoint doesn't support RFC 4638. OK? - todd Index: share/man/man4/pppoe.4 === RCS file: /cvs/src/share/man/man4/pppoe.4,v retrieving revision 1.34 diff -u -p -u -r

Re: pppoe(4): describe what happens if RFC 4638 is not supported

2021-03-16 Thread Todd C . Miller
On Tue, 16 Mar 2021 13:59:20 +0100, Klemens Nanni wrote: > It doesn't hurt however to mention the specific message such that users > can tell *when* that happens; perhaps add it under DIAGNOSTICS as the > various wifi driver manuals, e.g. athn(4) do? I think it makes more sense to have the infor

Re: btrace: add dry run mode

2021-03-19 Thread Todd C . Miller
On Fri, 19 Mar 2021 13:22:35 +0100, Klemens Nanni wrote: > I argue it should be `-n' like all the daemons, e.g. vmd(8) and other > parsers such as pfctl(8) do. Yes, please. I was about to make the same point. - todd

Re: smtpd: default mta ciphers

2021-04-01 Thread Todd C . Miller
On Thu, 01 Apr 2021 16:34:33 +0200, Eric Faurot wrote: > If not cipher list is specified for a relay rule, fallback to > the global cipher list if defined, rather than libtls default. > This is closer to the previous behavior. OK millert@ - todd

Re: echo(1): check for stdio errors

2022-07-30 Thread Todd C . Miller
On Sat, 30 Jul 2022 18:19:02 -0500, Scott Cheloha wrote: > Bump. The standard's error cases for fflush(3) are identical to those > for fclose(3): > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html > https://pubs.opengroup.org/onlinepubs/9699919799/functions/fclose.html > >

Re: dmesg(8): fail if given positional arguments

2022-08-02 Thread Todd C . Miller
On Tue, 02 Aug 2022 11:52:33 -0500, Scott Cheloha wrote: > dmesg(8) doesn't use any positional arguments. It's a usage error if > any are present. Sure. Ok millert@ - todd

Re: patch: change swblk_t type and use it in blist

2022-08-05 Thread Todd C . Miller
On Sat, 06 Aug 2022 02:19:31 +0200, Jeremie Courreges-Anglas wrote: > This seems fair, but maybe we should just zap the type from sys/types.h and > define it only in sys/blist.h, as done in DragonflyBSD? Fine with me. It is a non-standard type not used by base. - todd

Re: fgetln->getline in games/* (Was: Re: quiz(6): fully switch to getline(3))

2022-08-08 Thread Todd C . Miller
Looks fine to me, though the free(answer) before exit(0) in quiz.c is not needed. OK millert@ - todd

Re: alpha: remove misaligned access emulation code

2022-08-09 Thread Todd C . Miller
On Tue, 09 Aug 2022 19:39:31 -, Miod Vallat wrote: > The alpha part contains code in the kernel to handle unaligned memory > accesses from userland programs, to prevent them from dying in horrible > SIGBUS. > > This made sense in the '90s, but since then people have learned to work > with stri

Re: store pf rules in a tree

2022-08-10 Thread Todd C . Miller
On Wed, 10 Aug 2022 14:38:16 -, Stefan Butz wrote: > this mail includes a patch to store pf rules in a red-black tree. > Currently they are stored in a linked list. > My system configured with 16000 rules takes about 10 minutes > to print them out using `pfctl -sr`. > This patch decreases the

Re: renice(8): don't succeed after 256 errors

2022-08-11 Thread Todd C . Miller
On Thu, 11 Aug 2022 17:55:08 -0500, Scott Cheloha wrote: > Fix is to just set error instead of incrementing it. Sure. OK millert@ - todd

Re: Remove unneeded kern.nselcoll sysctl

2022-08-14 Thread Todd C . Miller
On Sun, 14 Aug 2022 11:13:35 -, Visa Hankala wrote: > Remove unneeded kern.nselcoll sysctl. > > The last use of this sysctl in base was removed over two weeks ago. > Debian Code Search does not show any uses of the KERN_NSELCOLL macro. OK millert@ - todd

Re: installboot: clarify how -p only sets up the filesystem

2022-08-18 Thread Todd C . Miller
On Thu, 18 Aug 2022 11:51:19 -, Klemens Nanni wrote: > I've checked all usage combination of flags and arguments, the new code > does what the new synopsis says. I agree with the general direction but have one concern. See inline. - todd > Index: installboot.c > ==

Re: installboot: clarify how -p only sets up the filesystem

2022-08-18 Thread Todd C . Miller
On Thu, 18 Aug 2022 18:53:41 -, Klemens Nanni wrote: > root is now initalised before the verbose check so it is independent of > -v usage and happens after prepare code, indicating that -p does not > care about -r. OK millert@ - todd

Re: vnconfig: fix usage

2022-08-19 Thread Todd C . Miller
On Fri, 19 Aug 2022 18:32:12 -, Klemens Nanni wrote: > The manual has it right about -k and -K being mutually exclusive; > adapt the internal text. > > Merge the printf calls while here. OK millert@ for making usage match the manual. - todd

Re: vnconfig: zap useless cast

2022-08-19 Thread Todd C . Miller
On Fri, 19 Aug 2022 18:35:26 -, Klemens Nanni wrote: > opendev(3) takes a const char *, just what getinfo() provides. > > I see no point in casting away the const; no amd64 object change. OK millert@ - todd

Re: vnconfig: fix usage

2022-08-19 Thread Todd C . Miller
On Fri, 19 Aug 2022 18:47:26 -, Klemens Nanni wrote: > Can also do just that. > > For install media it could be worth it since a single fprintf(3) call > saves some bits in text, but vnconfig(8) is not on amy install media... Your original diff is OK with me, sorry if that wasn't clear. - t

Re: libutil: opendev: require block/character devices

2022-08-24 Thread Todd C . Miller
On Wed, 24 Aug 2022 20:06:00 -, Klemens Nanni wrote: > Feedback? Am I missing anything? If fstat(2) fails you should not try to access sb. Perhaps: if (((dflags & OPENDEV_BLCK) && ... should be an "else if (..." Otherwise looks OK to me. - todd

Re: libutil: opendev: require block/character devices

2022-08-25 Thread Todd C . Miller
On Thu, 25 Aug 2022 05:36:53 -, Klemens Nanni wrote: > Ah yes, the failure check does not return early but falls through, so > all further logic needs to check fd and/or errno (like the isduid() case > already does). OK millert@ - todd

Re: libutil: opendev: require block/character devices

2022-08-25 Thread Todd C . Miller
On Thu, 25 Aug 2022 11:50:31 -, Klemens Nanni wrote: > And this should use the ternary operator, as this would still succeed > if path is a character device even though OPENDEV_BLCK was passed. Sure. OK millert@ - todd

Re: add sendmmsg and recvmmsg systemcalls

2022-08-30 Thread Todd C . Miller
On Wed, 31 Aug 2022 00:19:20 +0200, Moritz Buhl wrote: > On Tue, Aug 30, 2022 at 10:59:43PM +0200, Claudio Jeker wrote: > > And nsd in base. It seems unbound does not use recvmmsg. > > After 'make -f Makefile.bsd-wrapper config' recvmmsg is picked up. > The config compile test currently defines N

Re: installboot: reflect script failure in exit code

2022-09-08 Thread Todd C . Miller
On Thu, 08 Sep 2022 20:04:58 -, Klemens Nanni wrote: > Here's the full diff to fsck and newfs failure on all architectures. > > This is a regular programming issue around system(3) that has nothing to > do with bootloaders or installboot per se. > > I'd be great to get this in to make further

Re: init(8): signal handler boolean needs to be "volatile"

2022-09-09 Thread Todd C . Miller
On Fri, 09 Sep 2022 14:05:46 -0500, Scott Cheloha wrote: > The variable "clang" is modified from a signal handler. It should be > of type sig_atomic_t and it needs to be volatile. Right. OK millert@ - todd

Re: top(1): remove last vestiges of "last pid"

2022-09-09 Thread Todd C . Miller
On Fri, 09 Sep 2022 20:19:26 -0500, Scott Cheloha wrote: > millert@ removed most of the "last pid" pieces from top(1) in 1997: > > http://cvsweb.openbsd.org/src/usr.bin/top/machine.c?rev=1.7&content-type=text > /x-cvsweb-markup > > Some small bits remain, though. Can we remove the rest? Sure. O

Re: ftp(1) connection timeouts and hostnames with multiple addresses

2022-09-13 Thread Todd C . Miller
On Sat, 09 Jul 2022 12:53:17 +0100, Stuart Henderson wrote: > I'm trying to teach ftp(1) to do something like gui web browsers do > and reduce the HTTP/HTTPS connection timeout from the default (75 seconds) > if there are multiple addresses behind a hostname. > > There's an existing connection tim

Re: ftp(1) connection timeouts and hostnames with multiple addresses

2022-09-13 Thread Todd C . Miller
On Tue, 13 Sep 2022 20:21:58 +0100, Stuart Henderson wrote: > Oh great, that works very nicely for this use case, thank you. Connecting > via a proxy also still works as I'd expect. I'm basically OK with that > diff though I'd like to test the installer (I have some mkb/mkr running > now). Great.

Re: ksh.1: == in [[ does pattern matching as well

2022-09-13 Thread Todd C . Miller
On Tue, 13 Sep 2022 19:26:47 -, Klemens Nanni wrote: > install.sub uses [[ foo == f*o ]] extensively, yet ksh(1) only documents > pattern matching for the = and != operators. Think of the wasted bytes in install.sub! > Just like with [, = and == behave the same in [[ last time I checked. > >

Re: ksh.1: == in [[ does pattern matching as well

2022-09-13 Thread Todd C . Miller
OK millert@ for the revised diff. - todd

Re: sysupgrade - timezone

2022-09-19 Thread Todd C . Miller
On Mon, 19 Sep 2022 23:06:13 +0200, Hrvoje Popovski wrote: > after sysupgrade I'm having GMT > > OpenBSD 7.2 (GENERIC.MP) #736: Mon Sep 19 17:56:55 GMT 2022 > r620-1# date > Mon Sep 19 21:01:14 GMT 2022 > > r620-1# ls -apl /etc/localtime > lrwxr-xr-x 1 root wheel 33 Feb 10 2022 /etc/localtime

Re: sysupgrade - timezone

2022-09-19 Thread Todd C . Miller
There was a bad diff in that snapshot that caused tzset() to ignore /etc/localtime. - todd

Re: sysupgrade - Reading from socket: Undefined error: 0

2022-09-20 Thread Todd C . Miller
On Tue, 20 Sep 2022 08:50:10 +0200, Florian Obser wrote: > Is this somehow coming from the non-blocking connect diff? I can't spot > it though... I don't think so, the ktrace shows that read(2) is returning 0 long after connect. If the socket was left in non-blocking mode I could see that causin

Re: install.sub: Replace temporary file with variable

2022-09-27 Thread Todd C . Miller
On Tue, 27 Sep 2022 13:49:10 -, Klemens Nanni wrote: > The double quotes retain the newlines; without them column(1) would > print a single line (possibly longer than 80 chars). Don't you also need double quotes around $_CKPATCH: if [[ -n $_CKPATCH ]]; then in case it contains mult

Re: install.sub: Replace temporary file with variable

2022-09-27 Thread Todd C . Miller
On Tue, 27 Sep 2022 11:28:59 -0400, Josiah Frentsos wrote: > From ksh(1): > > [[ expression ]] > Similar to the test and [ ... ] commands (described later), with > the following exceptions: > > o Field splitting and file name generation are not >

Re: wc(1): add -L flag to write length of longest line

2022-09-30 Thread Todd C . Miller
On Thu, 29 Sep 2022 23:30:54 -0400, Daniel Dickman wrote: > > On Sep 29, 2022, at 8:24 PM, Joerg Sonnenberger wrote: > > > > On Thu, Sep 29, 2022 at 08:39:16PM +1000, Jonathan Gray wrote: > >> wc counts items in files. Finding the longest item indeed sounds > >> like a task better suited to aw

Re: rarpd: unveil /tftpboot only if needed

2022-10-02 Thread Todd C . Miller
On Sun, 02 Oct 2022 12:33:21 -, Klemens Nanni wrote: > -t Only honour a request if the server (the host that rarpd is > running on) can "boot" the target; that is, if a file or > directory called /tftpboot/ipaddr exists, where ipaddr is the > ta

tzset(3): update man page to reality

2022-10-03 Thread Todd C . Miller
We did not document tzname, timezone or daylight and the rules regarding pathnames was not entirely clear. I think it is worth mentioning that unless your program calls chroot(2), you probably don't need to call tzset(3). Opinions? - todd Index: lib/libc/time/tzset.3 ==

Re: tzset(3): update man page to reality

2022-10-03 Thread Todd C . Miller
On Mon, 03 Oct 2022 13:27:05 -0600, "Todd C. Miller" wrote: > We did not document tzname, timezone or daylight and the rules > regarding pathnames was not entirely clear. > > I think it is worth mentioning that unless your program calls > chroot(2), you probably d

Re: tftpd: add -R for read-only mode/reduced pledges

2022-10-04 Thread Todd C . Miller
On Tue, 04 Oct 2022 09:24:04 -, Klemens Nanni wrote: > > we were read-only believers a long time ago, and it seems the world has > > caught up to our way of thinking so yes maybe it is time to make it an > > option you must specify. > > I like the idea, then -c should logically imply -w. Look

Re: install.sub: sh is not make, use newlines

2022-10-04 Thread Todd C . Miller
On Tue, 04 Oct 2022 18:17:02 -, Klemens Nanni wrote: > On Tue, Sep 20, 2022 at 11:19:38AM +, Klemens Nanni wrote: > > sh(1) happily accepts newlines inside double quotes just like in the > > script itself: > > > > $ sh -c "echo foo > > > echo bar" > > foo > > bar > > > >

Re: install.sub: Replace temporary file with variable

2022-10-04 Thread Todd C . Miller
On Tue, 04 Oct 2022 17:58:15 -, Klemens Nanni wrote: > On Tue, Sep 27, 2022 at 09:32:15AM -0600, Todd C. Miller wrote: > > On Tue, 27 Sep 2022 11:28:59 -0400, Josiah Frentsos wrote: > > > > > From ksh(1): > > > > > > [[ expression ]]

Re: ksh: trigger ERR trap on permanent I/O redirection failure

2022-10-08 Thread Todd C . Miller
On Sat, 08 Oct 2022 16:01:18 -, Klemens Nanni wrote: > Account for this to make permanent redirection failure trigger the ERR > trap: > > $ ./obj/ksh -c 'trap "echo ERR" ERR ; exec >/' > ksh: cannot create /: Is a directory > ERR > > Also add three new regress cases covering

Re: ksh: errexit executes ERR trap twice

2022-10-11 Thread Todd C . Miller
On Mon, 10 Oct 2022 20:58:29 -, Klemens Nanni wrote: > The ERR trap is supposed to be run once, regardless of errexit: > > $ ksh -c 'trap "echo ERR" ERR; false' > ERR > $ ksh -c 'trap "echo ERR" ERR; false' -e > ERR > ERR > > This duplication is a regression of th

Re: sparc64: ofwboot: no incremental builds due to broken libsa/libz dep

2022-10-11 Thread Todd C . Miller
This problem is not confined to sparc64 is it? At least macppc seems to have the same issue. Some, like amd64 and i386, cheat and just pull in the 4 source files from the libz directory. It looks like alpha has its own libz and libsa directories which seems even worse. - todd

Re: sparc64: ofwboot: no incremental builds due to broken libsa/libz dep

2022-10-11 Thread Todd C . Miller
On Wed, 12 Oct 2022 03:01:04 +0400, Klemens Nanni wrote: > sparc64 also has its own under stand/, > or do you mean that the alpha one is worse than the sparc64? Oh yes, the alpha one is needlessly complicated. I suppose this is not surprising considering the source. - todd

Re: ps.1: control terminal -> controlling terminal

2022-10-13 Thread Todd C . Miller
On Thu, 13 Oct 2022 14:21:11 +0100, Jason McIntyre wrote: > hi. i'm not super up on the terminology here, but i do see we still have > other pages that talk about "control terminal". if any developer wants > to signal a clear desire to make such changes we can do that. The current term is "contro

gunzip: support .zip files with a single member

2022-10-13 Thread Todd C . Miller
rators; *sep != '\0'; sep++) { if ((suf = strrchr(infile, *sep)) == NULL) Index: usr.bin/compress/zipopen.c =========== RCS file: usr.bin/compress/zipopen.c diff -N usr.bin/compress/zipopen.c --- /dev/null 1 Jan 1970 0

Re: gunzip: support .zip files with a single member

2022-10-13 Thread Todd C . Miller
On Fri, 14 Oct 2022 09:41:18 +1100, Jonathan Gray wrote: > The extracted file has the name of the zip archive without '.zip' > instead of the name of the file in the zip archive. > > Is that the behaviour of GNU gunzip? It isn't what I expected. Yes, that is what GNU zip does too. If you use th

Re: gunzip: support .zip files with a single member

2022-10-13 Thread Todd C . Miller
On Fri, 14 Oct 2022 10:26:33 +1100, Jonathan Gray wrote: > I can't think of another reason for the single file limit. It must be. > > With most of the changes under SMALL or not built, ramdisks still fit? It should, none of the new code is compiled for the ramdisk version. - todd

Re: gunzip: support .zip files with a single member

2022-10-13 Thread Todd C . Miller
On Thu, 13 Oct 2022 14:14:28 -0600, "Todd C. Miller" wrote: > GNU gzip support uncompressing .zip files that contain a single > member. This can be very convenient when dealing with email > attachments that use zip instead of gzip to compress a single file > (I'm loo

Re: gunzip: support .zip files with a single member

2022-10-17 Thread Todd C . Miller
!= NULL; i++) { if (strcmp(suf, suffixes[i]) == 0) return (suf - 1); Index: usr.bin/compress/zipopen.c === RCS file: usr.bin/compress/zipopen.c diff -N usr.bin/compress/zip

  1   2   3   4   5   6   7   8   9   10   >