Re: update acct(5)

2019-07-29 Thread Todd C . Miller
On Mon, 29 Jul 2019 18:14:14 +0100, Ricardo Mestre wrote: > Sorry, I'm not too good with words for manpages. > > Is this good enough? I'll commit the AUNVEIL bit separately anyway in a few > minutes. > > And while we are here what about ACOMPAT? It was used for PDP-11 compat on va > x, > but we do

Re: SIGSEGV in libedit

2019-08-05 Thread Todd C . Miller
On Mon, 05 Aug 2019 17:31:51 +0900, YASUOKA Masahiko wrote: > The diff basically is to do the same thing which is done on the > upstream, but it also replaces h_malloc() and tok_malloc() which the > upstream didn't replace yet. This only changes the reallocarray(3) calls that don't actually reall

Re: find.1: Use -delete in EXAMPLES

2019-08-22 Thread Todd C . Miller
The point of that example is to show how to safely use xargs. Since find now has its own built-in xargs support perhaps we should adapt the example to use that instead. We can also list the -delete method as an alternative. E.g. $ find . \( -name \*.jpg -o -name \*.gif \) -exec rm {} + or

Re: find.1: Use -delete in EXAMPLES

2019-08-22 Thread Todd C . Miller
On Thu, 22 Aug 2019 11:06:12 -0600, "Theo de Raadt" wrote: > Todd C. Miller wrote: > > > The point of that example is to show how to safely use xargs. Since > > find now has its own built-in xargs support perhaps we should adapt > > the example to use that in

Re: find.1: Use -delete in EXAMPLES

2019-08-22 Thread Todd C . Miller
On Thu, 22 Aug 2019 11:10:43 -0600, "Theo de Raadt" wrote: > Todd C. Miller wrote: > > > On Thu, 22 Aug 2019 11:06:12 -0600, "Theo de Raadt" wrote: > > > > > Todd C. Miller wrote: > > > > > > > The point of that example is

Re: find.1: Use -delete in EXAMPLES

2019-08-22 Thread Todd C . Miller
On Thu, 22 Aug 2019 19:20:53 +0200, Klemens Nanni wrote: > I concur. We can at least showcase the "batching" version that passes > multiple arguments to rm(1) while also mentioning `-delete'. > > Both find(1)'s `-print0' and xarg(1)'s `-0' reference each other, I'd > say that is enough together w

Re: smtpd: change PATH for filters

2019-09-03 Thread Todd C . Miller
On Mon, 02 Sep 2019 21:15:23 +0200, Martijn van Duren wrote: > https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html > {_POSIX_ARG_MAX} > Maximum length of argument to the exec functions including environment da > ta. > Value: 4 096 Note that this is the minimum value PO

Re: smtpd: change PATH for filters

2019-09-03 Thread Todd C . Miller
On Tue, 03 Sep 2019 17:11:22 +0200, Martijn van Duren wrote: > I choose this value because I hit the maximum command length of the > shell before. This way I'm somewhat confident that the shell doesn't > do something weird with my command if we ever overflow it's internal > buffer. So I based it o

Re: /etc/examples/sysctl.conf wrong Xref + key lacking information

2019-09-10 Thread Todd C . Miller
On Tue, 10 Sep 2019 12:59:51 +0200, Solene Rapenne wrote: > I looked at /etc/examples/sysctl.conf on an amd64 system and found 2 > things: > > - file refers to sysctl(3) and sysctl(8). sysctl(3) doesn't exists but > sysctl(2) exists, I think we want a 2 Yes, sysctl(3) was renamed to sysctl(2) s

Re: assert() triggered in flex

2019-09-21 Thread Todd C . Miller
On Sat, 21 Sep 2019 20:21:12 +0800, Michael Mikonos wrote: > When I remembered to check if upstream flex had fixed the sf_pop() > issue I found their fix was a little different: > https://github.com/westes/flex/commit/9ba6e5283efd2fe454d3bc92eca960b3ebd9129 > 4 > > Notably, FLEX_EXIT() is not call

Re: smtpd: mail.* tempfail vs permfail

2019-09-26 Thread Todd C . Miller
On Wed, 25 Sep 2019 15:23:06 +0200, Martijn van Duren wrote: > I talked to gilles@ about this and he's somewhat inclined to agree with > me that this is a TEMPFAIL situation. Even if the directory where the > mail is supposed to be delivered is permanently not accessible I'd > argue that we should

Re: etc.arm64/login.conf, sync pbuild class with amd64

2019-10-07 Thread Todd C . Miller
On Mon, 07 Oct 2019 15:25:13 +0100, Stuart Henderson wrote: > Attempting to build Firefox on aarch64 needs at least 4.5GB but I think > it would be better to just sync with amd64. OK? Makes sense. OK millert@ - todd

Re: struct proc: track process starting time as an uptime

2019-10-17 Thread Todd C . Miller
On Wed, 16 Oct 2019 10:23:52 -0500, Scott Cheloha wrote: > Tracking the process starting time as an uptime fixes the classic > "init(8) started in 1969" bug in ps(1) when your CMOS battery dies. > > In general it lets us track how long a process has been running > correctly regardless of whether o

Re: right/ tzdata files (was ports@ Re: (Mozilla) Thunderbird time zone issue)

2019-10-26 Thread Todd C . Miller
On Sat, 26 Oct 2019 12:15:33 +0100, Stuart Henderson wrote: > The way these files are supposed to work is that you set the system > clock to the time with leap-seconds included (UTC+leap, or TAI-10) and > copy the entire "right" set of files to the main zoneinfo directory > (upstream provides them

Re: Ship ubsan_minimal library in base?

2022-02-05 Thread Todd C . Miller
On Fri, 04 Feb 2022 20:46:48 -0800, Greg Steuck wrote: > How do people feel about shipping the minimal UBSan runtime library[1] > in the base system? It takes very little to build (Makefile + a few > ifdefs that both jca@ and I hacked together). The library is tiny and > useful enough for finding

Re: drop please from manual pages

2022-02-05 Thread Todd C . Miller
On Sat, 05 Feb 2022 23:06:32 +1100, Jonathan Gray wrote: > drop please from manual pages excluding third party parts of tree > suggested by multiple documentation style guides OK millert@ - todd

Re: ypldap: fix -Wunused-but-set-variable warnings

2022-02-05 Thread Todd C . Miller
On Sat, 05 Feb 2022 14:38:14 +0100, Christian Weisgerber wrote: > Anybody? > The commit history of ypldap does not suggest a single responsible > person I could pin down. OK millert@ - todd

Re: head(1): check for stdio errors

2022-02-06 Thread Todd C . Miller
Since the input is opened read-only I don't see the point in checking the fclose() return value. However, if you are going to do so, you might as well combine it with the ferror() check. E.g. if (ferror(fp) || fclose(fp) == EOF) { warn("%s", name); status

Re: head(1): check for stdio errors

2022-02-07 Thread Todd C . Miller
On Sun, 06 Feb 2022 23:41:26 -0600, Scott Cheloha wrote: > > On Feb 6, 2022, at 20:07, Todd C. Miller wrote: > > > > Since the input is opened read-only I don't see the point in checking > > the fclose() return value. However, if you are going to do so, you >

Re: rev(1): drop "rpath" promise in no-file branch

2022-02-08 Thread Todd C . Miller
On Tue, 08 Feb 2022 10:40:00 -0600, Scott Cheloha wrote: > We don't need "rpath" if we're only processing the standard input. Sure. OK millert@ - todd

Re: look(1): drop "rpath" promise after open(2)/fstat(2)

2022-02-09 Thread Todd C . Miller
On Tue, 08 Feb 2022 19:37:26 -0600, Scott Cheloha wrote: > - pledge(2) initially with "stdio rpath" at the top of main(). > We know we need to read a file at this point but don't yet > know which one. > > - pledge(2) down to "stdio" after we have opened the file > in question and called fsta

Re: explicit_bzero vs ASAN on linux

2022-02-09 Thread Todd C . Miller
On Wed, 09 Feb 2022 11:35:58 +0100, Theo Buehler wrote: > On clang we can use __has_feature(), but that doesn't exist on > gcc which defines __SANITIZE_ADDRESS__ if it compiles with > -fsanitize=address. > > This doesn't warn on sparc64 and works in my test setups. It's a little ugly but since th

Re: rpki-client: disk space warning on btrfs

2022-02-10 Thread Todd C . Miller
On Thu, 10 Feb 2022 09:13:25 +0100, Theo Buehler wrote: > This is purely cosmetic. I did some testing on fedora which ships with > btrfs by default. btrfs is special in that df -i and other tools always > report 0 inodes. As a consequence, each rpki-client run prints the disk > space warning, whic

Re: superfluous words in lib/libc/gen/statvfs.3 and sys/sys/statvfs.h

2022-02-11 Thread Todd C . Miller
On Fri, 11 Feb 2022 08:21:38 +0100, alf wrote: > there seem to be some superfluous words in > lib/libc/gen/statvfs.3 and sys/sys/statvfs.h . > "(unit f_frsize)" can be removed since in the man page > it is explicitely mentioned directly below: > " The fields of type fsblkcnt_t are reported in unit

Re: dhcpleased(8) vs. microsoft dhcp server

2022-02-15 Thread Todd C . Miller
On Tue, 15 Feb 2022 20:01:52 +0100, Florian Obser wrote: I think you need that to be: /* MUST delete trailing NUL, per RFC 2132 */ slen = dho_len; while (slen > 0 && p[slen - 1] == '\0') slen--; to avoid underflow if the string happens to consist entirely

Re: dhcpleased(8) vs. microsoft dhcp server

2022-02-15 Thread Todd C . Miller
On Tue, 15 Feb 2022 20:18:45 +0100, Florian Obser wrote: > Also fixes a whitespace issue while here. > > if (dho_len < 1) > goto wrong_length; > > is redundant now, but I want to keep the pattern of checking the length > right after identifying the option. Right, makes sense.

Re: Import seq(1) from FreeBSD

2022-02-21 Thread Todd C . Miller
On Sun, 13 Feb 2022 12:07:31 -0800, Greg Steuck wrote: > I noticed that despite the OKs the code didn't submitted. Should we > revive this diff now and continue in the tree? > > I have vested interest: I don't want to fix up lang/ghc test suite which > is full of seq(1). Here's an updated diff th

Re: seq: check for asprintf failure

2022-02-22 Thread Todd C . Miller
On Wed, 23 Feb 2022 00:04:07 +0100, Theo Buehler wrote: > Hard to hit. Nevertheless it seems better to error out than to > crash in strcmp() Sure. OK millert@ - todd

Re: [patch] LOGIN_SETENV fails when login.conf is missing

2022-02-26 Thread Todd C . Miller
On Sat, 26 Feb 2022 11:16:44 -0600, Matthew Martin wrote: > Anton spotted a doas regression failure in t-run-keepenv-path after the > change to doas for LOGIN_SETALL. Since that test runs doas in a chroot > and the setup does not create a login.conf, login_getclass in > login_cap.c will return a l

Re: httpd: simplify .gz handling a bit

2022-03-02 Thread Todd C . Miller
On Wed, 02 Mar 2022 19:26:46 +0100, Theo Buehler wrote: > I think it's easier to use a single snprintf call. Also drop a few > unnecessary parentheses. Seems like an improvement. OK millert@ - todd

Re: add -k / --keep for gzip(1)

2022-03-03 Thread Todd C . Miller
On Thu, 03 Mar 2022 13:13:16 +0100, Solene Rapenne wrote: > The following diff adds support for -k flag to keep the input file for > gzip / compress when compressing, and the input file (the compressed > one) for gunzip / uncompress > > This will improve uses cases like: zcat -f "${file}" > "${fil

Re: add -k / --keep for gzip(1)

2022-03-03 Thread Todd C . Miller
On Thu, 03 Mar 2022 15:11:13 +, Miod Vallat wrote: > > I think this makes sense if only for better GNU gzip compatibility. > > OK millert@ > > But does the `-k' flag needs to be added to compress(1) too? No, it just makes usage() slightly more complicated. But that diff was missing an update

Re: add -k / --keep for gzip(1)

2022-03-05 Thread Todd C . Miller
On Sun, 06 Mar 2022 02:58:30 +0100, Jeremie Courreges-Anglas wrote: > I'm not sure what you mean here. Solene's diff added -k to both > compress(1) and gzip(1) (and their uncompressor counterparts). > Adding -k to gzip/gunzip only would indeed make the usage() slightly > more complicated. > > So

Re: ssh: xstrdup(): use memcpy(3)

2022-03-11 Thread Todd C . Miller
On Wed, 09 Mar 2022 19:20:08 -0600, Scott Cheloha wrote: > The strdup(3) implementation in libc uses memcpy(3), not strlcpy(3). > > There is no upside to using strlcpy(3) here if we know the length of > str before we copy it to the destination buffer. Sure, using memcpy() here is fine since the l

Re: add -k / --keep for gzip(1)

2022-03-13 Thread Todd C . Miller
On Sun, 13 Mar 2022 13:26:13 +0100, Jeremie Courreges-Anglas wrote: > Works fine. Here's an updated diff with suggestions: > - "k" was not completely removed from compress's struct compressor opt > string, and was not needed in null_method > - try to keep the *flag variables ordered > - rework

Re: issue with login.conf(5) rtable and su -l user

2022-03-13 Thread Todd C . Miller
On Sun, 13 Mar 2022 12:02:03 -0500, Matthew Martin wrote: > Ignoring -L which already honors rtable, su has three cases: > -l (asme=0 asthem=1) > -m (asme=1 asthem=0) >(asme=0 asthem=0) > > -l should honor rtable; I am not sure about the other two. I think the > least suprising would be fo

setclasscontext: support LOGIN_SETRTABLE too

2022-03-22 Thread Todd C . Miller
I think it makes sense to accept LOGIN_SETRTABLE for setclasscontext(3) as well. Currently, it will be cleared out of the flags. - todd Index: lib/libc/gen/login_cap.3 === RCS file: /cvs/src/lib/libc/gen/login_cap.3,v retrieving re

Re: pfioctl goto fail

2022-03-23 Thread Todd C . Miller
On Wed, 23 Mar 2022 15:53:21 +0100, Alexander Bluhm wrote: > Hi, > is a big switch and when looking at a break you need more context > to see where it jumps to. > > I would like to use goto fail consistently to leave the big switch. > break is used for inner switches and loops. This makes it easi

Re: fix very small ntpd leak

2022-03-23 Thread Todd C . Miller
On Wed, 23 Mar 2022 16:59:06 +0100, Otto Moerbeek wrote: > This is a bug that dlg reported last week. Serendepity or not? :-) > > This is my diff that uses an approach I like a litle bit better. Since client_peer_init() is always called after new_peer() there's no reason I can see for query to be

Re: vfs: do not export vnode_{hold,free}_list outside kern/vfs_subr.c

2022-03-27 Thread Todd C . Miller
On Sun, 27 Mar 2022 15:05:00 +0200, Sebastien Marie wrote: > The following diff removes vnode_hold_list, vnode_free_list extern references > , > and `struct freelst` definition from sys/vnode.h > > `struct freelst` definition (TAILQ_HEAD) is moved where used, inside vfs_subr > .c. OK millert@

Re: [diff] gzip verbose message

2022-04-10 Thread Todd C . Miller
On Sun, 10 Apr 2022 13:24:15 +0200, Jeremie Courreges-Anglas wrote: > The diff below keeps the same output by default and outputs the same as > GNU gzip(1) is -k is given. OK millert@ - todd

Re: login_fbtab glob

2022-04-15 Thread Todd C . Miller
On Thu, 14 Apr 2022 17:52:37 -0500, joshua stein wrote: > login_fbtab(3) supports wildcards but only for every file in a > directory (/path/*). > > This makes it use glob(3) so it can also support more specific > wildcards like /path/file* Yes, it is better to use glob(3) than something custom.

Re: login_fbtab glob

2022-04-15 Thread Todd C . Miller
On Fri, 15 Apr 2022 13:12:03 -0500, joshua stein wrote: > Thanks, both applied. Looks good to me but needs a man page update. - todd

Re: login_fbtab glob

2022-04-15 Thread Todd C . Miller
On Fri, 15 Apr 2022 13:28:33 -0500, joshua stein wrote: > Anyone want to bikeshed this language? I think it is more helpful to refer to glob(7) than glob(3). Perhaps something like this. - todd Index: share/man/man5/fbtab.5 === RC

Re: readconf.c: Avoid a xstrdup

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:41:10 +0200, Martin Vahlensieck wrote: > There is no need to duplicate options->send_env[i] only free it > in all cases. Just use options->send_env[i] directly. Good catch, match_pattern() takes const char * arguments so there is no danger there. - todd

Re: ssh-xmss.c: Add missing includes

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:42:52 +0200, Martin Vahlensieck wrote: > malloc(3) and friends require stdlib.h, SIZE_MAX requires stdint.h. You are correct. The other xmss files get these includes via xmss_commons.h, but ssh-xmss.c does not. - todd

Re: xmss_hash.c: remove superfluous includes

2022-04-19 Thread Todd C . Miller
On Tue, 19 Apr 2022 11:43:35 +0200, Martin Vahlensieck wrote: > Neither openssl/evp.h nor openssl/hmac.h are required. Right. - todd

Re: const openpty et al.

2022-04-20 Thread Todd C . Miller
On Tue, 19 Apr 2022 21:30:25 -0500, Matthew Martin wrote: > On Thu, Apr 07, 2022 at 06:11:45PM -0500, Matthew Martin wrote: > > const the termp and winp arguments for openpty and related. This matches > > the prototypes for openpty and forkpty in glibc and musl libc. > > ping; has an ok from tb@ [

Re: login_fbtab glob

2022-04-20 Thread Todd C . Miller
On Wed, 20 Apr 2022 09:18:20 -0500, joshua stein wrote: > I like it. Here's the full diff: OK millert@ - todd

Re: obscure vi crash, fix

2022-04-21 Thread Todd C . Miller
On Thu, 21 Apr 2022 09:35:44 -0700, Jeremy Mates wrote: > The cause is an unguarded use of the NULL output pointer. I am pretty > sure an .exrc cannot cause this condition (map rhs requires > something, not nothing) only recompiling with a NULL output string > for some command. > > One fix is to g

Re: obscure vi crash, fix

2022-04-22 Thread Todd C . Miller
Another thing I noticed while testing the fix is that in cl_term_init() while processing the command mapping there is a missing NULL check. However, the check _is_ present for the input mapping loop. The following diff makes the two loops consistent. I'm not sure whether this is worth doing since

vi: apply expandtab to the output of a ! command

2022-04-22 Thread Todd C . Miller
[I originally sent this a year ago but didn't follow up.] This is consistent with vim's expandtab behavior. >From nvi2 (Craig Leres): https://github.com/lichray/nvi2/commit/7d3f43559026e0927032a105b217850feaefec66 I know most of us don't use expandtab but it is helpful when dealing with a codeba

Re: obscure vi crash, fix

2022-04-22 Thread Todd C . Miller
On Fri, 22 Apr 2022 17:38:56 +0200, Theo Buehler wrote: > I would use an extra variable. The simplification alone is a good > argument to do it: Yes, that is nicer. OK millert@ - todd

Re: kstat(1): implement wait with setitimer(2)

2022-04-29 Thread Todd C . Miller
On Thu, 28 Apr 2022 20:54:02 -0500, Scott Cheloha wrote: > Once again, using nanosleep(2) here to print the stats periodically is > flawed. The period will drift. Using setitimer(2)/sigsuspend(2) is > better. Yes, I agree that an interval timer is a better fit. > While here: > > - We don't nee

Re: no gawking in makesyscalls

2022-05-01 Thread Todd C . Miller
On Sun, 01 May 2022 00:48:17 -0400, "Ted Unangst" wrote: > I don't think we need to concern ourselves with cross awk compatibility here. > > Despite the misleading comment, /usr/bin/awk supports toupper. This must have been to support very old versions of awk (pre-nawk) since toupper and tolower

Re: Merge swap-backed and object-backed inactive lists

2022-05-02 Thread Todd C . Miller
On Mon, 02 May 2022 18:39:17 +0200, Martin Pieuchot wrote: > Let's simplify the existing logic and use a single list for inactive > pages. uvmpd_scan_inactive() already does a lot of check if it finds > a page which is swap-backed. This will be improved in a next change. That looks fine to me.

Re: kstat(1): implement wait with setitimer(2)

2022-05-02 Thread Todd C . Miller
On Mon, 02 May 2022 20:39:07 -0500, Scott Cheloha wrote: > Whenever I block signals, deraadt@ rises up out of the floorboards and > says "I hate masking signals, don't do that." > > ... but if millert@ is still fine with the attached patch, which does > sigprocmask(2), I'll go ahead with it. > > >

Re: Mark pw_error __dead in util.h

2022-05-11 Thread Todd C . Miller
On Tue, May 03, 2022 at 10:37:36PM -0500, Matthew Martin wrote: > The function is already marked __dead in passwd.c, so appears to just be > an oversight. Committed, thanks. - todd

Re: eliminate use of fseek(3) inside libc

2022-05-13 Thread Todd C . Miller
On Fri, 13 May 2022 19:33:58 -0700, Philip Guenther wrote: > Diff below converts the last three such uses** and then updates the symbol > naming for fseek to block attempts to reference it in the future so uses > don't accidentally crawl back in. OK millert@ - todd

Re: librthread: validate timespec inputs with timespecisvalid(3)

2022-05-14 Thread Todd C . Miller
On Sat, 14 May 2022 09:31:26 -0500, Scott Cheloha wrote: > ok? OK millert@ - todd

Re: tar extract to stdout

2022-05-26 Thread Todd C . Miller
Our tar's -O flag is only used when creating an archive, it is unused for extraction. I'd prefer that we use the same option letter as GNU tar and bsdtar for this. - todd

Re: obsolete dump options syntax

2022-06-02 Thread Todd C . Miller
On Thu, 02 Jun 2022 14:36:16 +0200, Jan Stary wrote: > That results in the above. What obsolete options format > is this trying to accomodate? The manpage doesn't say - > the options it describes are perfectly getopt()-likable. > Looking at the CVS log, this was already "obsolete" > in the origina

Re: obsolete dump options syntax

2022-06-02 Thread Todd C . Miller
On Thu, 02 Jun 2022 07:43:15 -0600, "Theo de Raadt" wrote: > Hmm, but consider these cases > > dump home > > or > > mkdir 0af > dump 0af > > or > > cd /dev && dump rsd0a True, those would not be handled but isn't the most common usage to pass a fully-qualified path or a device name? The biggest

Re: obsolete dump options syntax

2022-06-02 Thread Todd C . Miller
On Thu, 02 Jun 2022 07:54:02 -0600, "Theo de Raadt" wrote: > I'm fine with a / check, but it also needs documenting. While there can't > we say at least one option must be supplied? How about this? - todd Index: sbin/dump/dump.8

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

2022-07-09 Thread Todd C . Miller
Instead of the existing alarm() mechanism, how about using timeout_connect() from usr.bin/nc/netcat.c? - todd

Re: echo(1): check for stdio errors

2022-07-11 Thread Todd C . Miller
On Sun, 10 Jul 2022 20:58:35 -0900, Philip Guenther wrote: > Three thoughts: > 1) Since stdio errors are sticky, is there any real advantage to checking > each call instead of just checking the final fclose()? Will that really catch all errors? From what I can tell, fclose(3) can succeed even if

Re: syslog.conf(5): example about logging by sender

2018-01-31 Thread Todd C. Miller
On Wed, 31 Jan 2018 20:44:10 +0100, Landry Breuil wrote: > the default etc/syslog.conf has a commented out example for by-prog > logging, but nothing for by-host logging. I fighted a bit with it; so > why not providing an example in the EXAMPLES section of the manpage ? I recently did the same so

Re: syslog.conf(5): example about logging by sender

2018-01-31 Thread Todd C. Miller
On Thu, 01 Feb 2018 01:55:18 +0200, Kapetanakis Giannis wrote: > On 01/02/18 00:06, Todd C. Miller wrote: > > > > Shouldn't this be: > > > > # Log everything coming from host bastion to a separate file > > ++bastion /

Re: syslog.conf(5): example about logging by sender

2018-02-01 Thread Todd C. Miller
OK millert@ for that version. - todd

Re: cron: don't close crontab_fd twice

2018-02-04 Thread Todd C. Miller
On Mon, 05 Feb 2018 09:21:32 +1300, Theo Buehler wrote: > The load_user() function gets a file descriptor from process_crontab(). > It fdopen()s it directly and fclose()s the resulting stream. Then > process_crontab() closes the stream a second time before exiting. > > Since crontab_fd is not load

Re: hostapd: normalize microsecond limit when parsing

2018-02-12 Thread Todd C. Miller
On Mon, 12 Feb 2018 10:08:25 -0600, Scott Cheloha wrote: > I'm unfamiliar with this code, but assigning the microsecond value > without normalizing it for the timeval looks off. That makes sense. There's nothing preventing the user from using values > 100. OK millert@ - todd

Re: date: atoll - > strtonum

2018-02-12 Thread Todd C. Miller
OK millert@ - todd

Re: rename arm64 memhook

2018-02-17 Thread Todd C. Miller
On Sat, 17 Feb 2018 20:10:45 +0100, Mark Kettenis wrote: > Not that vmmap is a much better name, but that's what we use on other > non-pmap-direct architectures. Consistency is good, OK millert@ - todd

Re: shutdown: fork+exec for wall(1) broadcasts

2018-02-22 Thread Todd C. Miller
On Thu, 22 Feb 2018 13:50:13 -0600, Scott Cheloha wrote: > I think setjmping from a signal handler to put a time limit on > pclose is too magical, especially when the alternative doesn't > require much more code. Agreed. > But I do think putting a time limit on our wait for wall to do its > job

Re: shutdown: fork+exec for wall(1) broadcasts

2018-02-22 Thread Todd C. Miller
On Thu, 22 Feb 2018 15:06:04 -0600, Scott Cheloha wrote: > Could that difference effect the behavior of the program in practice? I don't think so. > Attached diff is using the file stream functions still, for comparison. > > But the dprintf diff feels more natural; keeping the stream functions >

Re: times(3): return monotonically increasing values

2018-02-27 Thread Todd C. Miller
On Mon, 26 Feb 2018 19:12:20 -0600, Scott Cheloha wrote: > Reading the latest POSIX description for times(3): > > > Upon successful completion, times() shall return the elapsed > > real time, in clock ticks, since an arbitrary point in the past > > (for example, system start-up time). This point d

Re: times(3): return monotonically increasing values

2018-02-28 Thread Todd C. Miller
On Wed, 28 Feb 2018 09:46:30 -0600, Scott Cheloha wrote: > I want to avoid giving the reader even the slightest impression that > the return value from times(3) can be used for anything but real-time > interval measurement. Mentioning that the value is relative to the > system start time seems to

Re: times(3): return monotonically increasing values

2018-02-28 Thread Todd C. Miller
On Wed, 28 Feb 2018 10:23:24 -0600, Scott Cheloha wrote: > I know it's not customary to put extra details in RETURN VALUES, but > times(3) is a bit unwieldy. How does the attached read? OK by me. - todd

Re: binutils: build with LLVM 6.0.0

2018-03-15 Thread Todd C. Miller
On Thu, 15 Mar 2018 17:23:24 +0100, Patrick Wildt wrote: > diff --git a/gnu/usr.bin/binutils-2.17/include/obstack.h b/gnu/usr.bin/binuti > ls-2.17/include/obstack.h > index 88c2a264adc..8839c48e95f 100644 > --- a/gnu/usr.bin/binutils-2.17/include/obstack.h > +++ b/gnu/usr.bin/binutils-2.17/include

Re: shutdown(8): disallow "++minutes"

2018-03-16 Thread Todd C. Miller
On Fri, 16 Mar 2018 14:23:29 -0500, Scott Cheloha wrote: > Because we increment the timearg pointer, shutdown(8) accepts > stuff like > > shutdown ++10 > > as strtonum(3) allows a single leading '+'. > > Not incrementing leaves the offset in a valid format for strtonum(3) > and disallows stu

Re: dd(1): snprintf+writev -> dprintf

2018-04-02 Thread Todd C. Miller
On Sat, 31 Mar 2018 12:53:52 -0500, Scott Cheloha wrote: > Simpler. OK millert@ - todd

Re: netinet memcpy/free

2018-04-02 Thread Todd C. Miller
On Sat, 31 Mar 2018 15:13:03 -0400, David Hill wrote: > memcpy can be used on freshly allocated memory. Fill in the free size > for it. OK millert@ - todd

Re: mfs free

2018-04-02 Thread Todd C. Miller
On Sat, 31 Mar 2018 15:15:34 -0400, David Hill wrote: > Add the free size. (allocated in mfs_vfsops.c) > > mfsp = malloc(sizeof *mfsp, M_MFSNODE, M_WAITOK | M_ZERO); > devvp->v_data = mfsp; OK millert@ - todd

Re: dd(1): snprintf+writev -> dprintf

2018-04-02 Thread Todd C. Miller
On Sat, 31 Mar 2018 13:41:00 -0600, "Theo de Raadt" wrote: > Let's see. SIGINFO starts. Imagine if the buffering is small (I > don't think it is). If it was small, there could be multiple writes > to the sequence. SIGINT arrives. This will result in stderr output > being a bit garbled. This

Re: Earlier FREF()s

2018-04-02 Thread Todd C. Miller
On Mon, 02 Apr 2018 12:34:27 +0200, Martin Pieuchot wrote: > Here's a diff to move FREF() just after fd_getfile() in sys_kevent(), > sys_lseek() and getvnode(). Looks fine. OK millert@ - todd

Re: Single FRELE() in sys_fstatfs()

2018-04-02 Thread Todd C. Miller
On Mon, 02 Apr 2018 12:51:06 +0200, Martin Pieuchot wrote: > I'd like to ease reviews of the FREF()/FRELE() dances by keeping their > number small. In the case of sys_fstatfs() it's easy to have a single > FRELE() for the corresponding getvnode(). Ok? I actually find the original easier to read

Re: dd(1): snprintf+writev -> dprintf

2018-04-02 Thread Todd C. Miller
On Mon, 02 Apr 2018 10:40:15 -0500, Scott Cheloha wrote: > What do you think about the signal race mentioned here: > > https://marc.info/?l=openbsd-tech&m=152260519904692&w=2 > > deraadt pointed out that blocking SIGINT while SIGINFO is in summary() > has the effect of making the process un-INTabl

Re: plug a memory leak in diff(1)

2018-04-02 Thread Todd C. Miller
On Mon, 02 Apr 2018 21:17:59 +0200, Ingo Schwarze wrote: > * if (a <= b) for (i = a; i <= b; >doas not make sense to me. >If a > b, we have i > b right away, so the loop isn't entered. > * a > b || >does not make sense either, for the same reason: >The for loop itself takes care

Re: patch(1): remove unused header

2018-04-07 Thread Todd C. Miller
On Sat, 07 Apr 2018 10:46:01 +0200, Anton Lindqvist wrote: > Since patch(1) no longer invokes ed(1), pathnames.h can be removed. > _PATH_TMP is still used inside patch.c but including paths.h is > sufficient. OK millert@ - todd

Re: fuse_opt.h and clang 6

2018-04-07 Thread Todd C. Miller
On Sat, 07 Apr 2018 21:33:24 +0200, Jeremie Courreges-Anglas wrote: > At least ports/archivers/fuse-zip fails to build with clang 6, because > of stricter diagnostics: > > -->8-- > c++ -c -O2 -pipe-I/usr/local/include main.cpp \ > -Ilib \ > -o main.o > main.cpp:138:5: error: constant e

Re: video(1): don't use optarg as format string

2018-04-09 Thread Todd C. Miller
On Mon, 09 Apr 2018 11:56:46 -0500, Scott Cheloha wrote: > Always nifty: > > $ video -f '%d%d%d' > video: 31668978116843009-2139062144: No such file or directory > > So, use strlcpy and check for truncation. > > ok? OK millert@ - todd

Re: ksh: count $SECONDS with monotonic clock

2018-04-13 Thread Todd C. Miller
On Fri, 13 Apr 2018 11:11:04 -0500, Scott Cheloha wrote: > So that $SECONDS advances uniformly, independent of the system clock. Why are you including sys/time.h? For struct timespect you only need time.h which is already included. In general, you only need sys/time.h for struct timeval or for

Re: ksh: count $SECONDS with monotonic clock

2018-04-13 Thread Todd C. Miller
On Fri, 13 Apr 2018 19:42:51 +0200, Jeremie Courreges-Anglas wrote: > The diff uses timespecsub: Ah, OK. That's fine then. - todd

Re: FREF(9) in unp_internalize()

2018-04-16 Thread Todd C. Miller
On Mon, 16 Apr 2018 10:19:40 +0200, Martin Pieuchot wrote: > Diff below does FREF(9) earlier instead of incrementing `f_count' by hand. > > The error path is also updated to call FRELE(9) accordingly. Wouldn't it be less error prone to simply add: if (fp != NULL) FRELE(fp

Re: FREF(9) in unp_internalize()

2018-04-17 Thread Todd C. Miller
On Tue, 17 Apr 2018 09:50:49 +0200, Martin Pieuchot wrote: > Sure, here's an updated diff. It also moves the FRELE(9) in the error > loop down as suggested by visa@. OK millert@ - todd

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-02 Thread Todd C. Miller
On Tue, 01 May 2018 13:35:54 -0600, "Theo de Raadt" wrote: > > b) Their working space should be independent of each other. This > > isn't hard, just splitting kd->argbuf into kd->argbuf and > > kd->envbuf. Seems a bit saner. > > > > I think (b) would be the better solution, this seems

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Todd C. Miller
On Thu, 03 May 2018 13:58:35 +0300, Vadim Zhukov wrote: > Here is patch for libkvm that fixes a few memory handling problems. > Most changes are mechanical, with some exceptions: > > 1. Most notable: this splits argv buffer into argv-specific one > and environ-specific one. This makes ps -e

Re: libkvm requires kvm_getargv before kvm_getenv when both needed

2018-05-03 Thread Todd C. Miller
On Thu, 03 May 2018 17:59:39 +0200, Otto Moerbeek wrote: > Yes, looks good from reading. But all te extra checks before calling > free can go. That's idiom from a *long* time ago. There is more cleanup that can be done in this code. For example, the use of 0 instead of NULL. But that can be a s

Re: vfs_stall foreach mount point

2018-05-07 Thread Todd C. Miller
On Mon, 07 May 2018 19:21:37 +0200, Alexander Bluhm wrote: > When looping over mount points, the FOREACH SAVE macro is not save. > The loop variable mp is protected by vfs_busy() so that it cannot > be unmounted. But the next mount point nmp could be unmounted while > VFS_SYNC() sleeps. As the l

Re: Remove ls -C alias from /etc/ksh.kshrc

2018-05-15 Thread Todd C. Miller
On Tue, 15 May 2018 20:57:02 +0200, Marco Pfatschbacher wrote: > I think it's time to remove this artifact from 1996. Agreed. OK millert@ - todd

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