Re: Signed integer overflow in telnet.

2024-08-26 Thread Todd C . Miller
On Mon, 26 Aug 2024 13:21:41 +0200, Omar Polo wrote: > I don't usually use telnet, but seemed simple to fix the hand rolled > parser to use strtonum > > OKs/opinions on the verbiage? Looks good. OK millert@ - todd

Re: skey command does not display all possible one-time passwords

2024-08-03 Thread Todd C . Miller
Fixed, thanks. - todd

Re: strmode should take a mode_t instead of int.

2024-06-19 Thread Todd C . Miller
On Wed, 19 Jun 2024 15:17:05 +0200, Otto Moerbeek wrote: > Additionally, the implementation in src/libn/libc/string/strmode.c > needs to start using mode_t. > > Building base now with the diff below. So far so good. > > But this is more tricky you would think. Modifying string.h to include > more

Re: Minor doc-vs-implemention conflict in /etc/daily vs test(1)

2024-06-17 Thread Todd C . Miller
On Tue, 18 Jun 2024 00:10:03 +0200, Ingo Schwarze wrote: > I admit that usually, when there are two equivalent syntaxes, deprecating > one of them makes sense. But in this case, with POSIX setting both in > stone over 20 years ago, attempting to die on that particular molehill > seems pointless t

Re: pax/tar: reading extended headers of > 512 bytes fails

2024-04-16 Thread Todd C . Miller
On Wed, 17 Apr 2024 00:42:32 +0200, Jeremie Courreges-Anglas wrote: > Well the second sizeof should take care of it, or are you suggesting > PAXPATHLEN+1+1...? :-| > > char buf[sizeof("30xx linkpath=") - 1 + PAXPATHLEN + sizeof("\n")]; No, you are correct, I just missed the second one. OK m

Re: pax/tar: reading extended headers of > 512 bytes fails

2024-04-16 Thread Todd C . Miller
On Wed, 17 Apr 2024 00:08:30 +0200, Jeremie Courreges-Anglas wrote: > Indeed, spotted too late, thanks. But maybe the latter looks, ahem, nicer? > The name and ln_name buffers are sized using it. I don't think PAXPATHLEN includes space for the NUL so maybe this should be PAXPATHLEN+1. Or just l

Re: pax/tar: reading extended headers of > 512 bytes fails

2024-04-16 Thread Todd C . Miller
On Tue, 16 Apr 2024 23:39:50 +0200, Jeremie Courreges-Anglas wrote: > Here's a cheap trick. Testing with path=... longer than PATH_MAX > results in broken behavior. If you want to test this with symbolic > links and long linkpath=... please use the latest tar.c. > > There's probably a better way

Re: FW: ls -l Segmentation fault

2024-03-26 Thread Todd C . Miller
On Tue, 26 Mar 2024 12:45:09 -0700, guent...@openbsd.org wrote: > Someone want to craft a diff for ls to handle that (and scan the tree for > other unchecked localtime() calls)? Not sure if > POSIX's ls spec has an out for how to print the time for such a thing. Another option is to just use t

Re: FW: ls -l Segmentation fault

2024-03-26 Thread Todd C . Miller
It appears that localtime(3) is returning NULL and that is being passed to strftime(). This should avoid the crash. - todd Index: bin/ls/print.c === RCS file: /cvs/src/bin/ls/print.c,v retrieving revision 1.40 diff -u -p -u -r1.40

Re: pkg_add -u not working since last sysupgrade (openbsd-current)

2024-03-02 Thread Todd C . Miller
On Sat, 02 Mar 2024 21:26:23 +0100, Sylvain Saboua wrote: > This works to retrieve and install/update packages as > expected, but I don't get why it should be necessary > since I am not running a release kernel. Or am I ? > > $uname -a > OpenBSD lap.saboua.xyz 7.5 GENERIC.MP#44 amd64 Because ther

Re: pkg_add -u not working since last sysupgrade (openbsd-current)

2024-03-02 Thread Todd C . Miller
On Sat, 02 Mar 2024 17:36:28 +0100, Sylvain Saboua wrote: > I sysupgraded to -current in January for KDE/Plasma. > I perform about one sysupgrade per week around Thursdays. > > Since the last one, I have been unable to update packages > via the regular pkg_add command : > > $ doas pkg_add -u > htt

Re: smtpd segfault when starting with hostname "localhost"

2024-01-15 Thread Todd C . Miller
On Mon, 15 Jan 2024 17:56:59 +0100, Florian Obser wrote: > actually we also have AI_FQDN and localhost is not a FQDN. > Let's just go with "localhost." > Still OK? Sure. - todd

Re: smtpd segfault when starting with hostname "localhost"

2024-01-15 Thread Todd C . Miller
On Mon, 15 Jan 2024 17:43:12 +0100, Florian Obser wrote: > oops, this seems to be better. I have the same diff. OK millert@ - todd > > OK? > > diff --git getaddrinfo_async.c getaddrinfo_async.c > index a1282e711cd..6d940b0d64e 100644 > --- getaddrinfo_async.c > +++ getaddrinfo_async.c > @@ -2

Re: smtpd segfault when starting with hostname "localhost"

2024-01-15 Thread Todd C . Miller
This looks like fallout from the changes in localhost handling in the resolver. It seems strange for getaddrinfo() to return success but not set res->ai_canonname when AI_CANONNAME is specified. - todd

Re: NFS server doesn't close connections (client freezes)

2024-01-11 Thread Todd C . Miller
On Thu, 11 Jan 2024 22:29:51 +0100, Alexandre Ratchov wrote: > nfsrv_rcv() may set the DISCONN flag, so we need to retest for it > after nfsrv_rcv() and possibly call nfsrv_zapsock(). If we don't do > that, the server may sleep before the nfsrv_zapsock() call; if so, > this leaves the connection h

Re: NFS server doesn't close connections (client freezes)

2024-01-11 Thread Todd C . Miller
On Thu, 11 Jan 2024 19:35:23 +, Miod Vallat wrote: > Yes. Unfortunately NEEDQ and DISCONN may be both set, so we still need > to check for DISCONN here before NEEDQ. > > Or the whole block could become > > if (NEEDQ set and not DISCONN set) > nfsrv_rcv block > if (DIS

Re: xterm bug

2023-12-19 Thread Todd C . Miller
On Tue, 19 Dec 2023 10:56:42 -0500, Bryan Steele wrote: > There's two instances of __default_termid__ in xterm.man, I think this > will chang the second one to "100", is that correct? Yes, the "vt" prefix is optional. - todd

Re: xterm bug

2023-12-19 Thread Todd C . Miller
The following should fix this, though perhaps we should consider updating this and DFT_DECID to 420, since that is the default that xterm now ships with, or 220 to better match the OpenBSD console. The description of -ti in xterm.man doesn't actually mention vt420 as an option, the highest it list

Re: ntpd crash in constraint_msg_close log_sockaddr

2023-12-18 Thread Todd C . Miller
On Mon, 18 Dec 2023 20:08:54 +0100, Otto Moerbeek wrote: > Though this is a more fundamental appoach and is easier on the eyes imo. Using a wrapper makes this a lot easier to read. There is also a log_sockaddr() call in client_dispatch() that could be converted. - todd

Re: dump(8) SEGVs in searchdir() on 7.4-stable

2023-12-17 Thread Todd C . Miller
On Sun, 17 Dec 2023 21:32:05 +0100, Otto Moerbeek wrote: > This diff checks the allocations if a few pretty big tables. OK millert@ - todd

Re: awk Segmentation faults in OpenBSD 7.4

2023-10-28 Thread Todd C . Miller
This has been now been fixed in OpenBSD and reported upstream. Thanks for including a reproducer, that made it a lot easier to fix the problem. - todd CVSROOT:/cvs Module name:src Changes by: mill...@cvs.openbsd.org 2023/10/28 16:38:22 Modified files: usr.bin/awk: ru

Re: awk Segmentation faults in OpenBSD 7.4

2023-10-28 Thread Todd C . Miller
On Sat, 28 Oct 2023 10:33:09 -0600, "Todd C. Miller" wrote: > Looks like an off-by-one introduced in the utf8 conversion. > The following fixes the bug for me. I will file a PR upstream. Unfortunately, things are not so simple. Below is a workaround until I have a better fix.

Re: awk Segmentation faults in OpenBSD 7.4

2023-10-28 Thread Todd C . Miller
Looks like an off-by-one introduced in the utf8 conversion. The following fixes the bug for me. I will file a PR upstream. - todd Index: usr.bin/awk/run.c === RCS file: /cvs/src/usr.bin/awk/run.c,v retrieving revision 1.79 diff -u

Re: awk Segmentation faults in OpenBSD 7.4

2023-10-28 Thread Todd C . Miller
Thanks, the crash is fairly easy to reproduce under memory sanitizer. As a workaround, if you set LANG=C in the environment it will avoid the bug. - todd

Re: terminal is cleared when logging as root

2023-10-24 Thread Todd C . Miller
On Tue, 24 Oct 2023 10:12:12 +0100, Stuart Henderson wrote: > On 2023/10/24 08:21, Nicholas Marriott wrote: > > I can't see what is different in tset, both old and new should just > > send is2 and that hasn't changed as far as I can tell. > > > > Can someone show me the output of this from before

Re: terminal is cleared when logging as root

2023-10-23 Thread Todd C . Miller
On Mon, 23 Oct 2023 13:16:36 -0400, Daniel Jakots wrote: > I installed a new machine on Saturday (with -current) and I noticed > that when I logged in as root the terminal get cleared but not cleanly. > I upgraded a existing machine to a newer snapshot and then the problem > appeared as well. > >

Re: https://www.openbsd.org/faq/faq5.html bad links

2023-09-17 Thread Todd C . Miller
On Sun, 17 Sep 2023 20:43:16 -, Christoff Humphries wrote: > On the https://www.openbsd.org/faq/faq5.html page under the "Further > Reading on the Build Process" section, two links are unable to load > due to it appears cvsweb.openbsd.org port 443 is getting connection > refused. The two links

Re: vi/nvi: in the context of a :g the :t command improperly identifies the current line

2023-07-13 Thread Todd C . Miller
Yes, that looks like a bug. Historic vi behaves as expected. - todd

Re: bcmp() integer overflow bug

2023-07-13 Thread Todd C . Miller
On Wed, 12 Jul 2023 20:32:23 +0200, Robert Clausecker wrote: > I have just discovered that the bcmp() function on FreeBSD is > defective on 64 bit systems. It may errorneously return an > "equal" result when the buffers are not equal due to a > truncating cast in the return value. As OpenBSD use

Re: acme-client: name resolution error when specifying a port in the api url

2023-06-04 Thread Todd C . Miller
On Sun, 04 Jun 2023 18:05:19 +0200, Ronald Heggenberger wrote: > (Since I see that there's an implementation within the acme-client code, > which you replied -> isn't there an existing library somewhere in > OpenBSD that can break up a URL in it's compositional parts? This looks > like acme-cli

Re: acme-client: name resolution error when specifying a port in the api url

2023-06-04 Thread Todd C . Miller
Can you try the following diff to acme-client that adds support for parsing a port number after the hostname? If we decide to go this route we may wish to support a service name in addition to a port number and IP addresses bracked with '[' and ']' but first things first. - todd Index: netproc.

Re: grive2 doesn't work

2023-06-02 Thread Todd C . Miller
On Fri, 02 Jun 2023 20:18:00 +0200, Luca Di Gregorio wrote: > Hi, I've just installed grive2 and tried: > > grive -a > > When I go to the URL, Google says that the request from the app grive2 is > not valid. > > Is this a bug? You will need to supply your own OAuth2 client credentials to make it

Re: Dell Precision 5510 immediately suspends after lid is opened

2023-04-01 Thread Todd C . Miller
On Thu, 23 Mar 2023 11:41:13 -0600, todd.mil...@sudo.ws wrote: > >Synopsis:Dell Precision 5510 immediately suspends after lid is opened > >Category:amd64 > >Environment: > System : OpenBSD 7.3 > Details : OpenBSD 7.3 (GENERIC.MP) #1123: Tue Mar 21 07:11:25 MDT 2 > 023

Re: segmentation fault in opensmtpd mda

2023-03-18 Thread Todd C . Miller
On Sat, 18 Mar 2023 21:17:36 +0100, Omar Polo wrote: > If cscope is not missing anything, mda_expand_token is only called by > mda_expand_format which is only called by mda_unpriv. > > Now, mda_unpriv() always pass a NULL mda_command the first time (the > last argument) In smtpd.conf, under FORMA

Re: segmentation fault in opensmtpd mda

2023-03-18 Thread Todd C . Miller
Thanks, I was unable to get a backtrace so this really helped. I think the safest thing to do is to just return an error if the expanded string is NULL. I'm not sure if there are other expansions that can also be NULL here. Alternately, we could move the check to be specific to the else

Re: possible segmentation violation in login_radius

2023-03-02 Thread Todd C . Miller
On Thu, 02 Mar 2023 17:28:01 +0100, "Peter J. Philipp" wrote: > I just looked up RADIUS in RFC 2865 and on page 15 it reads: > > -> >Length > > The Length field is two octets. It indicates the length of the > packet including the Code, Identifier, Length, Authenticator and

Re: possible segmentation violation in login_radius

2023-03-02 Thread Todd C . Miller
On Thu, 02 Mar 2023 09:07:38 -0700, "Theo de Raadt" wrote: > + if (auth.length > total_length) > > Isn't auth.length a network byte order value? Ah yes, good catch; it needs an ntohs(). - todd Index: libexec/login_radius/raddauth.c

Re: possible segmentation violation in login_radius

2023-03-02 Thread Todd C . Miller
The following patch should fix the problem, can you try it out? - todd Index: libexec/login_radius/raddauth.c === RCS file: /cvs/src/libexec/login_radius/raddauth.c,v retrieving revision 1.30 diff -u -p -u -r1.30 raddauth.c --- libe

Re: redmi laptop keyboard problem

2023-02-24 Thread Todd C . Miller
On Fri, 24 Feb 2023 12:25:51 -0700, "Theo de Raadt" wrote: > The invention of interrupts was a bad idea. > > We should dedicate a core to polling. /sarc big.little to the rescue! - todd

Re: Malformed *roff markup in tmux man page

2023-02-14 Thread Todd C . Miller
On Tue, 14 Feb 2023 16:51:19 +, Tim Chase wrote: > Looks like some *roff/mandoc markup snuck into the tmux man-page: > > $ man tmux | grep -2 "Ar target" > -l requests the clipboard from the client using the xterm(1) > escape sequence. If Ar target-pane is given, the clipboard is >

Re: Error in ex(1) s command when using c option and numbering on

2023-02-07 Thread Todd C . Miller
On Tue, 07 Feb 2023 17:17:02 -0700, Todd C. Miller wrote: > Yes, the bug is that the number is not displayed. The following > diff fixes that but there is still a bug because the resulting line > also lacks a line number. In other words, instead of: > > :s/men/MEN/c > 1

Re: Error in ex(1) s command when using c option and numbering on

2023-02-07 Thread Todd C . Miller
On Tue, 07 Feb 2023 21:12:58 +0100, =?UTF-8?Q?Tom=C3=A1=C5=A1_Rippl_?= wrote: > System: OpenBSD 7.2 > Architecture: OpenBSD.amd64 > Machine: amd64 > > Description > > There is a bug in ex's 's' command. > > With the 'number' option OFF, and when using the 'c' flag, ex correctly "unde > rlines" the

Re: Put in "/usr/local/bin/" into execv and didn't work but works with execvp

2023-02-05 Thread Todd C . Miller
On Sun, 05 Feb 2023 11:00:39 -0600, Luke Small wrote: > I want to compile a program into /usr/local/bin but it doesn't work to call > "/usr/local/bin/" with execv and needs to be called with execvp > which doesn't seem to allign with the text of the manpage which states that > execvp is needed whe

Re: bug in usr.bin/vi

2022-12-10 Thread Todd C . Miller
On Sat, 10 Dec 2022 11:05:12 +0100, "Bosco G. G." wrote: > I have found a bug in nvi source code, you can see my report to nvi2 in > https://github.com/lichray/nvi2/pull/113 Thanks, committed. - todd

Re: Xserver crash with cgoban

2022-11-06 Thread Todd C . Miller
On Sun, 06 Nov 2022 10:44:10 +, Matthieu Herrb wrote: > Thanks for the report. You're right that this was overlooked when I > wrote this code. > > I'd suggest the more complete (and paranoid) patch below: I don't think you can set client->clientIds->cmdname to a constant string such as "" sin

Re: [patch] dhcpleased: Can't get an IP address when IPS does not provide a domain name

2022-04-27 Thread Todd C . Miller
florian@ committed a fix for this the other day: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sbin/dhcpleased/frontend.c.diff?r1=1.28&r2=1.29 CVSROOT:/cvs Module name:src Changes by: flor...@cvs.openbsd.org 2022/04/26 08:50:04 Modified files: sbin/dhcpleased: frontend.c

Re: update dump/restore to use rcmdsh() instead of rcmd()

2022-04-26 Thread Todd C . Miller
On Tue, 26 Apr 2022 15:26:56 -0700, Jim Lawson wrote: > Thanks todd. I wasn't aware anyone ran dump as anything other than root. Typically all you need is group operator to do dumps. It is often easier to do remote dumps as non-root since you don't have to allow root ssh on the destination host.

Re: update dump/restore to use rcmdsh() instead of rcmd()

2022-04-26 Thread Todd C . Miller
On OpenBSD, rcmd(3) calls rcmdsh(3) under the hood unless the program is run as the superuser. However, since we no longer even ship rshd(8) in OpenBSD it is probably best to avoid rcmd(3) entirely. It looks like dump(8) is the only remaining user of rcmd(3) in the tree. - todd

Re: smtpd: mta cert-check result="unverified" on smarthost

2022-02-15 Thread Todd C . Miller
On Mon, 14 Feb 2022 20:05:30 +0100, Sebastien Marie wrote: > One aspect that I haven't verified for now is the difference between > using "tls" (early initialisation) and not using it (late > initialisation). I will try to look at it to ensure that the > connection is always used with tls_config_v

Re: smtpd: mta cert-check result="unverified" on smarthost

2022-02-14 Thread Todd C . Miller
On Mon, 14 Feb 2022 17:43:47 +0100, Sebastien Marie wrote: > It seems I need to explicitly add "tls" on the action line to enforce > the tls verification now. > > - action "relay-free" relay host "smtps://f...@smtp.free.fr" auth s> > + action "relay-free" relay host "smtps://f...@smtp.fre

Re: high CPU termperature and poor performance after cold boot

2021-11-21 Thread Todd C . Miller
On Sun, 21 Nov 2021 14:30:09 +, Mihai Dragan wrote: > Can I check from user space the interrupt count a device generates ? > Any advice or hints on how to debug this further would be greatly appre > ciated. Compare the output of "vmstat -i" after both cold and warm boot. - todd

Re: df(1)s missing -m and -g options

2021-11-07 Thread Todd C . Miller
df honors the BLOCKSIZE environment variable so you can already do things like: $ BLOCKSIZE=1m df Filesystem 1M-blocks Used Avail Capacity Mounted on /dev/sd1a1008 175 78218%/ /dev/sd1m 124124 29107 8881025%/home /dev/

Re: vi: segfault on exit

2021-10-25 Thread Todd C . Miller
On Sun, 24 Oct 2021 20:45:47 -0400, Dave Voutila wrote: > We end up freeing some strings and unlinking the temp file. You can > easily see this without a debugger by checking /tmp before and after the > reproduction step of an arg-less ':e'. I debugged this yesterday as well and came to the same

Re: jot(1) randomness with larger numbers

2021-07-29 Thread Todd C . Miller
On Thu, 29 Jul 2021 19:35:24 +0200, Theo Buehler wrote: > I think we should keep uintx as an uint32_t since that's what the > arc4random() family expects. I'd argue that the check is wrong in that > it should be done before assigning the double to an uint32_t. > > I'd suggest this diff: Event bet

Re: jot(1) randomness with larger numbers

2021-07-29 Thread Todd C . Miller
On Thu, 29 Jul 2021 07:11:26 -0600, "Theo de Raadt" wrote: > I'm not sure about the tradeoff in this approach. > > Won't the lack of precision in double eventually lead to non-uniformity? > > The way jot is written, I expect higher ranges to have lots of > non-uniformity unless a substantial rewri

Re: awk(1) enters infinite loop when passing directory as argument

2021-07-27 Thread Todd C . Miller
On Tue, 27 Jul 2021 10:07:35 -0300, Phillip Bushee wrote: > OpenBSD awk(1) should fail when passing a directory as argument. > However, it runs continuously. Try the following: > > mkdir dir > awk 1 dir > > It seems to enter an infinite loop. > > This is not a problem of onetrueawk. I

Re: vi segfault on set w=0

2021-04-13 Thread Todd C . Miller
On Mon, 12 Apr 2021 19:08:40 +0300, Erik Ruotsalainen wrote: > I managed to replicate the bug, but not consistently. Anyway, the > offender was a conditional statement in vs_refresh.c: > > 262:} else if (LNO > TMAP->lno) { > > which makes me suspect that either sp->lno or TMAP-

Re: Possible binary incompatible change of struct usb_device_info in 2018

2021-03-13 Thread Todd C . Miller
On Sat, 13 Mar 2021 16:20:43 +, Stuart Henderson wrote: > That needs fixing. Also need to sync udi_ports[] which is now u_int32_t not u_int8_t. - todd > Index: usb.4 > === > RCS file: /cvs/src/share/man/man4/usb.4,v > retrievi

Re: After week or so - can not sshd in nor login from console

2021-01-18 Thread Todd C . Miller
On Mon, 18 Jan 2021 14:17:43 +0200, Jyrki Saarela wrote: > However, now that I actually can access the box again, > /var/run/dmesg.boot contains > uid 0 on /: out of inodes > uid 0 on /: out of inodes > uid 0 on /: out of ioodes > uid 0 on /: out of inodes > uid 0 on /: out of inodes > uid 0 on /:

Re: sftp(1) URI destination can't handle IPv6 addresses

2020-11-17 Thread Todd C . Miller
On Tue, 17 Nov 2020 20:07:15 -0300, Gleydson Soares wrote: > Accordingly to > https://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04 > "host" part of the URI referenced at > https://tools.ietf.org/html/rfc3986#section-3.2.2 > it can be an IPv6/IPv4 address or a domain name itself, so th

Re: su(1): bad auth_approval(3) failure handling

2020-10-30 Thread Todd C . Miller
On Fri, 30 Oct 2020 15:03:41 +0100, Piotr Durlej wrote: > auth_approval(3) doesn't always set errno(2) on failure: Committed, thanks. - todd

Re: disklabel -e says "No changes." when boundend parameter is changed

2020-10-19 Thread Todd C . Miller
On Mon, 19 Oct 2020 13:26:06 -0600, "Theo de Raadt" wrote: > Todd C. Miller wrote: > > > For some reason, cmplabel() in disklabel.c doesn't compare the > > bounds values when it checks for changes. I'm not sure what the > > reason for that is,

Re: disklabel -e says "No changes." when boundend parameter is changed

2020-10-19 Thread Todd C . Miller
For some reason, cmplabel() in disklabel.c doesn't compare the bounds values when it checks for changes. I'm not sure what the reason for that is, it seems like we should write the new label even if the only change is in the bounds. - todd

Re: cksum(1) and friends ignore write errors in -p mode

2020-09-30 Thread Todd C . Miller
On Wed, 30 Sep 2020 15:25:36 -0400, "Demi M. Obenour" wrote: > If I run > > cksum -a sha256x -ph /dev/fd/3 < /home/_sysupgrade/base68.tgz 3>&1 >/mnt/falc > on > > and the filesystem mounted on /mnt is too small to hold base68.tgz, > cksum(1) should return an error. Instead, the error is silently

Re: bug on fmemopen(3)

2020-08-14 Thread Todd C . Miller
On Fri, 14 Aug 2020 07:04:13 -0600, Todd C. Miller wrote: > Yes, there is special handling for O_APPEND that sets the size. However, there are other bugs with respect to append. I've added an append flag to the state but we could just as easily store the open flag instead. I check

Re: bug on fmemopen(3)

2020-08-14 Thread Todd C . Miller
On Fri, 14 Aug 2020 03:05:38 -, phillb...@cock.li wrote: > Also, is size for *mode == 'a' handled correctly? Yes, there is special handling for O_APPEND that sets the size. - todd

Re: bug on fmemopen(3)

2020-08-13 Thread Todd C . Miller
On Thu, 13 Aug 2020 19:31:04 -0600, Todd C. Miller wrote: > The fix is to look at mode, not oflags since "w+" will set O_RDWR, > not O_WRONLY. Actually, checking O_TRUNC is probably better and is consistent with the rest of the code. Either diff produces the expected result

Re: bug on fmemopen(3)

2020-08-13 Thread Todd C . Miller
The fix is to look at mode, not oflags since "w+" will set O_RDWR, not O_WRONLY. - todd Index: lib/libc/stdio/fmemopen.c === RCS file: /cvs/src/lib/libc/stdio/fmemopen.c,v retrieving revision 1.3 diff -u -p -u -r1.3 fmemopen.c --- l

Re: awk: FS pattern separation issue

2020-06-11 Thread Todd C . Miller
This should be fixed by the commit I just made to awk/lib.c. The strlcpy() length parameter was incorrect. - todd

Re: awk: i386 broken

2020-06-11 Thread Todd C . Miller
On Thu, 11 Jun 2020 12:36:27 +0100, Stuart Henderson wrote: > This "fixes" it ... > > I think the most sensible approach for now is the backout diff > in my previous mail. Any OKs for that? The strlcpy() is wrong now that inputFS is a pointer. It should be: strlcpy(inputFS, *FS, len_inputFS

Re: lockspool getting killed by pledge on OpenBSD 6.7

2020-05-25 Thread Todd C . Miller
On Mon, 25 May 2020 16:04:25 -0600, Bob Beck wrote: > getlock()'s behaviour changes in the case of a writeable mail spool. if we > want to keep supporting this, I we can modify the pledge as follows: I thought we decided not to adjust the pledge when I brought it up last time. Here's the diff I

Re: ksh: failing eval stops execution even when in OR-list

2020-05-21 Thread Todd C . Miller
On Fri, 22 May 2020 00:06:28 +0200, Sebastian Benoit wrote: > Hi Leah, > > thanks for your report and researching this! > > Anyone else happy with this? > I'd like to commit it ;) Yes, OK millert@ - todd

Re: Mounting MFS filesystem does not preserve directory permissions of mount point

2020-05-19 Thread Todd C . Miller
On Tue, 19 May 2020 14:04:37 +0200, Otto Moerbeek wrote: > In 18 years, yes. But the -O2 case should work whartever the default > is for mfs. I agree that -O2 should work for mfs, I'm just wasn't sure that should be the default for mfs. We don't actually have a way to specify the ffs version wit

Re: Mounting MFS filesystem does not preserve directory permissions of mount point

2020-05-19 Thread Todd C . Miller
Is there any advantage to mfs defaulting to ffs2? - todd

Re: gzopen in src/lib/libz and empty files

2020-04-16 Thread Todd C . Miller
On Thu, 16 Apr 2020 23:39:29 +0200, Ingo Schwarze wrote: > I believe the patch is correct and i'd like to commit it. > > I have tested all code path directly leading from gz_open() > into check_header(). > > However, i'm not quite sure how to test the call of check_header() > from gzread(). Marc,

Re: -current 100% CPU, softdep related

2020-03-09 Thread Todd C . Miller
I just committed my minimal fix. - todd

Re: -current 100% CPU, softdep related

2020-03-08 Thread Todd C . Miller
On Sat, 07 Mar 2020 19:35:10 -0700, Bob Beck wrote: > makes sense to me and has my ok. could we see if bluhm@ can be sure this > still works with his workload? Thanks, waiting to see if bluhm@ can confirm this doesn't cause problems makes sense. I'm currently travelling but will be home this

Re: -current 100% CPU, softdep related

2020-03-03 Thread Todd C . Miller
Here is a minimal fix that only addresses the tight CPU loop in softdep_process_worklist(). It will exit the loop if we cannot make progress instead of spinning. process_worklist_item() now returns 1 if it processed an item or 0 if it could not. The existing semantics of matchcnt have been prese

Re: -current 100% CPU, softdep related

2020-03-03 Thread Todd C . Miller
On Tue, 03 Mar 2020 10:20:04 +0100, Mark Patruck wrote: > After ~3 days with the system up and running, the crash after doing > a "reboot" looks different. Now it's in handle_workitem_freeblocks(), > according to objdump The problem is that removed files were not actually getting removed since pr

Re: -current 100% CPU, softdep related

2020-02-28 Thread Todd C . Miller
This sounds like the loop in softdep_process_worklist() is never exiting. It shouldn't run for more than a second, though. FreeBSD breaks out of the loop if process_worklist_item() can't make progress. You could try the following (untested) diff to see if it changes the behavior. - todd Index

Re: radiusd(8) bsdauth crashes if user authenticates with a mechanism ":style" and group checking on

2019-12-14 Thread Todd C . Miller
On Fri, 13 Dec 2019 22:37:31 +0200, Dennis Lindroos wrote: > If the user argument has the ":style" suffix attached to it then > getpwnam(user) will return a NULL pointer. > I tried just using strsep(3) to strip off the auth style and it works for > me (this is probably not the safest bit of coding

Re: readlink -f / Bug|Glitch|Feature

2019-11-21 Thread Todd C . Miller
On Thu, 21 Nov 2019 11:52:53 +0100, Raimo Niskanen wrote: > On OpenBSD 6.6 amd64 patch 006, i get peculiar results from readlink(1) > with arguments -f with a symlink to / > > $ readlink -f / > / > > $ ln -s / test; readlink -f test; rm test > readlink: test: Is a directory That appears to be a b

Re: dhcpcd: if_learnaddrs: if_addrflags6: Invalid argument

2019-11-18 Thread Todd C . Miller
On Mon, 18 Nov 2019 19:02:13 +0100, Alexander Bluhm wrote: > The get functions like SIOCGIFAFLAG_IN6 did not have a length check. > There the incoming address is used to find the correct interface > address for the requested information. This is what dhcpcd uses. > > For the inet6 netmask the sin

Re: dhcpcd: if_learnaddrs: if_addrflags6: Invalid argument

2019-11-17 Thread Todd C . Miller
On Sun, 17 Nov 2019 20:38:59 +0100, Alexander Bluhm wrote: > I think the best way to handle it, is to make the kernel strict and > fix userland. If the kernel would allow the sloppiest userland > program to succeed, creating security would be hard. Sorry, I don't agree. We cannot expect userlan

Re: octeon: upgrade from 6.5 to 6.6 panic in pppoe

2019-11-06 Thread Todd C . Miller
On Wed, 06 Nov 2019 15:48:31 -0700, Allen Smith wrote: > When booting into the 6.6 kernel for the first time on a EdgeRouter 4, the > host starts bringing up services and when the pppoe interface starts to > come up I see the following: You are not the only one to run into this. There's a workar

Re: NULL-dereference in `put_entries()` in `usr.bin/ctags/print.c`

2019-11-04 Thread Todd C . Miller
On Mon, 04 Nov 2019 09:11:10 +0100, Rudolf Leitgeb wrote: > This potentially erroneous call to put_entries() happens only, if > a malloc at a very early stage fails. In my opinion, the call to > put_entries in pfnote() should be wrapped. That fix looks correct to me. - todd

Re: vi crashed while attempting to save a restored file

2019-10-26 Thread Todd C . Miller
On Fri, 25 Oct 2019 22:26:32 -0700, Alfred Morgan wrote: > I did a vi -r on a file and then tried to save after my system lost power > and I got a segfault when I tried to save the file. I tried ZZ and :w and > :w blah.txt and it would segfault every time. I couldn't get it to save. > I'm on OpenB

Re: bugs? awk resetting separator when modifying $NF

2019-09-30 Thread Todd C . Miller
On Mon, 30 Sep 2019 18:53:56 +0200, Solene Rapenne wrote: > I'm using OpenBSD -current (snapshots from 28 sept) on amd64. > I'm not sure this is a bug but I can't find an explanation in the man > page. > > I wanted to remove last field of a string using "-" as separator, but > the separator seems

Re: Potential Bug

2019-09-20 Thread Todd C . Miller
As a temporary workaround you could try entering "boot -c" at the boot prompt and then "disable acpithinkpad" to disable the driver that appears to be crashing. Then type "exit" to continue the boot process. If that allows you to successfully boot you can use the sendbug command to make a proper

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Todd C . Miller
On Tue, 10 Sep 2019 16:56:42 +0100, Raf Czlonka wrote: > How about ditching dirname(1)? dirname(1) handles files in the root directory as well as files with no directory correctly, your diff does not. E.g. FCODES=/foo ${FCODES%/*} -> "" dirname $FCODES -> "/" FCODES=bar ${FCODES%/*} -> "" dirn

Re: weekly(8) isn't able to run locate.updatedb(8) anymore

2019-09-10 Thread Todd C . Miller
On Tue, 10 Sep 2019 09:42:16 +0200, Sebastien Marie wrote: > the use of '-' is documented has a valid option, and weekly(8) uses it > in order to run locate.updatedb(8) has 'nobody' and have the output in > tempfile under /var/db (place writable only by root). > > with the change, as weekly(8) run

Re: X1 Thinkpad Tablet Freeze on Boot

2019-07-15 Thread Todd C . Miller
On Mon, 15 Jul 2019 14:02:22 -, Charlie Burnett wrote: > Ah- I'm just now seeing the note about the screen going black after the > kernel loads into memory, and doing some more digging shows the same kind > of issue when CSM isn't enabled. Unfortunately they had said that CSM > wasn't support

Re: X1 Thinkpad Tablet Freeze on Boot

2019-07-15 Thread Todd C . Miller
You probably need to make some changes to the bios settings, if you haven't already done so. Try disabling "secure boot" and enabling "CSM Support" and see if that makes a difference. Some of the info at https://jcs.org/2017/09/01/thinkpad_x1c may also be applicable. - todd

Re: "at " doesn't work as documented

2019-02-15 Thread Todd C . Miller
On Sat, 16 Feb 2019 01:48:11 +0100, Christian Weisgerber wrote: > I think tod() already has the required logic, but it doesn't handle > the case where the time is only past by minutes. Even better. OK millert@ - todd

Re: "at " doesn't work as documented

2019-02-15 Thread Todd C . Miller
On Fri, 15 Feb 2019 22:36:08 +0100, Christian Weisgerber wrote: > The at(1) man page says: > at allows some moderately complex timespec specifications. It accepts > times of the form HHMM or HH:MM to run a job at a specific time of day. > (If that time is already past, the next day i

Re: calendar -B flag show futur events in some case

2019-01-29 Thread Todd C . Miller
On 29 Jan 2019 08:06:02 -0700, "Andy Bradford" wrote: > Thus said Solene Rapenne on Tue, 29 Jan 2019 12:47:57 +0100: > > > As I'm not comfortable with calendar(1) code, I don't know if the > > patch breaks some other use. If someone feels confident to read the > > code and import it, that

Re: calendar -B flag show futur events in some case

2019-01-24 Thread Todd C . Miller
On 24 Jan 2019 08:19:00 -0700, "Andy Bradford" wrote: > The problem is caused by the way that offset is derived for the special > handling of Friday. If the day in the date is a Friday, offset is set to > 3 so that events happening on the weekend are printed. In the case you > presented, you se

Re: vi crash on page forward with long lines

2019-01-14 Thread Todd C . Miller
On Mon, 14 Jan 2019 21:15:54 +0100, Otto Moerbeek wrote: > A problem with this diff is that is changes the part of the screen > shown while switching back and forth between files with Ctrl-^ > > Normally, vi remembers both the cursor position in the files and the > part of the file shown (it does

Re: vi crash on page forward with long lines

2019-01-14 Thread Todd C . Miller
On Fri, 11 Jan 2019 08:23:36 +0100, Martijn van Duren wrote: > I'm somewhat confident that this is the correct solution, but I'm > not 100% certain, considering Rapunzel probably has an easier time > untangling her hair. I think all we really need to do is set SC_SCR_TOP so that the HMAP settings

Re: useradd ignores invalid range specifiers

2018-12-31 Thread Todd C. Miller
Thanks, I've committed a slightly different fix that only prints an error message once before exiting. - todd

  1   2   3   >