Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Jeremie Courreges-Anglas
On Wed, Apr 07 2021, Klemens Nanni wrote: > On Tue, Apr 06, 2021 at 11:35:44PM +0200, Jeremie Courreges-Anglas wrote: [...] >> > @@ -321,40 +328,49 @@ handle_client(int sock_fd, int ctl_fd) >> >return reply.newstate; >> > } >> > >&g

Re: apmd/apm: propagate failure to apm, make apm report failure

2021-04-06 Thread Jeremie Courreges-Anglas
On Fri, Apr 02 2021, Klemens Nanni wrote: > On Fri, Mar 26, 2021 at 10:49:53PM +0100, Klemens Nanni wrote: >> On Fri, Mar 26, 2021 at 10:38:30PM +0100, Klemens Nanni wrote: >> > apm(8) never knows gets the result of the requested power action carried >> > out by apmd(8), so platforms without

Re: arm64: make cwfg(4) report battery information to apm(4)

2021-03-24 Thread Jeremie Courreges-Anglas
On Wed, Mar 24 2021, Klemens Nanni wrote: > On Wed, Mar 24, 2021 at 12:49:51AM +0100, Jeremie Courreges-Anglas wrote: > >> >> > @@ -202,6 +217,12 @@ cwfg_attach(struct device *parent, struc >> >> > >> >> > sensor_task_register(sc, c

Re: arm64: make cwfg(4) report battery information to apm(4)

2021-03-23 Thread Jeremie Courreges-Anglas
On Mon, Mar 22 2021, Klemens Nanni wrote: > Better diff at the end thanks to jca's eyeballing, see comments inline. > > kettenis: I see room for improvement in our subsystems and their > interactions, but I don't think the current situation is bad enough to > leave those bits out for now. > >

Re: arm64: make cwfg(4) report battery information to apm(4)

2021-03-21 Thread Jeremie Courreges-Anglas
On Sun, Mar 21 2021, Mark Kettenis wrote: >> Date: Sun, 21 Mar 2021 17:22:05 +0100 >> From: Klemens Nanni >> >> On Sun, Mar 21, 2021 at 02:02:00PM +0100, Mark Kettenis wrote: >> > > Date: Sun, 21 Mar 2021 01:02:53 +0100 >> > > From: Klemens Nanni >> > > >> > > apm(4/arm64) merely provides an

Re: arm64: make cwfg(4) report battery information to apm(4)

2021-03-21 Thread Jeremie Courreges-Anglas
On Sun, Mar 21 2021, Klemens Nanni wrote: > apm(4/arm64) merely provides an all zero/unknown stub for those values, > e.g. apm(8) output is useless. > > Hardware sensors however provide the information: > > $ sysctl hw.sensors > hw.sensors.rktemp0.temp0=32.22 degC (CPU) >

Re: ftp: make use of getline(3)

2021-02-15 Thread Jeremie Courreges-Anglas
On Sun, Feb 14 2021, Christian Weisgerber wrote: > Christian Weisgerber: > >> > Make use of getline(3) in ftp(1). >> > >> > Replace fparseln(3) with getline(3). This removes the only use >> > of libutil.a(fparseln.o) from the ramdisk. >> > Replace a complicated fgetln(3) idiom with the much

Re: video(4) multiple opens

2021-02-12 Thread Jeremie Courreges-Anglas
On Wed, Feb 10 2021, Martin Pieuchot wrote: [...] > Which fields is the new lock protecting? Why isn't the KERNEL_LOCK() > enough? When I mentioned this potential lack of locking to Marcus, I was mistaken. Some of the functions in video.c are called from syscalls that are marked NOLOCK. But

Re: unwind(8): open DNSSEC trustanchor late

2021-02-06 Thread Jeremie Courreges-Anglas
On Sat, Feb 06 2021, Florian Obser wrote: > On Sat, Feb 06, 2021 at 01:23:35AM +0100, Jeremie Courreges-Anglas wrote: >> On Fri, Jan 29 2021, Florian Obser wrote: >> > Last piece of the puzzle... >> > >> > Re-try to open DNSSEC trust anchor file if /var i

Re: unwind(8): open DNSSEC trustanchor late

2021-02-05 Thread Jeremie Courreges-Anglas
On Fri, Jan 29 2021, Florian Obser wrote: > Last piece of the puzzle... > > Re-try to open DNSSEC trust anchor file if /var is not mounted yet. > With this we are able to start unwind before the network is up and > partitions are mounted. Sorry for being late to the party, I just upgraded to the

Re: getopt.3 bugs section

2021-01-09 Thread Jeremie Courreges-Anglas
On Sat, Jan 09 2021, Christian Weisgerber wrote: > Edgar Pettijohn: > >> In the BUGS section for the getopt(3) manual it mentions not using >> single digits for options. I know spamd uses -4 and -6 there are >> probably others. Should they be changed? Or is the manual mistaken? > > You

Re: video(4) multiple opens

2021-01-06 Thread Jeremie Courreges-Anglas
On Wed, Jan 06 2021, Marcus Glocker wrote: > On Tue, Jan 05, 2021 at 11:54:31PM +0100, Jeremie Courreges-Anglas wrote: [...] >> Here's the diff. IIUC the use of atomic operations isn't strictly >> needed here since open(2) runs with the kernel lock, but the result >> is e

video(4) multiple opens

2021-01-05 Thread Jeremie Courreges-Anglas
I hit a weird failure with firefox and BigBlueButton (https://bigbluebutton.org/) where firefox can't use my webcam. video(1) works, same for other webrtc sites in firefox, eg meet.jit.si. ktrace shows that a single firefox process tries to open /dev/video0 more than once, and that fails with

Re: ftp(1): handle HTTP 308

2021-01-01 Thread Jeremie Courreges-Anglas
On Thu, Dec 31 2020, Lucas wrote: > Weekly bump chrisz@ had a similar diff, already ok'd by kn@ and me. Christopher, would you mind committing it? > Index: fetch.c > === > RCS file: /home/cvs/src/usr.bin/ftp/fetch.c,v > retrieving

Re: Fewer uvmexp

2020-11-18 Thread Jeremie Courreges-Anglas
On Wed, Nov 18 2020, Martin Pieuchot wrote: > While auditing the various uses of the uvmexp fields I came across > those under #ifdet notyet. May I delete them so I don't have to give > them some MP love? Ok? ok jca@, but while here shouldn't the rest of cpu_vm_init() go too? Unless I'm

Re: [PATCH] tcpdump: Fix missing argument from icmp_print call in print-skip.c

2020-11-03 Thread Jeremie Courreges-Anglas
On Tue, Nov 03 2020, Theo Buehler wrote: > On Tue, Nov 03, 2020 at 04:19:34PM +0530, Neeraj Pal wrote: >> Hi all, >> >> It seems that there is a typo, 2nd argument - length is missing from >> the function call icmp_print in print-skip.c > > There is quite a bit more that is wrong with

Re: [PATCH] Mention unsupported stacking in softraid(4)

2020-10-25 Thread Jeremie Courreges-Anglas
On Sun, Oct 25 2020, "Filippo Valsorda" wrote: > Based on the text in faq14.html, but using the manpage language. Makes sense. I'm not sure .Em is useful here, though. ok jca@ if someone wants to pick this up, else I'll just commit it in a few hours. Thanks, > diff --git

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

2020-10-17 Thread Jeremie Courreges-Anglas
On Thu, Oct 15 2020, Christian Weisgerber wrote: > Accommodate POSIX basename(3) that takes a non-const parameter and > may modify the string buffer. > > I've tried to follow the conventions of the existing code. > > ok? > > Index: usr.bin/ftp/fetch.c >

Re: apmd(8) and hw.perfpolicy quirks

2020-09-27 Thread Jeremie Courreges-Anglas
On Thu, Sep 24 2020, Jeremie Courreges-Anglas wrote: > On Wed, Sep 23 2020, "Ted Unangst" wrote: >> On 2020-09-23, Jeremie Courreges-Anglas wrote: >> >>> ok? >> >> Seems fine. >> >> >>> Note: I inlined the apmd(8)->apm(

Re: apmd(8) and hw.perfpolicy quirks

2020-09-24 Thread Jeremie Courreges-Anglas
On Wed, Sep 23 2020, "Ted Unangst" wrote: > 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 the

Re: apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Jeremie Courreges-Anglas
On Wed, Sep 23 2020, Jeremie Courreges-Anglas wrote: > Prompted by a report from Miod: setting hw.setperf works only if the > kernel doesn't have a usable cpu_setperf implementation. The current > apmd(8) code warns if setting hw.perfpolicy fails, but then handles > back bogus val

apmd(8) and hw.perfpolicy quirks

2020-09-23 Thread Jeremie Courreges-Anglas
Prompted by a report from Miod: setting hw.setperf works only if the kernel doesn't have a usable cpu_setperf implementation. The current apmd(8) code warns if setting hw.perfpolicy fails, but then handles back bogus values to apm(8) clients. The easy fix is to just query the kernel about the

Re: httpd(8): don't leak iov

2020-09-20 Thread Jeremie Courreges-Anglas
On Sun, Sep 20 2020, Tobias Heider wrote: > iov is allocated with calloc. I think we should free it after the imsg > is sent. > > ok? ok jca@ > Index: config.c > === > RCS file: /cvs/src/usr.sbin/httpd/config.c,v > retrieving

apm(8) and apmd(8): zap "cool" running mode remnants

2020-09-20 Thread Jeremie Courreges-Anglas
apmd "cool" mode was removed in 2014, and -C was made an undocumented compat alias for -A ("auto"). The code still contains kinda misleading references to this "cool" running mode, the diff below zaps those. ok? Index: apm/apm.c

Re: ftp: allow specifying supported protocols

2020-09-06 Thread Jeremie Courreges-Anglas
On Sun, Sep 06 2020, Theo Buehler wrote: > On Sun, Sep 06, 2020 at 12:55:17AM +0200, Jeremie Courreges-Anglas wrote: >> On Sat, Sep 05 2020, Theo Buehler wrote: >> > I found this small diff useful more than once (admittedly for debugging). >> > It allows specifying the

Re: ftp: allow specifying supported protocols

2020-09-05 Thread Jeremie Courreges-Anglas
On Sat, Sep 05 2020, Theo Buehler wrote: > I found this small diff useful more than once (admittedly for debugging). > It allows specifying the protocols that may be used by ftp the same way > as nc -Tprotocols works. For example: > > $ ftp -Sprotocols=tlsv1.2:tlsv1.1 https://example.com/file > >

unwind(8): use SO_REUSEADDR

2020-08-29 Thread Jeremie Courreges-Anglas
On Sat, Aug 29 2020, Stuart Henderson wrote: > On 2020/08/27 15:28, Florian Obser wrote: >> all heavy lifting done by sthen in unbound >> >> tests? > > ok with me. only tested lightly (the machine I normally use does DNS for > other machines too so runs unbound). > > related, any idea what's

Re: [Patch] Change httpd's handling of request "Host:" headers

2020-08-10 Thread Jeremie Courreges-Anglas
On Mon, Aug 10 2020, Ross L Richardson wrote: > Leo, > > On Mon, Aug 10, 2020 at 08:46:19AM +0200, Leo Unglaub wrote: >> Hey, >> i love your patch. The current behavour always bothered me because it caused >> servers to display "wrong" sites as defaults for all requests missing the >> Host

Re: [Patch] Change httpd's handling of request "Host:" headers

2020-08-10 Thread Jeremie Courreges-Anglas
On Sun, Aug 09 2020, Ross L Richardson wrote: > At present, if a request contains no "Host:" header [HTTP pre-1.1] or > if the supplied header does not match any of the servers configured > in httpd.conf, the request is directed to the first server. This > isn't documented, AFAICT. > > For

Re: allow TCP connections to IPv6 anycast addresses

2020-08-08 Thread Jeremie Courreges-Anglas
On Sat, Aug 08 2020, Florian Obser wrote: > On Fri, Aug 07, 2020 at 11:52:46PM +0200, Jeremie Courreges-Anglas wrote: >> If you don't want to remove M_ACAST from sys/mbuf.h, can you please at >> least change the comment? /* obsolete */ or something. > > Good point, I for

Re: allow TCP connections to IPv6 anycast addresses

2020-08-07 Thread Jeremie Courreges-Anglas
On Fri, Aug 07 2020, Florian Obser wrote: > No longer prevent TCP connections to IPv6 anycast addresses. > > RFC 4291 dropped this requirement from RFC 3513: >o An anycast address must not be used as the source address of an > IPv6 packet. > > And from that requirement

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-29 Thread Jeremie Courreges-Anglas
On Wed, Jul 29 2020, Florian Obser wrote: > On Wed, Jul 29, 2020 at 03:51:55PM +0200, Jeremie Courreges-Anglas wrote: >> So I did a few tests and read some unwind(8) code, and it *appears* safe >> to use unwind(8) along with "options trust-ad". > > Yes. > >>

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-29 Thread Jeremie Courreges-Anglas
On Sun, Jul 26 2020, Jeremie Courreges-Anglas wrote: > On Sat, Jul 25 2020, Sebastian Benoit wrote: [...] >> If you enable trust-ad on a system that moves around, e.g. your laptop, you >> will experience failures, which is why unwind tests for this and falls back >>

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-29 Thread Jeremie Courreges-Anglas
On Mon, Jul 27 2020, Jesper Wallin wrote: [...] > I still think the RES_USE_AD option might be a useful though, for when > you want to decide on an application-level whether to trust AD or not? RES_TRUSTAD can also be used for this, but as the proposed documentation points out it would be

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-26 Thread Jeremie Courreges-Anglas
On Sun, Jul 26 2020, Jesper Wallin wrote: > On Sat, Jul 25, 2020 at 02:01:06PM +0200, Jeremie Courreges-Anglas wrote: >> >> For those two reasons I think the feature should be opt-in. > > Yeah, I agree with you. My first approach was to have it check what > kind of DNS r

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-26 Thread Jeremie Courreges-Anglas
On Sat, Jul 25 2020, Sebastian Benoit wrote: > Jeremie Courreges-Anglas(j...@wxcvbn.org) on 2020.07.25 14:01:06 +0200: >> On Fri, Jul 17 2020, Jesper Wallin wrote: >> > Hi all, >> > >> > I recently decided to add SSHFP records for my servers, since I neve

Re: ssh(1), getrrsetbyname(3), SSHFP and DNSSEC

2020-07-25 Thread Jeremie Courreges-Anglas
On Fri, Jul 17 2020, Jesper Wallin wrote: > Hi all, > > I recently decided to add SSHFP records for my servers, since I never > memorize or write down my key fingerprints. I learned that if I > want ssh(1) to trust these records, DNSSEC needs to be enabled for my > zone. To validate these

ksh(1) set -o pipefail

2020-07-06 Thread Jeremie Courreges-Anglas
Requested by ajacoutot@, here's an attempt at implementing set -o pipefail. As pointed by sthen@ this option should be included in the next POSIX standard: https://www.austingroupbugs.net/view.php?id=789 There are several ways to implement it, the diff I showed to Antoine was based on

ftp(1) double free

2020-06-20 Thread Jeremie Courreges-Anglas
Small bug, but still... naddy@ reported a double free when interrupting (^C) ftp(1) at the end or url_get(). If that happens, the SIGINT handler longjmps and the cleanup path is taken a second time. To avoid this, restore the previous SIGINT handler in each possible error path. I chose to

Re: official ports vs DEBUG_PACKAGES

2020-05-30 Thread Jeremie Courreges-Anglas
On Sat, May 30 2020, Marc Espie wrote: >> - have some magic I don't know in ELF handling that would allow to either >> tweak the default location/introduce ${WRKOBJDIR} in that debug info. > > Thinking some more about it, that 3rd option is possibly not that > far-fetched > > we do pass most

Re: net80211: fix capinfo in assoc request

2020-05-18 Thread Jeremie Courreges-Anglas
On Thu, May 14 2020, Stefan Sperling wrote: > The capablities info field in an association request contains an ESS bit > which is set if the sender is an access point (there are other cases but > they don't matter for us; see 802.11-2012 8.4.1.4 if you are interested). > > This bit is set when

acpi(4): battery and A/C status after resume

2020-05-17 Thread Jeremie Courreges-Anglas
On Sat, Jan 25 2020, Jeremie Courreges-Anglas wrote: > So I have this diff for apmd -z/-Z that uses APM_POWER_CHANGE events to > trigger autosuspend. It works fine except for one glitch: if I plug the > AC cable and then resume, apmd will receive another APM_POWER_CHANGE > ev

Re: acpibat(4): remaining battery power with multiple batteries

2020-05-11 Thread Jeremie Courreges-Anglas
On Mon, May 11 2020, "Theo de Raadt" wrote: > You sure about that? In this code, acpi.c is collecting abstracted > information from the 3 battery drivers. (One A/C driver and two battery drivers.) > Maybe one of the drivers > isn't providing enough information? > > Mark Kettenis wrote: > >>

Re: acpibat(4): remaining battery power with multiple batteries

2020-05-11 Thread Jeremie Courreges-Anglas
On Fri, May 08 2020, Jeremie Courreges-Anglas wrote: > Overall remaining battery power is currently the average of the > remaining power (in percents) of each battery. This is misleading if > your laptop uses a large external battery which drains out first, and > a smaller inte

acpiac(4): no need to look at _STA

2020-05-08 Thread Jeremie Courreges-Anglas
acpiac(4) obtains the AC status using _PSR. _STA is queried too but nothing is done with the result. AFAICS ACPI 6.3 doesn't say anything about a relationship between _STA and _PSR. Diff below removes the unused _STA query and renames the surrounding plumbing. Thoughts, oks? Index:

acpibat(4): remaining battery power with multiple batteries

2020-05-08 Thread Jeremie Courreges-Anglas
Overall remaining battery power is currently the average of the remaining power (in percents) of each battery. This is misleading if your laptop uses a large external battery which drains out first, and a smaller internal battery (common scheme on eg thinkpad machines). Overall battery power

Re: ksh: Use typedef for function pointer

2020-05-08 Thread Jeremie Courreges-Anglas
On Thu, May 07 2020, Michael Forney wrote: > I originally submitted this patch as a portability fix to Brian > Callahan's oksh, but he suggested I submit it here instead. Out of curiosity, do you run (o)ksh on machines where this matters? > Conversion of function pointer to void pointer is not

Re: ld.so and ldconfig manpage nits

2020-05-08 Thread Jeremie Courreges-Anglas
On Fri, May 08 2020, Miod Vallat wrote: > This ensures consistent spelling of set-{user,group}-ID, and also > mentions LD_DEBUG is ignored by ld.so for such binaries. Committed, thanks! -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

Re: pfctl_parser.c vs. __KAME

2020-05-03 Thread Jeremie Courreges-Anglas
On Sun, May 03 2020, Alexandr Nedvedicky wrote: > Hello, Hi Sashan, > the question has popped up while on recent code review of some Solaris > specific > bug fixes: do we still need a code in diff below or is it OK to proceed > and commit the diff? > > The chunk below uses bytes 2 and 3 to

Re: resolv.conf(5) says options inet6 does nothing

2020-04-25 Thread Jeremie Courreges-Anglas
On Sat, Apr 25 2020, Jeremie Courreges-Anglas wrote: > On Fri, Apr 24 2020, Jeremie Courreges-Anglas wrote: >> On Thu, Apr 23 2020, Eric Faurot wrote: >>> On Thu, Apr 23, 2020 at 10:34:39AM -0600, Theo de Raadt wrote: >>>> It says the keyword gets parsed, bu

Re: resolv.conf(5) says options inet6 does nothing

2020-04-25 Thread Jeremie Courreges-Anglas
On Sat, Apr 25 2020, "Theo de Raadt" wrote: > This wording doesn't make any sense to me. > > When we use the term deprecate, we are talking about interfaces. > But gethostbyname isn't actually deprecated. getaddrinfo is > an alternative interface rather than gethostbyname. But gethostbyname >

Re: resolv.conf(5) says options inet6 does nothing

2020-04-25 Thread Jeremie Courreges-Anglas
On Fri, Apr 24 2020, Jeremie Courreges-Anglas wrote: > On Thu, Apr 23 2020, Eric Faurot wrote: >> On Thu, Apr 23, 2020 at 10:34:39AM -0600, Theo de Raadt wrote: >>> It says the keyword gets parsed, but then does performs no action. >>> >>> Bu

Re: resolv.conf(5) says options inet6 does nothing

2020-04-24 Thread Jeremie Courreges-Anglas
On Thu, Apr 23 2020, Eric Faurot wrote: > On Thu, Apr 23, 2020 at 10:34:39AM -0600, Theo de Raadt wrote: >> It says the keyword gets parsed, but then does performs no action. >> >> But that is different from not parsing it. >> >> Additionally, this explains an option which other systems

Re: iwm(4) timeout cancellation fix

2020-04-23 Thread Jeremie Courreges-Anglas
On Thu, Apr 23 2020, Stefan Sperling wrote: > I have observed a uvm fault in ieee80211_mira_probe_timeout_up() while > testing with iwm(4) and tcpbench: > > void > ieee80211_mira_probe_timeout_up(void *arg) > { > struct ieee80211_mira_node *mn = arg; > int s; > > s = splnet(); >

Re: resolv.conf(5) says options inet6 does nothing

2020-04-23 Thread Jeremie Courreges-Anglas
On Thu, Apr 23 2020, Jason McIntyre wrote: > On Thu, Apr 23, 2020 at 05:17:08PM +0200, Solene Rapenne wrote: >> Is there a reason to keep this part in resolv.conf(5) about an option >> doing nothing? >> >> > options inet6 >> > Enables support for IPv6-only applications, by setting RES_USE_INET6

Re: find(1) -exec + and ARG_MAX

2020-04-09 Thread Jeremie Courreges-Anglas
On Thu, Apr 09 2020, Marc Espie wrote: > On Thu, Apr 09, 2020 at 02:44:14PM +0200, Jeremie Courreges-Anglas wrote: >> On Thu, Apr 09 2020, Jeremie Courreges-Anglas wrote: >> > find(1) uses ARG_MAX to compute the maximum space it can pass to >> > execve(2). T

Re: find(1) -exec + and ARG_MAX

2020-04-09 Thread Jeremie Courreges-Anglas
On Thu, Apr 09 2020, Jeremie Courreges-Anglas wrote: > find(1) uses ARG_MAX to compute the maximum space it can pass to > execve(2). This doesn't fly if userland and the kernel don't agree, as > noticed by some after the recent ARG_MAX bump. > > --8<-- > ritchie /usr/src/u

find(1) -exec + and ARG_MAX

2020-04-08 Thread Jeremie Courreges-Anglas
find(1) uses ARG_MAX to compute the maximum space it can pass to execve(2). This doesn't fly if userland and the kernel don't agree, as noticed by some after the recent ARG_MAX bump. --8<-- ritchie /usr/src/usr.bin/find$ obj/find /usr/src/ -type f -exec true {} + find: true: Argument list too

Re: Kill cdev_mousewr_init()

2020-04-03 Thread Jeremie Courreges-Anglas
On Fri, Apr 03 2020, Martin Pieuchot wrote: > Unused macro, found while auditing d_poll() functions, ok? ok > Index: sys/conf.h > === > RCS file: /cvs/src/sys/sys/conf.h,v > retrieving revision 1.148 > diff -u -p -r1.148 conf.h >

rpki-client: output.c static/const tweaks

2020-03-09 Thread Jeremie Courreges-Anglas
Claudio suggested[0] to restrict the visibility of three helper functions in this file. The diff below goes a bit further, sprinkling some static and const magic to help the compiler generate better code. ok? [0] https://marc.info/?l=openbsd-tech=158375920102498=2 Index: extern.h

Re: rpki-client: check fflush on output files

2020-03-09 Thread Jeremie Courreges-Anglas
On Sat, Mar 07 2020, Claudio Jeker wrote: > On Sat, Mar 07, 2020 at 08:35:39AM +0100, Jeremie Courreges-Anglas wrote: >> On Fri, Mar 06 2020, "Theo de Raadt" wrote: >> >> Jeremie Courreges-Anglas wrote: >> >> > >> >> > >&g

Re: rpki-client: check fflush on output files

2020-03-06 Thread Jeremie Courreges-Anglas
On Fri, Mar 06 2020, "Theo de Raadt" wrote: >> Jeremie Courreges-Anglas wrote: >> > >> > >> > Checking the return value of fprintf is good but not enough to ensure >> > that data has properly been written to the file without an error. To

rpki-client: check fflush on output files

2020-03-06 Thread Jeremie Courreges-Anglas
Checking the return value of fprintf is good but not enough to ensure that data has properly been written to the file without an error. To do that we can use fflush(3) in a single place. Build-tested only. ok? Bonus: in output_finish(), "out = NULL;" is pointless, so zap it. I suspect it's a

Re: BIRD 1.x/2.x support at rpki-client

2020-03-06 Thread Jeremie Courreges-Anglas
On Fri, Mar 06 2020, Sebastian Benoit wrote: > Job Snijders(j...@openbsd.org) on 2020.03.06 17:31:13 +: >> I have a small suggestion, in some deployments I saw the convention to >> name it as following so it is clear the data came from user provided >> data rather than internal bird

Re: BIRD 1.x/2.x support at rpki-client

2020-03-06 Thread Jeremie Courreges-Anglas
On Fri, Mar 06 2020, Sebastian Benoit wrote: > Robert Scheck(rob...@fedoraproject.org) on 2020.03.06 14:02:26 +0100: >> On Fri, 06 Mar 2020, Job Snijders wrote: >> > I believe Robert is referring to this snippet of code: >> > >> > >> >

Re: apmd: fix autoaction timeout

2020-02-17 Thread Jeremie Courreges-Anglas
On Sat, Feb 15 2020, Jeremie Courreges-Anglas wrote: > On Fri, Feb 14 2020, Scott Cheloha wrote: >> On Thu, Feb 13, 2020 at 02:08:32PM +0100, Jeremie Courreges-Anglas wrote: >>> On Wed, Feb 12 2020, Scott Cheloha wrote: >>> > On Wed, Feb 12, 2020 at 01:35:22PM +

loongson: apm(4) resume event

2020-02-15 Thread Jeremie Courreges-Anglas
I'd like to use resume events in apmd(8) to throttle autoaction (-z/-Z). The acpi(4) code already sends the appropriate APM_NORMAL_RESUME event to userland, and the i386 apm(4) seems to do the same. Could someone with a loongson please build a kernel with the following diff? If you want to

Re: apmd: fix autoaction timeout

2020-02-14 Thread Jeremie Courreges-Anglas
On Fri, Feb 14 2020, Scott Cheloha wrote: > On Thu, Feb 13, 2020 at 02:08:32PM +0100, Jeremie Courreges-Anglas wrote: >> On Wed, Feb 12 2020, Scott Cheloha wrote: >> > On Wed, Feb 12, 2020 at 01:35:22PM +0100, Jeremie Courreges-Anglas wrote: >> >> On Wed, Feb 12

Re: apmd: fix autoaction timeout

2020-02-13 Thread Jeremie Courreges-Anglas
On Thu, Feb 13 2020, Jeremie Courreges-Anglas wrote: [...] > - documents the 60 seconds grace period in the manpage That part was not accurate. Updated wording: "After a resume, the effect of those options is inhibited for 60 seconds."

Re: apmd: fix autoaction timeout

2020-02-13 Thread Jeremie Courreges-Anglas
On Wed, Feb 12 2020, Scott Cheloha wrote: > On Wed, Feb 12, 2020 at 01:35:22PM +0100, Jeremie Courreges-Anglas wrote: >> On Wed, Feb 12 2020, Jeremie Courreges-Anglas wrote: >> > On Sat, Jan 25 2020, Jeremie Courreges-Anglas wrote: >> >> The diff below improves

Re: apmd: fix autoaction timeout

2020-02-12 Thread Jeremie Courreges-Anglas
On Wed, Feb 12 2020, Jeremie Courreges-Anglas wrote: > On Sat, Jan 25 2020, Jeremie Courreges-Anglas wrote: >> The diff below improves the way apmd -z/-Z may trigger. >> >> I think the current behavior is bogus, incrementing and checking >> apmtimeout like t

Re: apmd: fix autoaction timeout

2020-02-12 Thread Jeremie Courreges-Anglas
On Sat, Jan 25 2020, Jeremie Courreges-Anglas wrote: > The diff below improves the way apmd -z/-Z may trigger. > > I think the current behavior is bogus, incrementing and checking > apmtimeout like this doesn't make much sense. > > Here's a proposal: > - on APM_POWER

Re: sys/cdefs.h: fix __predict_false fallback implementation

2020-02-11 Thread Jeremie Courreges-Anglas
On Tue, Feb 11 2020, "Todd C. Miller" wrote: > On Tue, 11 Feb 2020 21:44:21 +, Nicholas Marriott wrote: > >> Looks like the existing code is OK, you still want to test the original >> expression even if you are predicting it is false, no? > > Right, the code is correct as written. Woops,

sys/cdefs.h: fix __predict_false fallback implementation

2020-02-11 Thread Jeremie Courreges-Anglas
Found while looking at __ISO_C_VISIBLE. I'm not sure which compilers would be affected. The fallback could simply be #define __predict_true(exp)(exp) #define __predict_false(exp) (exp) but I settled for a minimal change. ok? Index: cdefs.h

Re: macppc base-clang -msvr4-struct-return

2020-02-11 Thread Jeremie Courreges-Anglas
On Tue, Feb 11 2020, George Koehler wrote: > On Tue, 11 Feb 2020 15:20:00 +0100 > Jeremie Courreges-Anglas wrote: > >> fwiw I'm already ok with the diff George sent for ports/devel/llvm. >> I'm mostly ok with this one but it would be nice to know whether >> ba

sys/cdefs.h: visibility for old C++ standards

2020-02-11 Thread Jeremie Courreges-Anglas
IIUC we should limit the visibility of C features to ANSI C (instead of C11) for old C++ standards. I guess this is low priority so I didn't do much testing, but I can do a base+xenocara build on amd64 and sparc64 if deemed useful. Thoughts? Index: cdefs.h

Re: macppc base-clang -msvr4-struct-return

2020-02-11 Thread Jeremie Courreges-Anglas
On Wed, Feb 05 2020, Todd Mortimer wrote: > Hi George, > > On Tue, Feb 04, 2020 at 08:39:12PM -0500, George Koehler wrote: >> Hello tech list, >> >> This is a diff for base-clang. It would change the powerpc target to >> return small structs in registers r3 and r4. This would fix an >>

Re: remove needless #ifdef

2020-02-09 Thread Jeremie Courreges-Anglas
On Sun, Feb 09 2020, Jan Stary wrote: > Currently, sys/net/pipex_local.h asks #ifdef __OpenBSD__ > and if so, defines "Static" to be nothing, to use it later. > That can go away, right? I believe that's something the IIJ folks want to keep, cc'ing Yasuoka. > Jan > > > Index:

Re: acpiac(4): refresh status after resume (looking for tests)

2020-02-02 Thread Jeremie Courreges-Anglas
On Sat, Jan 25 2020, Jeremie Courreges-Anglas wrote: > So I have this diff for apmd -z/-Z that uses APM_POWER_CHANGE events to > trigger autosuspend. It works fine except for one glitch: if I plug the > AC cable and then resume, apmd will receive another APM_POWER_CHANGE > ev

Re: acme-client: prevent duplicate definitions of global variables

2020-02-01 Thread Jeremie Courreges-Anglas
On Fri, Jan 31 2020, Michael Forney wrote: > Every source file that includes extern.h will have its own definition > of these variables. Since many compilers allocate the variables with > .comm, they end up getting merged by the linker without error. > However, ISO C requires exactly one

Re: rdomain.4: Use -rdomain to delete rdomain

2020-02-01 Thread Jeremie Courreges-Anglas
On Sat, Feb 01 2020, Klemens Nanni wrote: > Small nit but this properly reflects the "delete" semantic, much better > than the implicit "reassign". > > ifconfig(8) also nicely mentions IPv4 and IPv6 addresses being purged > in the `-rdomain' part, should the reader consult this manual afterwards.

Re: [patch] /bin/cp: reduce scope variable

2020-02-01 Thread Jeremie Courreges-Anglas
On Fri, Jan 31 2020, Ingo Schwarze wrote: > Hi, > > ngc...@gmail.com wrote on Fri, Jan 31, 2020 at 10:14:52PM +0900: > >> Reduce scope of a few variables. > > No, this contradicts OpenBSD coding style. > We want local variables declared up front in functions > such that you can see at one glance

acpiac(4): refresh status after resume

2020-01-25 Thread Jeremie Courreges-Anglas
So I have this diff for apmd -z/-Z that uses APM_POWER_CHANGE events to trigger autosuspend. It works fine except for one glitch: if I plug the AC cable and then resume, apmd will receive another APM_POWER_CHANGE event and read the power info only to find that the AC is *unplugged*. So apmd

apmd: fix autoaction timeout

2020-01-25 Thread Jeremie Courreges-Anglas
The diff below improves the way apmd -z/-Z may trigger. I think the current behavior is bogus, incrementing and checking apmtimeout like this doesn't make much sense. Here's a proposal: - on APM_POWER_CHANGE events, check the battery level and trigger autoaction if needed. This should be

acpisbs(4): send APM events

2020-01-25 Thread Jeremie Courreges-Anglas
acpisbs(4) should send events to userland (apmd) whenever it refreshes its data, just like acpibat(4). I have no hw to test this, I'd welcome a runtime check with apmd -d. ok? Index: acpisbs.c === RCS file:

Re: apmd poll every minute

2020-01-25 Thread Jeremie Courreges-Anglas
On Fri, Jan 24 2020, "Ted Unangst" wrote: > Sometimes (particuarly if you are using apmd -z) the default polling interval > of 10 minutes is a bit lazy and we fail to respond to low battery situations > before they become no battery situations. > > Perhaps something smarter could be done, but the

ftp(1): setjmp, volatile and errno fixes

2020-01-15 Thread Jeremie Courreges-Anglas
Some of those tweaks were mentioned first in https://marc.info/?l=openbsd-tech=157672366409171=2 * Fix setjmp vs volatile usage: - "buf" shouldn't be modified after setjmp, else we break the setjmp contract: --8<-- All accessible objects have values as of the time the longjmp() routine

Re: ksh: support "function name()"

2020-01-07 Thread Jeremie Courreges-Anglas
On Tue, Jan 07 2020, Klemens Nanni wrote: > On Tue, Jan 07, 2020 at 06:47:16PM +0100, Jeremie Courreges-Anglas wrote: >> Bah, I think I understand why this was chosen. bash functions declared >> with "function name" or "function name()" aren't special.

Re: ksh: support "function name()"

2020-01-07 Thread Jeremie Courreges-Anglas
On Sat, Dec 28 2019, Klemens Nanni wrote: > On Sat, Dec 28, 2019 at 04:07:02PM +0100, Mark Kettenis wrote: >> Are there other ksh implementations that have this "feature"? > MirBSD's ksh allows all three forms but treats `function name()' like > `name()', that is $0 stays the same and will not be

ksh: support "function name()"

2019-12-28 Thread Jeremie Courreges-Anglas
We have a few ports (~12) patched because of shell script constructs like function usage() { which are rejected by our ksh. Indeed ksh only supports either usage() { or function usage { Both bash and zsh also allow an optional "()". The diff below implements the missing bits.

Re: [UPDATE] xterm 351

2019-12-26 Thread Jeremie Courreges-Anglas
On Mon, Dec 23 2019, Matthieu Herrb wrote: > Hi, > > the diff below (also available as https://xenocara.org/xterm-351.diff) > updates xterm to version 351 (from current version 344 in xenocara). > > For a detailed change log see > https://invisible-island.net/xterm/xterm.log.html > > Please test

Re: ftp(1): separate file:/ URL handling

2019-12-26 Thread Jeremie Courreges-Anglas
On Thu, Dec 19 2019, Jeremie Courreges-Anglas wrote: > A bit late... > > Move file: URL handling into its own function. This simplifies > url_get() and would have prevented problems with bogus redirections. > > file_get() unrolls the code previously used in url_get(), except t

ftp(1): separate file:/ URL handling

2019-12-18 Thread Jeremie Courreges-Anglas
A bit late... Move file: URL handling into its own function. This simplifies url_get() and would have prevented problems with bogus redirections. file_get() unrolls the code previously used in url_get(), except the #ifndef SMALL bits were stripped out. file: support is mainly (only?) used in

Re: /usr/bin/ftp: 308 Permanent Redirect

2019-12-14 Thread Jeremie Courreges-Anglas
On Sat, Dec 14 2019, Christopher Zimmermann wrote: > Hi, Hi, > to me it seems that since our ftp does only support GET requests anyway, > a 308 Redirect response can be handled identical to a 301 Redirect. OK? ok jca@ Do you need this for particular websites / implementations? > Christopher

Re: rpki-client: improve the distclean target

2019-12-10 Thread Jeremie Courreges-Anglas
On Mon, Dec 09 2019, "Marco d'Itri" wrote: > Without this patch distclean may leave around some *.old files generated > by configure. The portable build system is not used or maintained within the OpenBSD source tree*. You'll be better off reporting this to Kristaps at

ftp(1) fetch.c: print sent headers with -d

2019-12-09 Thread Jeremie Courreges-Anglas
Since rev 1.176 TLS connections are also handled with stdio. When removing the ftp_printf wrapper I also removed the optional printing of headers sent to the server. The diff below reinstates ftp_printf for !SMALL builds. For ramdisks, ftp_printf is just a #define so size doesn't change. ok?

Re: Infinite sleeps in kern/vfs_*

2019-12-08 Thread Jeremie Courreges-Anglas
On Thu, Dec 05 2019, Martin Pieuchot wrote: > Convert them to tsleep_nsec(9), ok? Pretty mechanical, no regression spotted on my laptop or on my amd64 and sparc64 builders. ok jca@ -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

Re: Infinite sleeps in sys/uvm

2019-12-08 Thread Jeremie Courreges-Anglas
On Thu, Dec 05 2019, Martin Pieuchot wrote: > Convert them to {m,t}sleep_nsec(9), ok? Pretty mechanical, no regression spotted on my laptop or on my amd64 and sparc64 builders. ok jca@ -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE

Re: C11 visibility in libc++

2019-12-08 Thread Jeremie Courreges-Anglas
On Sat, Dec 07 2019, Jonathan Gray wrote: > While we don't have C11's quick_exit() we do have timespec_get() and > struct timespec/aligned_alloc(). LGTM, ok jca@ For other readers, no shared_libs bump is needed, this only affects the headers. > Index: include/__config >

Re: ftp(1): https:// handling with NOSSL

2019-12-05 Thread Jeremie Courreges-Anglas
On Wed, Dec 04 2019, Jeremie Courreges-Anglas wrote: > ftp(1) built with no TLS support is confused (confusing?) when handled > an https url. I have noticed this during tests with > /usr/src/distrib/special/ftp. > > Now: > --8<-- > ritchie /usr/src/distrib/special/

  1   2   3   4   5   6   7   >