Re: doas sprinkle some more CFLAGS

2020-12-19 Thread Ted Unangst
On 2020-12-18, Martijn van Duren wrote: > So I ended up in doas again, this time with the CFLAGS I use for most of > my other projects. This popped up a few new not very exciting warnings. > Diff below compiles clean with both clang and gcc on amd64. > static int > match(uid_t uid, gid_t *group

Re: grep: add --null flag

2021-01-24 Thread Ted Unangst
On 2021-01-22, Omar Polo wrote: > > quasi three-weekly ping. > > Is this such a bad idea? This seems reasonable. I think there's no need to change print line calls though, just patch the implementation once. > > (TBH: I have still to look at how to write a regression test for this) > > Omar

Re: grep: add --null flag

2021-01-24 Thread Ted Unangst
On 2021-01-25, Sebastian Benoit wrote: > Sebastian Benoit(be...@openbsd.org) on 2021.01.25 00:27:05 +0100: > > Theo de Raadt(dera...@openbsd.org) on 2021.01.24 16:01:32 -0700: > > > Stuart Henderson wrote: > > > > > > > On 2021/01/24 12:10, Theo de Raadt wrote: > > > > > I completely despise that

Re: librthread sem_t opaqueness, storage & unnamed semaphore sharing

2020-03-02 Thread Ted Unangst
On 2020-03-02, Lauri Tirkkonen wrote: > Thanks for the input, and ping - is there still something about this > diff that I should fix? I'm kinda busy, but I should be able to look into it eventually.

Re: Untangle proc * in VOP_*

2020-03-23 Thread Ted Unangst
On 2020-03-23, Martin Pieuchot wrote: > Most of the VOP_* methods include an argument of type "struct proc *" > called `a_p'. This pointer is always set to `curproc' as confirmed by > the diff below. The diff has been though base build with NFS on amd64 > and sparc64 as well as a full port bulk o

Re: Avoid offline cpu in automatic frequency scheduling

2020-05-28 Thread Ted Unangst
On 2020-05-28, Solene Rapenne wrote: > > > In the current case, if you have offline cpu (because of hw.smt=0), > > > the total will still sum all the idle cpu and it's unlikely that > > > the total threshold is ever reached before the per cpu one. > > > > > > so, this diff skip offline cpus in the

Re: [patch] rebound: add NULL pointer checks

2018-09-10 Thread Ted Unangst
Anton Lindqvist wrote: > > > > Since it's a daemon I guess it makes sense to continue execution instead > > > > of dying. However, we should make sure to not leak memory along the > > > > error paths. Also, log something when preloading the cache fails. > > Committed, I settled on using goto. Than

Re: doas(1): Exit Status

2018-10-12 Thread Ted Unangst
Dave Cameron wrote: > doas(1) currently states: > -clip- > EXIT STATUS > The doas utility exits 0 on success, and >0 if an error occurs. It may > fail for one of the following reasons: > > o The config file /etc/doas.conf could not be parsed. > o The user attempted to run

Re: lib/libfuse: Handle signals that get sent to any thread

2018-10-29 Thread Ted Unangst
Rian Hunter wrote: > Another gentle bump on this patch: this looks about right.

Re: top: accept UIDs

2018-11-01 Thread Ted Unangst
Klemens Nanni wrote: > This makes `top -U 0' and "u-1000" work. > > Overview: > > "kn" ok"10kn"ok if "10kn" exists else error > "-kn"ok"-10kn" ok if "10kn" exists else error > "1000" ok"--1000" error, negative UID and "-1000" not valid > "-

Re: top: accept UIDs

2018-11-01 Thread Ted Unangst
Klemens Nanni wrote: > On Thu, Nov 01, 2018 at 02:56:38PM -0400, Ted Unangst wrote: > > this looks to be in the wrong order. if 1000 is a username, that should be > > matched first before numeric lookup. > Preferring UIDs indeed clobbers usernames with the respective nu

Re: getent: prefer usernames over UIDs

2018-11-01 Thread Ted Unangst
Klemens Nanni wrote: > Prompted by tedu@'s recent reply, here's a fix for getent(1) to lookup > keys as UIDs only if the username lookup fails to prevent clobbering > numerical usernames. yes, this is how it should be. please fix group lookup as well.

Re: NMEA: add more gps sensor values (altitude, precision...)

2018-11-03 Thread Ted Unangst
Mark Kettenis wrote: > SENSOR_VELOCITY would make sense. It should be m/s with some > appropriate scaling. We don't need to represent speeds higer than > 299792458 m/s, so micrometers per second would be a good choice. is it reasonable to use mm/s so that distance and velocity are consistent?

Re: fuse_parse_cmd_line.3 patch

2018-11-28 Thread Ted Unangst
Edgar Pettijohn III wrote: > remove a bunch of `_' where there shouldn't be `_'s please resend without nonbreaking spaces breaking the diff.

dns over https for rebound

2018-11-29 Thread Ted Unangst
2 2018/11/20 03:42:56 tedu Exp $ */ +/* + * Copyright (c) 2018 Ted Unangst + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * +

apmd status at suspend/resume

2018-11-29 Thread Ted Unangst
I would find it useful to know battery percentage at the time of suspend and resume. This makes it possible to see how much battery was consumed while sleeping. I don't think this is much noisier than things already are. Index: apmd.c ==

Re: apmd status at suspend/resume

2018-11-29 Thread Ted Unangst
Klemens Nanni wrote: > On Thu, Nov 29, 2018 at 02:50:58PM -0500, Ted Unangst wrote: > > I would find it useful to know battery percentage at the time of suspend and > > resume. This makes it possible to see how much battery was consumed while > > sleeping. I don't think

apmd debug

2018-11-30 Thread Ted Unangst
Developers who shall remain anonymous were confused by the behavior of apmd -d because the behavior of apmd -d is confusing. It doesn't do anything like any other daemon in the system when running with -d. This introduces a logmsg function to replace syslog, which will either syslog or printf depe

find -not

2018-12-05 Thread Ted Unangst
Seen in the wild. Alias for ! that's friendlier to the shell. Index: find.1 === RCS file: /cvs/src/usr.bin/find/find.1,v retrieving revision 1.95 diff -u -p -r1.95 find.1 --- find.1 1 Aug 2018 07:09:15 - 1.95 +++ find.1

Re: [Patch] Specify unit for 'every' in ifstated.conf.5

2018-12-06 Thread Ted Unangst
Jason McIntyre wrote: > On Thu, Dec 06, 2018 at 10:21:47PM +1100, Ross L Richardson wrote: > > > > The number is in seconds, but that's currently not specified. > > > > Wording which preserved "frequency" but made sense with "seconds" > > eluded me, so I changed things to refer to "interval". > >

ktrace buglet

2018-12-06 Thread Ted Unangst
ktrace -C will return an error if you don't have a ktrace.out file because sys_ktrace tries to open it whenever it has a filename, even if it won't be used. I think it is more consistent to require it be null, so that we aren't opening files we won't be using. man page and utility diff below. In

Re: Importing FreeBSD eMMC code

2018-12-06 Thread Ted Unangst
Heppler, J. Scott wrote: > Is there interest in installing/booting OpenBSD on eMMC? this is expected to work.

pwd_check tweak

2018-12-09 Thread Ted Unangst
These patterns try to detect a1a1a1 style passwords. By making the regex a bit more flexible we can just use one. Also now catches mMmMmM fwiw. Index: pwd_check.c === RCS file: /cvs/src/usr.bin/passwd/pwd_check.c,v retrieving revisio

ksh mail check

2018-12-09 Thread Ted Unangst
if MAIL is unset, we can short circuit the check a little bit. Index: mail.c === RCS file: /cvs/src/bin/ksh/mail.c,v retrieving revision 1.24 diff -u -p -r1.24 mail.c --- mail.c 25 Jun 2018 15:22:30 - 1.24 +++ mail.c

Re: Add rtable capability to login.conf

2022-01-29 Thread Ted Unangst
I believe it would be better to add setrtable to id pledge. On 2022-01-29, Matthew Martin wrote: > It would be nice to have the ability to set a user's rtable upon login. > This would be useful both for road warrior VPN setups (put both the VPN > interface and user in an rdomain other than 0) and

go, pledge, and dns

2022-01-30 Thread Ted Unangst
A go program that uses pledge("dns") mostly works except for two incompatibilities with the way golang's dns library works. Otherwise pledge("rpath") is required. 1. go likes to stat /etc/hosts to check for changes. I think this is reasonable behavior. Patch below adds a whitelist to the kernel to

Re: pshared semaphores

2020-07-08 Thread Ted Unangst
On 2020-07-08, Ted Unangst wrote: > I think this makes sem_init(pshared) work. Whoops, need more context to include the header file changes. Index: include/semaphore.h === RCS file: /home/cvs/src/include/semaphore.h,v retriev

pshared semaphores

2020-07-08 Thread Ted Unangst
I think this makes sem_init(pshared) work. I have a test program from Lauri Tirkkonen and if I've understood it correctly, it works now. The essence of the diff is that we must eliminate the indirection so that the application can properly allocate (mmap) the semaphore into shared memory. There's

disable libc sys wrappers?

2020-07-08 Thread Ted Unangst
Not sure how useful this will be, but I think it could be helpful to still see section (2) functions in ktrace, even if there's magic to avoid that. As proof of concept, if env LIBC_NOSYSWRAPPERS is set, the libc timecounters are turned off. Now I see lots of gettimeofday syscalls in ktrace again.

Re: disable libc sys wrappers?

2020-07-09 Thread Ted Unangst
On 2020-07-08, Theo de Raadt wrote: > I think we need something like this. > > Documenting it will be a challenge. > > I really don't like the name as is too generic, when the control is only > for a narrow set of "current time" system calls. I thought I'd start with something, but lots of quest

Re: pshared semaphores

2020-07-09 Thread Ted Unangst
On 2020-07-08, Mark Kettenis wrote: > > From: "Ted Unangst" > > Date: Wed, 08 Jul 2020 05:20:23 -0400 > > > > On 2020-07-08, Ted Unangst wrote: > > > I think this makes sem_init(pshared) work. > > > > Whoops, need more context to include t

Re: disable libc sys wrappers?

2020-07-09 Thread Ted Unangst
On 2020-07-09, Theo de Raadt wrote: > Hang on. Do people ever want to force time calls, outside of ktrace? > I doubt it. Should ktrace maybe have a flag, similar to -B with LD_BIND_NOW, > which sets the new environment variable? Maybe -T? The problem smells very > similar to the root cause for

Re: disable libc sys wrappers?

2020-07-13 Thread Ted Unangst
On 2020-07-09, Theo de Raadt wrote: > > Added a -T option to ktrace for transparency. I got ambitious here and made > > it take suboptions, anticipating that other transparency modifications may > > be desired. > > Please don't do that. Here is a simpler version. Index: lib/libc/dlfcn/init.c ==

Re: PATCH: better error return for exFAT filesystem

2020-08-09 Thread Ted Unangst
On 2020-08-09, Jonathan Gray wrote: > mount_msdos(8) knows about EINVAL and will print "not an MSDOS filesystem" I think mount_msdos could also inspect the filesytem for the common case of exfat confusion. Index: mount_msdos.c === RC

Re: apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Ted Unangst
On 2020-09-23, Jeremie Courreges-Anglas wrote: > ok? Seems fine. > Note: I inlined the apmd(8)->apm(8) perfpolicy conversion for now, which > brings a question. I find it weird that there is a special "high" > perfpolicy (effectively similar to perfpolicy=manual + setperf=100) but > no "low" p

Re: apmd(8) and hw.perfpolicy quirks

2020-09-27 Thread Ted Unangst
On 2020-09-27, Jeremie Courreges-Anglas wrote: > The diff below teaches apmd(8) -H to set hw.perfpolicy="manual" and > hw.setperf=100, instead of setting hw.perfpolicy="high". sure. if you would like to own this, by all means. :)

Re: doas: improve error message

2020-10-08 Thread Ted Unangst
On 2020-10-09, Klemens Nanni wrote: > In case `cmd' and `args' in doas.conf(5) do not match, the generated > log message is unclear and might be read as if the command executed but > failed, i.e. returned non-zero: > > # cat /etc/doas.conf > permit nopass kn cmd echo args foo > $

Re: use getpwuid_r in doas

2019-06-10 Thread Ted Unangst
Ted Unangst wrote: > I have a coming change which will need to access both the calling user and > target users' passwd entries. In order to accomplish this, we need to switch > to the reentrant flavor of getpwuid. No behaviorial change, but I think this > is clearer and less er

Re: fsync(2) and I/O errors

2019-06-11 Thread Ted Unangst
Maximilian Lorlacks wrote: > This looks okay to me. > > (plus two months ping) oh, good news, committed two months ago. sorry, forgot to reply. > > ‐‐‐ Original Message ‐‐‐ > On Tuesday, April 16, 2019 8:19 PM, Ted Unangst wrote: > > > Oh, right, I reword

new env defaults for doas

2019-06-12 Thread Ted Unangst
This has come up a few times before. For background, the default rule for doas is to copy a few environment settings from the user and omit the rest. This is to prevent confusion, and also supposedly for security. However, some of the alleged safe variables like PATH probably aren't that safe. And

Re: new env defaults for doas

2019-06-15 Thread Ted Unangst
Martijn van Duren wrote: > I'm not convinced that LOGIN_SETPATH is a good idea here. From what I > gathered that sets PATH from login.conf(5), while most environments I > know will use .profile to set it and could cause unexpected behaviour > if the my and targ PATH are reset to unexpected values.

Re: new env defaults for doas

2019-06-16 Thread Ted Unangst
Martijn van Duren wrote: > > 2. When doing keepenv, nothing changes, except addition of above. > > It feels inconsistent to make keepenv behave different here. > - It may allow certain applications to behave unexpected compared to > without keepenv (e.g. scripts that use $HOME/.cache). > - The v

Re: new env defaults for doas

2019-06-17 Thread Ted Unangst
Ted Unangst wrote: > Yes, I think it's better to always reset these things. Here's a diff. > > 1. Always set HOME, PATH, SHELL etc to the target. Committed this. I'm not entirely happy with the wording. I think hiding them under an option in the config man page is the

Re: new env defaults for doas

2019-06-17 Thread Ted Unangst
Todd C. Miller wrote: > On Mon, 17 Jun 2019 12:58:00 -0400, "Ted Unangst" wrote: > > > Committed this. I'm not entirely happy with the wording. I think hiding them > > under an option in the config man page is the wrong place. The default > > behavior shoul

doas fix PATH inheritance

2019-06-17 Thread Ted Unangst
espie found a bug. we reset PATH in the parent too soon, and then it's not possible to change it back via setenv. instead of trying to move code around, save a copy of the path before we mess with it and make it available later. this lets setenv { PATH=$PATH } work. Index: doas.c ==

doas environmental security

2019-06-20 Thread Ted Unangst
I've made some changes to how doas handles environment variables recently. The diffs were in previous emails, and have been committed. Thanks to Sander Bos for pointing out some particular edge cases with the old handling. There are two (or more) ways to run doas. In the first, you use it to run s

more doas.1 tweaks

2019-06-21 Thread Ted Unangst
I think this wording clarifies what's happening. 1. Start by talking about creating a new environment. That's what we always do. Everything afterwards is an operation performed on this new environment. 2. Move the list of magic variables out of doas.conf. I think it's better to document this in o

Re: grep -ob: behave like ggrep, adapt documentation

2019-07-16 Thread Ted Unangst
Christopher Zimmermann wrote: > Hi, > > I just tried to find the byte position of a string within a binary file > using grep. Our base grep -bo let me down because it will only display > the position of the '\n' delimited line, not the position of the > pattern. > > That's what our grep(1) says:

Re: apmd: zap useless globals

2019-07-21 Thread Ted Unangst
Klemens Nanni wrote: > Initialize stack variables directly instead of using global state in > between. > > OK? sure

Re: csh - remove empty and duplicate unnecessary lines

2019-07-29 Thread Ted Unangst
Kalwe Caramalac wrote: > Hi, this is my first diff submission, forgive me if have any error, > if anyone has any tips on how to do this i appreciate it. > @@ -588,7 +585,6 @@ dopopd(Char **v, struct command *t) > void > dfree(struct directory *dp) > { > - > if (dp->di_count != 0) { It's v

Re: Removing the kernel timezone: date(1): drop -d dst and -t minutes_west

2019-08-07 Thread Ted Unangst
Scott Cheloha wrote: > It doesn't mean anything. I guess I'm still gunshy about removing > options and breaking things after the lock(1) thing. If the default behavior changes, and the option is now meaningless, but still results in the *same* behavior, keep the option. The user still obtains the

Re: Removing the kernel timezone: date(1): drop -d dst and -t minutes_west

2019-08-07 Thread Ted Unangst
Scott Cheloha wrote: > - while ((ch = getopt(argc, argv, "ad:f:jr:ut:z:")) != -1) > + while ((ch = getopt(argc, argv, "af:jr:uz:")) != -1) > switch(ch) { > case 'a': > slidetime = 1; > break; > - case 'd':

Re: msdosfs: remove timezone support

2019-08-30 Thread Ted Unangst
Scott Cheloha wrote: > The FAT file system hails from Redmond and so it tracks a timezone. > OpenBSD implicitly uses the kernel timezone when selecting which > timezone to use when mounting a FAT file system. > > This support is undocumented. > > This patch removes that support. > > The upshot i

pretty borders for slitherins

2019-09-23 Thread Ted Unangst
snake and worm draw boxes, but they can be prettier by using the default style, which will use line drawing instead of ugly -*| characters. should do the right thing on a vt100, but only tested in xterm. Index: snake/snake.c === RCS

Re: pretty borders for slitherins

2019-09-25 Thread Ted Unangst
Scott Cheloha wrote: > On Mon, Sep 23, 2019 at 06:23:32PM -0400, Ted Unangst wrote: > > snake and worm draw boxes, but they can be prettier by using the default > > style, which will use line drawing instead of ugly -*| characters. > > > > should do the right thing on

Re: pretty borders for slitherins

2019-09-26 Thread Ted Unangst
Nicholas Marriott wrote: > OK seems like it is always using ACS which is correct. > > I just remembered jmc asked me about this before and it turned out that > ACS doesn't work with the DRM console - I don't think the font have the > right symbol for either ACS or UTF-8 line drawing, but there may

more grep options (for zstdgrep)

2019-10-06 Thread Ted Unangst
The zstd package includes a zstdgrep script, which should behave like zgrep, however it assumes a few gnu grep behaviors we don't support. 1. --label=name prints a custom label, so you can get file.txt, not file.txt.zst in the output. 2. It uses - for stdin instead of a missing argument. Both ar

Re: more grep options (for zstdgrep)

2019-10-07 Thread Ted Unangst
While I'm looking at the man page, a minor clarification. "All long options are provided" can be read to mean that every gnu option is provided. This is not intended, and a simple reordering makes things clearer imo. Index: grep.1 =

Re: top: align CPU lines horizontally

2019-10-12 Thread Ted Unangst
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 09:53:44AM -0600, Theo de Raadt wrote: > > I am suggesting you put the spaces after the cpu#. > Is this better? > > 4 CPUs: 0.0% user, 0.0% nice, 0.0% sys, 0.0% spin, 0.0% intr, 100% > idle > > CPU 0 : 0.0% user, 0.0% nice, 0.0% sys, 0

Re: top: align CPU lines horizontally

2019-10-12 Thread Ted Unangst
Klemens Nanni wrote: > On Sat, Oct 12, 2019 at 05:38:13PM -0500, Scott Cheloha wrote: > > Also, just count how many spaces we need to print ncpuonline, > > then use that when printing the individual CPU lines. > Yup, here's a minimal diff that does that without additional buffers and > globals but

random safety for pbkdf

2019-10-15 Thread Ted Unangst
In the event that a program uses invalid parameters, I think we should overwrite the key with random data. Otherwise, there's a chance the program will continue with a zero key. It may even appear to work, encrypting and decrypting data, but with a weak key. Random data means it fails closed, and s

Re: Add rtable capability to login.conf

2022-02-06 Thread Ted Unangst
On 2022-02-05, Matthew Martin wrote: > On Sat, Jan 29, 2022 at 06:25:32PM -0600, Matthew Martin wrote: > > On Sat, Jan 29, 2022 at 07:10:00PM -0500, Ted Unangst wrote: > > > I believe it would be better to add setrtable to id pledge. > > ping > > Also ar

Re: Add rtable capability to login.conf

2022-02-18 Thread Ted Unangst
On 2022-02-06, Ted Unangst wrote: > On 2022-02-05, Matthew Martin wrote: > > On Sat, Jan 29, 2022 at 06:25:32PM -0600, Matthew Martin wrote: > > > On Sat, Jan 29, 2022 at 07:10:00PM -0500, Ted Unangst wrote: > > > > I believe it would be better to add setrtab

Re: vmd(8) fix error handling when hitting rlimit

2022-02-26 Thread Ted Unangst
On 2022-02-26, Dave Voutila wrote: > Following the discusion on misc@ and a diff from tedu@ [1], here's a bit > more work cleaning up the issue in vmd(8) to prevent vmd dying if a user > tries to create a vm with memory above the rlimit. > > I changed tedu's diff a bit to make it less verbose and

Re: document LOGIN_SETRTABLE

2022-03-03 Thread Ted Unangst
On 2022-03-03, Theo Buehler wrote: > This is missing in setusercontext(3). Of course. > > Index: gen/login_cap.3 > === > RCS file: /cvs/src/lib/libc/gen/login_cap.3,v > retrieving revision 1.18 > diff -u -p -r1.18 login_cap.3 > ---

Re: pcb mutex userland

2022-03-18 Thread Ted Unangst
On 2022-03-17, Alexander Bluhm wrote: > On Thu, Mar 17, 2022 at 01:07:12AM +0100, Mark Kettenis wrote: > > > Date: Thu, 17 Mar 2022 01:01:46 +0100 (CET) > > > From: Mark Kettenis > > > > > > > Date: Thu, 17 Mar 2022 00:47:15 +0100 > > > > From: Alexander Bluhm > > > > > > > > Hi, > > > > > > >

btrace hist printing large numbers

2022-04-27 Thread Ted Unangst
btrace needs a little more help printing very large numbers. If you have something like 2^61 in your histogram, it gets printed as 1K because that's what's left over after dividing by G and M. Add some more units, and it prints as 1E. (It seems like there might be another bug, because I'm not re

Re: install btrace scripts

2022-04-30 Thread Ted Unangst
On 2022-04-30, Alexander Bluhm wrote: > Hi, > > Can we install the btrace scripts to /usr/share/btrace/ ? The > directory already exists, only the Makefile is not linked to the > build. > > And I would like to use #! to make them executable. It's weird to have exec files in share? I think it's

Re: EVFILT_USER and kevent(2)

2022-04-30 Thread Ted Unangst
On 2022-04-30, Visa Hankala wrote: > I am in two minds about EVFILT_USER. On the one hand, having it on > OpenBSD might help with ports. On the other hand, it makes the kernel > perform a task that userspace can already handle using existing > interfaces. I agree you could do this with just a pipe

no gawking in makesyscalls

2022-04-30 Thread Ted Unangst
I don't think we need to concern ourselves with cross awk compatibility here. Despite the misleading comment, /usr/bin/awk supports toupper. Index: makesyscalls.sh === RCS file: /home/cvs/src/sys/kern/makesyscalls.sh,v retrieving rev

Re: another syzkaller problem in pf

2022-05-03 Thread Ted Unangst
On 2022-05-03, Moritz Buhl wrote: > Hi tech@, > > Syzkaller found a few crashes in pf_anchor_global_RB_REMOVE. > https://syzkaller.appspot.com/bug?id=a97f712331903ce38b8c084a489818b9bb5c6fcb > and also > https://syzkaller.appspot.com/text?tag=CrashLog&x=15ace9aaf0 > > The call stack is someth

use cpu sensor for cpuspeed

2022-05-14 Thread Ted Unangst
The cpu hz sensor is more accurate and updates faster than than the value currently used for hw.cpuspeed. So return that value (scaled). This doesn't set cpuspeed directly because the acpi does that and it's hard to create a whole system of priority overrides. I think it's simpler and maybe even b

Re: use cpu sensor for cpuspeed

2022-05-15 Thread Ted Unangst
On 2022-05-15, Mark Kettenis wrote: > > From: "Ted Unangst" > > Date: Sat, 14 May 2022 20:23:39 -0400 > > > > The cpu hz sensor is more accurate and updates faster than than the value > > currently used for hw.cpuspeed. So return that value (scaled). >

tar extract to stdout

2022-05-26 Thread Ted Unangst
tar can read and write archive files from stdin/out, but cannot extract files to stdout. This may be kinda esoteric, but there's a few uses. Archive of log files, etc., where you want to check for something without extracting to a tmp file. I tried working around this by renaming to /dev/fd/1, but

Re: tar extract to stdout

2022-05-27 Thread Ted Unangst
On 2022-05-26, Todd C. Miller wrote: > 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. That would look something like this.

Re: tar extract to stdout

2022-05-27 Thread Ted Unangst
Err. Index: extern.h === RCS file: /home/cvs/src/bin/pax/extern.h,v retrieving revision 1.60 diff -u -p -r1.60 extern.h --- extern.h23 Mar 2020 20:04:19 - 1.60 +++ extern.h27 May 2022 00:30:36 - @@ -284,7 +284,7 @

Re: Change behaviour of vis(3) in syslogd concerning backslash escaping

2022-06-03 Thread Ted Unangst
On 2022-06-02, Theo de Raadt wrote: But please consider this impact of the change you propose. > > There is one additional flag, VIS_NOSLASH, which inhibits the doubling of > backslashes and the backslash before the default format (that is, control > characters are represented by `

Re: sys_socket() plumbing

2018-02-07 Thread Ted Unangst
Martin Pieuchot wrote: > Diff below shuffles sys_socket() to look like sys_socketpair(). > > The goal is to do socket operations first in both functions. Since > they don't need the KERNEL_LOCK(), we will be able to mark the syscalls > NOLOCK and only grab it before messing with file descriptors.

Re: Make systat(1) list ordering

2018-02-07 Thread Ted Unangst
Martijn van Duren wrote: > Some manpage nits found by jmc. heh, was about to say the same. not a big systat user, but i don't see why not. ok > > Index: engine.c > === > RCS file: /cvs/src/usr.bin/systat/engine.c,v > retrieving rev

Re: Introduce killjobc()

2018-02-09 Thread Ted Unangst
Martin Pieuchot wrote: > Diff below moves some job control bits out of exit1(). It is extracted > from guenther@'s proctreelk diff. It's currently a noop so I'd like to > get it in to reduce the locking diff. > > ok? i misread subject as kill objc, but ok anyway.

Re: getentropy does not explicit_bzero if copyout fails

2018-02-21 Thread Ted Unangst
Mateusz Guzik wrote: > As the subject states. By the time the code gets to copyout, buf is > already populated. Clearing it only if copyout succeeds looks like a > braino, thus the following trivial proposal: If the secret random data is not copied out, it will not be used, and there's nothing to

Re: Blowfish_expand0state invocation order

2018-03-08 Thread Ted Unangst
Delan Azabani wrote: > Are there any interesting reasons behind this difference (aside from > a simple mistake in either the implementation or the paper)? > > Does the difference in order have any cryptanalytic implications (it > would surprise me if there were, but I’m not really a cryptographer)

Re: Kernel size beyond 16 MB on amd64

2018-03-13 Thread Ted Unangst
Franco Fichtner wrote: > What can we do to help? Write smaller code...

Re: try to map 64-bit mem space first

2018-04-10 Thread Ted Unangst
Mark Kettenis wrote: > We should allways use mmio instead of io if possible. The cascading > if statements are a bit ugly, but I can't come up with a better solution. mapped = 0; if (pcimap() == 0) mapped = 1; if (!mapped && pcimap() == 0) m

Re: Stop ping telling world its pid

2018-04-12 Thread Ted Unangst
Job Snijders wrote: > I’m not great at math, with a 16 bit random value, wouldn’t we start > running into ID collisions around 256 concurrent ping processes? Perhaps > that already is the case today and this patch does nothing to improve that, > but also doesn’t make it worse. what we need is an e

Re: map stack problem with "homemade" stackguard

2018-04-16 Thread Ted Unangst
Sebastien Marie wrote: > Assuming the check on protection is a bit too restrictive, and it is > fine to have some chunks with PROT_NONE, I think we want something like: are readonly stacks meaningful? if so, we should fix that too now instead of waiting. > > Index: uvm/uvm_map.c > =

Re: Error in adding system call in OpenBSD 6.3

2018-04-23 Thread Ted Unangst
Neeraj Pal wrote: > 4) echo "file kern/sys_hello.c" >> /usr/src/sys/conf/files > > 5) cd /usr/src/sys/arch/amd64/compile/CUSTOM.MP/ > > 6) make obj && make -j4 > > And, then, It throws an error given below, > > " > ld -T ld.script -X --warn-common -nopie -o bsd ${SYSTEM_HEAD} vers.o ${OBJS} >

Re: Error in adding system call in OpenBSD 6.3

2018-04-23 Thread Ted Unangst
Neeraj Pal wrote: > > In file included from /usr/src/sys/kern/sys_test.c:4: > /usr/src/sys/sys/syscallargs.h:153:13: error: unknown type name > 'socklen_t'; did you mean '__socklen_t'? Your includes are in the wrong or some are missing. I think you should start by adding code to a file that alrea

Re: Libressl question

2018-05-30 Thread Ted Unangst
Brent Cook wrote: > On Mon, Feb 12, 2018 at 09:27:16AM -0600, ed...@pettijohn-web.com wrote: > > Has there been any discussion of packaging libtls separately from libressl > > for portable use? With my limited skills I was able to write a program to > > talk to smtpd and starttls using nothing bu

allow weak passwd

2018-12-10 Thread Ted Unangst
So I was actually looking at the passwd check rules because I wanted to add a flag to disable the 3 bad passwords then ok whatever. This adds passwd -w to allow user to skip the default 3 warnings and just do what they want. If, by chance, you have configured warnings in login.conf then they can't

Re: make build as root fails when SUDO=doas

2018-12-10 Thread Ted Unangst
Solene Rapenne wrote: > Not sure how to fix it. Maybe people shouldn't try to compile as root when > having SUDO=doas set and then, it's not an issue anymore? yeah, i would say this is an issue of your own making. you ask to use doas, make is going to use doas.

Re: allow weak passwd

2018-12-11 Thread Ted Unangst
Mark Kettenis wrote: > > From: "Ted Unangst" > > Date: Mon, 10 Dec 2018 14:14:08 -0500 > > Content-Type: text/plain; charset=utf-8 > > > > So I was actually looking at the passwd check rules because I wanted > > to add a flag to disable the 3 bad

Re: make build as root fails when SUDO=doas

2018-12-11 Thread Ted Unangst
Marc Espie wrote: > > > - try to remove the files normally first > > > rm -f ${SUDO_CLEAN} || test -z "${SUDO}" || ${SUDO} rm -f > > > ${SUDO_CLEAN} > > > > > > this should actually fix the issue. > > > > > > Any other directory with that problem ? > > > > that fix the issue and the bu

kdump -f -

2018-12-11 Thread Ted Unangst
I have some trace files that are gzipped to save space. (They compress really well.) It would be convenient if I could simply zcat them into kdump for inspection. This patch allows -f - to read from stdin. (Curiously, kdump always reads from stdin, but uses freopen on the trace file.) Unsure abou

Re: make build as root fails when SUDO=doas

2018-12-11 Thread Ted Unangst
Marc Espie wrote: > There is a kind of mixed model there. > > Because make build still goes thru regress for obj and cleandir > > Yet the rest of the build doesn't! > > So, if we agree that it needs to stay the way it currently is, then > the SUDO in that Makefile might trigger while running as

Re: kdump -f -

2018-12-12 Thread Ted Unangst
Klemens Nanni wrote: > On Tue, Dec 11, 2018 at 10:31:37PM -0500, Ted Unangst wrote: > > I have some trace files that are gzipped to save space. (They compress > > really > > well.) It would be convenient if I could simply zcat them into kdump for > > inspection. > F

Re: request for testing: patch for boot loader out of mem

2018-12-13 Thread Ted Unangst
Otto Moerbeek wrote: > int > biosd_diskio(int rw, struct diskinfo *dip, u_int off, int nsect, void *buf) > { > - return biosd_io(rw, &dip->bios_info, off, nsect, buf); > + int i, n, ret; > + > + /* > + * Avoid doing too large reads, the bounce buffer used by biosd_io() > +

Re: make build as root fails when SUDO=doas

2018-12-14 Thread Ted Unangst
Marc Espie wrote: > Well, apart from the bike-shedding, it seems like the most correct > short-term solution. > > So I will commit it tomorrow, unless someone has an actual better idea. Nobody answered if SUDO_CLEAN is actualy set. I checked. It's not. Index: Makefile ===

Re: request for testing: patch for boot loader out of mem

2018-12-15 Thread Ted Unangst
Otto Moerbeek wrote: > That would boil down to this, > > ok? ok with me

Re: diff: fix missing include guard in dev/biovar.h

2018-12-19 Thread Ted Unangst
Jan Klemkow wrote: > I run into double definition problems because of a missing include guard > in dev/biovar.h. The diff below should fix that issue. Where and how? I don't like adding guards blindly because it leads to laziness and eventually the include situation is a giant tangled mess. Each

  1   2   3   4   5   6   7   8   9   10   >