Re: grep: add --null flag

2021-01-22 Thread Omar Polo
quasi three-weekly ping. Is this such a bad idea? (TBH: I have still to look at how to write a regression test for this) Omar Polo writes: > Hello, > > There are various program, especially the one written with GNU grep in > mind, that expects various flags that grep in base

Re: grep: add --null flag

2021-01-25 Thread Omar Polo
Sorry for the delay, it was night in my timezone. Sebastian Benoit writes: > 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

grep: add --null flag

2021-01-04 Thread Omar Polo
ot missing something. If this has some chances of being accepted, I guess I should also add some regress test; I'll try to work on them soon, but in the meantime I'm sending this. Thanks, Omar Polo diff e992327fc31d0277a6f8518613a7db1b9face78b /home/op/w/openbs

scandir: arraysz signed vs unsigned

2021-04-25 Thread Omar Polo
, 107 arraysz, sizeof(struct dirent *)); ... Thanks, Omar Polo Index: scandir.c === RCS file: /home/cvs/src/lib/libc/gen/scandir.c,v retrieving revision 1.21 diff -u -p -r1.21 scandir.c --- scandir.c 28 Ju

cwm: add last-group command

2021-03-23 Thread Omar Polo
a default keybinding, so to test you have to add something like this to your .cwmrc bind-key 4-Tab group-last Cheers! Omar Polo Index: calmwm.h === RCS file: /home/cvs/xenocara/app/cwm/calmwm.h,v retrieving revision 1.375 diff -u

Re: cwm: add group-last command [Was: Re: cwm: add last-group command]

2021-04-03 Thread Omar Polo
Raf Czlonka writes: > On Sat, Apr 03, 2021 at 05:50:06PM BST, Omar Polo wrote: >> Omar Polo writes: >> >> > Hello tech@, > > Hi Omar, > >> > The attached patch adds a last-group command for cwm. Admittedly, >> >> (typo: it's group-last!

Re: cwm: add last-group command

2021-04-03 Thread Omar Polo
Omar Polo writes: > Hello tech@, > > The attached patch adds a last-group command for cwm. Admittedly, (typo: it's group-last! I mistyped that in the subject too, sorry) > last-group probably makes sense only in sticky group mode; all it does > is switching to the last group

Re: cwm: add group-last command [Was: Re: cwm: add last-group command]

2021-10-11 Thread Omar Polo
pace you were on with it. >> >> Many thanks to Omar Polo for doing all the original work. I've >> just updated the diff so it applies cleanly. Thanks for reviving the patch. I've kept using it this whole time and still found it super useful! >> OK? >> &

Re: mg and trailing whitespaces

2022-03-10 Thread Omar Polo
Mikhail wrote: > On Wed, Mar 02, 2022 at 09:47:31AM +0100, Omar Polo wrote: > > Hello tech, > > > > mg(1) has this tendency to leave a lot of trailing whitespaces around in > > auto-indent-mode and c-mode which I find annoying. Yes, there's > > delete

mg and trailing whitespaces

2022-03-02 Thread Omar Polo
gets a little bit harder to do. (as a next step I guess we could also garbage collect cc_strip_trailp, it was used in only one place before this patch and is unconditionally set to TRUE.) Thoughts/OK? Cheers, Omar Polo Index: cmode.c

Re: mg and trailing whitespaces

2022-03-28 Thread Omar Polo
Omar Polo wrote: > Hello tech, > > mg(1) has this tendency to leave a lot of trailing whitespaces around in > auto-indent-mode and c-mode which I find annoying. Yes, there's > delete-trailing-space but it works only on the current line (and not the > whole buffer as in

Re: cwm: add group-last command [Was: Re: cwm: add last-group command]

2022-01-26 Thread Omar Polo
Marcus MERIGHI writes: > Hello, > > I just stumbled over this and thought it deserves a friendly ping. > > Marcus thanks for the interest in the diff :) here's the diff re-attached for convenience, I've been using it for almost two years now! Quoting my original email: > The attached patch

Re: [feature] ssh-agent: new -A option (like -a) that overwrites existing sockets

2023-09-13 Thread Omar Polo
On 2023/09/13 15:08:40 +0200, Moritz Fain wrote: > Most of the code is already there; it's basically just adding a new flag. > > Happy to hear your feedback! can't comment on the diff itself, but the patch was mangled and so it doesn't apply. > --- a/usr.bin/ssh/ssh-agent.c > +++

Re: smtpd: implement nullmx RFC 7505

2023-10-17 Thread Omar Polo
{ if (found) continue; m_create(s->p, IMSG_MTA_DNS_HOST_END, 0, 0, -1); I'm still not convinced about this part however. It feels wrong to me to hardcode such a check, it seems too much paranoic. The follow-up would be to

Re: patch unveil fail

2023-10-25 Thread Omar Polo
On 2023/10/25 13:38:37 +0200, Alexander Bluhm wrote: > Index: patch.c > === > RCS file: /data/mirror/openbsd/cvs/src/usr.bin/patch/patch.c,v > diff -u -p -r1.74 patch.c > --- patch.c 19 Jul 2023 13:26:20 - 1.74 > +++

Re: Send international text with mail(1) - proposal and patches

2023-09-21 Thread Omar Polo
en, mbtowc is easier to use. See Ingo' /src/usr/bin/ls/utf8.c for an example usage. > + if (s[i] <= 0x7f) > + ++i; > + /* Two bytes case */ > + else if (s[i] >= 0xc2 && s[i] < 0xe0 && > + s[i + 1] >= 0x80 && s[i + 1] <= 0xbf) > + i += 2; > + /* Special three bytes case */ > + else if ((s[i] == 0xe0 && > + s[i + 1] >= 0xa0 && s[i + 1] <= 0xbf && > + s[i + 2] >= 0x80 && s[i + 2] <= 0xbf) || > [...] > } Admittedly I haven't followed the thread too closely, although I hope something like this will end up in mail(1) sometimes :-) Thanks, Omar Polo

mg: "support" for exuberant/universal ctags tags files

2023-09-27 Thread Omar Polo
TL;DR "support" because this is not about supporting the fancy new stuff, but just not breaking on a universal-ctags generated tag file. I'd just like to tell mg enough of the file format to ignore the extensions over plain tag files. The diff is mostly from troglobit' mg:

Re: smtpd: implement nullmx RFC 7505

2023-10-18 Thread Omar Polo
On 2023/10/18 08:40:14 +0100, Stuart Henderson wrote: > On 2023/10/17 22:27, Philipp wrote: > > [2023-10-17 17:32] Omar Polo > > > There is one part of the RFC7505 that I'd like to quote and discuss > > > with you however. The last paragraph of the section 3 s

Re: Send international text with mail(1) - proposal and patches

2023-10-11 Thread Omar Polo
Hello, Walter: I'm happy that you've been hacking on mail and at least in principle I think what you're doing makes sense; however, let's try to get one bit committed at a time. Let's start with the MIME needed for sending utf-8 messages. I've going through the various mail and I think it's

Re: bioctl: do not confirm new passphrases on stdin

2023-08-17 Thread Omar Polo
read + rpp_flag = interactive ? RPP_REQUIRE_TTY : RPP_STDIN but no strong opinion. > if (readpassphrase(prompt, passphrase, sizeof(passphrase), > rpp_flag) == NULL) > err(1, "unable to read passphrase"); still ok for me whichever option you prefer. Thanks, Omar Polo

Re: bioctl: do not confirm new passphrases on stdin

2023-08-17 Thread Omar Polo
On 2023/08/17 02:21:18 +, Klemens Nanni wrote: > On Fri, Aug 11, 2023 at 03:44:46PM +, Klemens Nanni wrote: > > On Wed, Aug 02, 2023 at 10:37:36AM +, Klemens Nanni wrote: > > > Creating new volumes prompts > > > Passphrase: > > > Re-type passphrase: > > > which is sane for

Re: bioctl: do not confirm new passphrases on stdin

2023-08-18 Thread Omar Polo
ough to convey what it does. also, to correct my previous mail On 2023/08/17 16:28:52 +0200, Omar Polo wrote: > On 2023/08/17 09:32:43 +, Klemens Nanni wrote: > > [...] > > @@ -1316,6 +1316,7 @@ derive_key(u_int32_t type, int rounds, u > > size_t pl; >

Re: [patch] netcat: support --crlf

2023-08-25 Thread Omar Polo
On 2023/08/25 09:07:35 -0600, "Theo de Raadt" wrote: > Pietro Cerutti wrote: > > > The motivation is that several network protocols are line oriented > > with CRLF as line terminators. SMTP and HTTP are among the most > > popular. > > Yet, all servers of those protocols and and will accept the

Re: mg and trailing whitespaces

2022-05-17 Thread Omar Polo
10 weeks bump :) (+cc lum@) Omar Polo wrote: > Hello tech, > > mg(1) has this tendency to leave a lot of trailing whitespaces around in > auto-indent-mode and c-mode which I find annoying. Yes, there's > delete-trailing-space but it works only on the current line (and not the

mg: dobeep_msgs and %s

2022-05-17 Thread Omar Polo
dobeep_msgs isn't printf-like: it just prints the two arguments separated by a space in the minibuffer. When it was introduced some call from ewprintf were incorrectly translated and the "%s" remained. For example, "M-g M-g abc RET" shows "Line number %s invalid". ok? diff

Re: grep(1): fix printing trailing context when using -m

2022-05-29 Thread Omar Polo
Dave Voutila wrote: > I noticed this today while grepping through a very long kdump output and > using something like: > > $ fgrep -n -m2 -C2 'kevent -1' dump.txt > 641- 31513 vmd RET sendmsg 1848/0x738 > 642- 31513 vmd CALL kevent(5,0x90d4c2e4000,1,0x90d8004a000,2048,0) > 643:

grep and --null (second try)

2022-05-27 Thread Omar Polo
Hello everyone, one year ago there was a thread for grep --null [0] and there seemed to be a general agreement (in the diff, not only in how wrong the name --null feels.) In the end it wasn't committed, I got distracted and continued to happily using my patched ~/bin/grep [0]:

Re: grep and --null (second try)

2022-06-26 Thread Omar Polo
friendly ping :) Omar Polo wrote: > Hello everyone, > > one year ago there was a thread for grep --null [0] and there seemed to > be a general agreement (in the diff, not only in how wrong the name > --null feels.) In the end it wasn't committed, I got distracted and > co

Re: grep and --null (second try)

2022-06-26 Thread Omar Polo
Omar Polo wrote: > friendly ping :) > > Omar Polo wrote: > > Hello everyone, > > > > one year ago there was a thread for grep --null [0] and there seemed to > > be a general agreement (in the diff, not only in how wrong the name > > --null feels.)

Re: quiz(6): fully switch to getline(3)

2022-07-24 Thread Omar Polo
Ben Fuller wrote: > Did anyone have a look at this? Feedback is appreciated. > > On Sun, Jul 03, 2022 at 02:31:42 +0100, Ben Fuller wrote: > > One of the fgetln(3)s was previously converted to getline(3), but not > > the other. > > > > diff --git games/quiz/quiz.c games/quiz/quiz.c > > index

Re: mg: handle prefix argument in shell-command{,-on-region}

2022-10-25 Thread Omar Polo
On 2022/10/13 12:25:00 +0200, Omar Polo wrote: > shell-command (M-!) and shell-command-on-region (M-|) works by > displaying the output of the command in a new buffer, but in emacs > using a prefix argument (C-u) allows to operate on the current buffer. > > diff belows adds that

Re: httpd: default to text/plain for .diff and .patch

2022-09-24 Thread Omar Polo
On 2022/09/23 21:37:13 +, Klemens Nanni wrote: > In the few places I run httpd(8) patches usually float around and I do > look at them with Firefox. > > But unless httpd.conf(5) contains `types { text/plain diff patch }' the > browser will download the file instead of displaying it as text.

acme-client: allow newlines in alternative names

2022-10-05 Thread Omar Polo
just a small scratch to itch; i'd prefer if i could split the alternative names in multiple lines without using \ so, now one should be able to write domain example.com { alternative names { some-subdomain.example.com another-subdomain.example.com

Re: make.1: sync variable substitution bits with NetBSD

2022-10-12 Thread Omar Polo
On 2022/10/12 10:45:49 +, Klemens Nanni wrote: > Anyone willing to OK either the previous NetBSD/FreeBSD sync diff or the > following minimal one which just mentions missing types? > > We can always improve from there, but being stuck at an incomplete and > thus misleading manual sucks.

mg: add zap-to-char and zap-up-to-char

2022-10-13 Thread Omar Polo
small quality-of-life addition. GNU Emacs has zap-to-char bound by to M-z and zap-up-to-char unbound; i'm unsure how closely we want to follow emacs here, IMHO zap-up-to-char is way more useful than zap-to-char and so i opted to bound M-z to zap-up-to-char by default. ok? diff

mg: handle prefix argument in shell-command{,-on-region}

2022-10-13 Thread Omar Polo
shell-command (M-!) and shell-command-on-region (M-|) works by displaying the output of the command in a new buffer, but in emacs using a prefix argument (C-u) allows to operate on the current buffer. diff belows adds that for mg. I can finally C-u M-! got diff RET when composing mails :) A

Re: cwm: do not overlap menu entries

2022-10-13 Thread Omar Polo
On 2022/10/13 15:16:47 +, Klemens Nanni wrote: > On Thu, Oct 13, 2022 at 04:39:04PM +0200, Omar Polo wrote: > > On 2022/10/13 13:00:34 +, Klemens Nanni wrote: > > > On Thu, Oct 13, 2022 at 08:28:50AM -0400, Okan Demirmen wrote: > > > > And I keep missing it

Re: cwm: do not overlap menu entries

2022-10-13 Thread Omar Polo
On 2022/10/13 13:00:34 +, Klemens Nanni wrote: > On Thu, Oct 13, 2022 at 08:28:50AM -0400, Okan Demirmen wrote: > > And I keep missing it! I can't reproduce this - can you share the font > > you're using maybe? > > Whatever is the default, I never fiddled with fonts in X, no xorg.conf, >

Re: mg: add zap-to-char and zap-up-to-char

2022-10-13 Thread Omar Polo
On 2022/10/13 13:35:18 +0200, Florian Obser wrote: > On 2022-10-13 12:16 +02, Omar Polo wrote: > > small quality-of-life addition. GNU Emacs has zap-to-char bound by to > > M-z and zap-up-to-char unbound; i'm unsure how closely we want to > > follow emacs here, IMHO zap-u

Re: cwm: do not overlap menu entries

2022-10-15 Thread Omar Polo
On 2022/10/14 14:11:19 -0400, Okan Demirmen wrote: > the below seems to work: Walter (thanks!) found the spot i missed on > replacing height with ascent+descent. > > please let me know. diff reads fine works for me too, thanks!

mg: ewprintf("") -> eerase()

2022-10-15 Thread Omar Polo
as per subject; the effect is almost the same, they both clear the echo area, but ewprintf("") sets `epresf' to require an additional eerase() on the next-next input cycle. avoid extra work! :) ok? diff /home/op/w/mg.master commit - 4912f94d4a7e2b653e74201ac73923335fd298aa path +

Re: [PATCH] adds -t timeout to slowcgi

2022-08-06 Thread Omar Polo
after the other thread on tech@ reminded me this is still pending, i took a look, tested and committed it with some minor tweaks. Thanks! Florian Obser wrote: > On 2022-06-10 04:27 -07, Alfred Morgan wrote: > > Index: slowcgi.8 > >

Re: slowcgi with configurable timeout

2022-08-06 Thread Omar Polo
Hello, Fox Steward wrote: > Hi, > > requests to slowcgi by default have a timeout limit of 120 seconds. > In certain scenarios this may not be sufficient (e.g. slow internet > connection). > > I propose to add a flag "-t" for this value to be configurable. > In the following patch I set the

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

2022-08-08 Thread Omar Polo
bump Omar Polo wrote: > Ben Fuller wrote: > > On Sun, Jul 03, 2022 at 02:31:42 +0100, Ben Fuller wrote: > > > One of the fgetln(3)s was previously converted to getline(3), but not > > > the other. > > > > > > diff --git games/quiz/quiz.c games/qui

Re: slowcgi, httpd and fastcgi abnormal termination

2022-08-10 Thread Omar Polo
On 2022/08/10 15:07:15 +0200, Claudio Jeker wrote: > On Sun, Aug 07, 2022 at 11:10:22AM +0200, Omar Polo wrote: > > blob - ddf83f965d0e6a99ada695694bea77b775bae2aa > > blob + 1d577ba63efca388ca3644d1a52d9b3d9f246014 > > --- usr.sbin/slowcgi/slowcgi.c > > +++

Re: httpd: plug fd/memory leaks in error paths

2022-08-15 Thread Omar Polo
On 2022/08/15 08:53:05 +0200, Theo Buehler wrote: > On Sun, Aug 14, 2022 at 11:15:16PM +0200, Omar Polo wrote: > > I was looking for something different when I stumbled upon this. > > > > - in server_file_index `escapedpath' is leaked if evbuffer_add_printf > >fai

httpd: plug fd/memory leaks in error paths

2022-08-14 Thread Omar Polo
I was looking for something different when I stumbled upon this. - in server_file_index `escapedpath' is leaked if evbuffer_add_printf fails, similarly the directory entries in the loop. `escapeduri' is also leaked if escape_html fails. - read_errdoc leaks a file descriptor if fstat

Re: httpd: plug fd/memory leaks in error paths

2022-08-15 Thread Omar Polo
On 2022/08/15 10:13:07 +0200, Theo Buehler wrote: > I think you should move the scandir() call to right before the for loop. > This way the two goto fail before the for loop don't leak the namelist > (one of these leaks was already there, the other one is added in your > diff). right, with the

Re: httpd server_fcgi_read vs HEAD requests

2022-08-11 Thread Omar Polo
On 2022/08/11 19:37:08 +0200, Claudio Jeker wrote: > Reading through the fcgi code of httpd I wonder if HEAD requests are > handled correctly. In server_fcgi_read() the function just returns when it > hits the HEAD case but I think this is not correct since it does not drain > the clt_srvevb

Re: httpd server_fcgi_read vs HEAD requests

2022-08-12 Thread Omar Polo
On 2022/08/11 23:11:11 +0200, Claudio Jeker wrote: > On Thu, Aug 11, 2022 at 08:41:43PM +0200, Omar Polo wrote: > > On 2022/08/11 19:37:08 +0200, Claudio Jeker wrote: > > > Reading through the fcgi code of httpd I wonder if HEAD requests are > > > handled cor

patch(1) fix dwim for reversed patch

2022-08-01 Thread Omar Polo
i was looking for a different issue in patch when i found this. patch(1) fails to recognize the reversal application of a patch that creates a file (this is test t3). since an empty context always matches, the idea is to run the dwim code also when locate_hunk succeeds, but only if the patch

patch(1): fix locate_hunk for empty files

2022-08-01 Thread Omar Polo
there's an edge case in locate_hunk with empty files; if `first_guess' is zero then main() assumes that locate_hunk has failed and aborts the patch operation. Instead, make sure to return 1 (the line number) so that the patch operation can continue. this issue was found by Neels Hofmeyr (I

slowcgi, httpd and fastcgi abnormal termination

2022-08-07 Thread Omar Polo
I'm not sure httpd(8) handles correctly when the fastcgi application (e.g. slowcgi) closes the connection prematurely. To verify it, I'm playing with three simple CGI scripts running under slowcgi with a very low timeout (-t2). The scripts test "hangs" (which slowcgi turns into hard

Re: [patch] arp.c spaces nested between tabs

2022-12-29 Thread Omar Polo
On 2022/12/28 12:21:07 -0500, Paul Tagliamonte wrote: > [2]: {openbsd monks avert your eyes: gnu grep and bash w/ 'shopt -s extglob'}: > $ grep -P '\t +\t' !(gnu|sys) -ril ksh actually supports that style of globbing :) % ls -d !(gnu|sys) Makefiledistrib/include/

Re: units(1): support personal library

2022-12-29 Thread Omar Polo
On 2022/12/24 11:56:37 +0100, Florian Obser wrote: > This is at least supported by FreeBSD's units(1) as well as by > systemd/Linux. > > [...] > > OK? it's really handy, ok for me! (with s/options/option as mentioned by Crystal Kolipe.) the -f '' seems a bit weird to be fair, but it's also

Re: mg: handle prefix argument in shell-command{,-on-region}

2022-12-15 Thread Omar Polo
ping... On 2022/11/22 11:53:35 +0100, Omar Polo wrote: > anyone? > > On 2022/11/09 09:00:03 +0100, Omar Polo wrote: > > bump > > > > On 2022/10/25 14:30:51 +0200, Omar Polo wrote: > > > On 2022/10/13 12:25:00 +0200, Omar Polo wrote: > > > > sh

Re: mg: handle prefix argument in shell-command{,-on-region}

2022-11-22 Thread Omar Polo
anyone? On 2022/11/09 09:00:03 +0100, Omar Polo wrote: > bump > > On 2022/10/25 14:30:51 +0200, Omar Polo wrote: > > On 2022/10/13 12:25:00 +0200, Omar Polo wrote: > > > shell-command (M-!) and shell-command-on-region (M-|) works by > > > displaying the outp

mg: M-x grep: don't append /dev/null to cmdline

2023-01-26 Thread Omar Polo
One (midly annoying) feature of mg is that it appends /dev/null to the grep invocation. I guess this was done so grep is never called with only one file argument and so it always displays the filename in its output. However, this gets a bit annoying when one only types "grep -n -R foo" and

Re: mg: handle prefix argument in shell-command{,-on-region}

2022-11-09 Thread Omar Polo
bump On 2022/10/25 14:30:51 +0200, Omar Polo wrote: > On 2022/10/13 12:25:00 +0200, Omar Polo wrote: > > shell-command (M-!) and shell-command-on-region (M-|) works by > > displaying the output of the command in a new buffer, but in emacs > > using a prefix argument (C

Re: mg: handle prefix argument in shell-command{,-on-region}

2023-03-08 Thread Omar Polo
friendly 12 week ping :) On 2022/12/15 09:19:27 +0100, Omar Polo wrote: > > > > On 2022/10/13 12:25:00 +0200, Omar Polo wrote: > > > > > shell-command (M-!) and shell-command-on-region (M-|) works by > > > > > displaying the output of the command in

Re: cd CDPATH is attempted before dir

2023-03-10 Thread Omar Polo
On 2023/03/10 11:16:31 +, s...@disroot.org wrote: > I believe since the given directory (argument) is not an absolute path; > it attempts to search in CDPATH before checking if the directory > exists. This will cause any attempts to cd into a directory to fail. > > I also believe that the

Re: smtpd: simplify token name extraction for %{name}

2023-03-19 Thread Omar Polo
On 2023/03/19 08:11:27 -0600, Todd C. Miller wrote: > The current code for extracting the token name from %{name} can be > simplified by computing the token name length. The existing code > copies "name}" to token[] using memcpy(), then strchr() to find the > '}' and replace it with a NUL.

Re: [PATCH] cwm: fix transparency of 32 bit client's border

2023-03-22 Thread Omar Polo
On 2023/03/16 17:01:27 +0100, Omar Polo wrote: > moving to tech@, +cc okan@ > > On 2023/03/16 11:07:26 +0100, Julien Blanchard wrote: > > Hello, > > Here is a patch that fixes a weird semi-transparency issue some apps > > have when using cwm with a

Re: [patch] usr.bin/mg/tags.c: Add free()

2023-03-22 Thread Omar Polo
I've committed a slightly tweaked version of your diff: diff /usr/src commit - 17d31bf3ed9de46ea3449b69914ea1ac97418884 path + /usr/src blob - f2976f9ac9b98c51cebae458ccd266c6442181bb file + usr.bin/mg/tags.c --- usr.bin/mg/tags.c +++ usr.bin/mg/tags.c @@ -369,12 +369,12 @@ addctag(char *l) int

Re: [PATCH] cwm: fix transparency of 32 bit client's border

2023-03-16 Thread Omar Polo
moving to tech@, +cc okan@ On 2023/03/16 11:07:26 +0100, Julien Blanchard wrote: > Hello, > Here is a patch that fixes a weird semi-transparency issue some apps > have when using cwm with a compositor. The issue seems to be that the > highest significant byte of the color is not initialized. >

mg: fix spacing in a few dobeep_msgs() calls

2023-04-17 Thread Omar Polo
as per subject, when dobeep_msgs() was introduced some places weren't converted correctly: it already adds a space between the two arguments, so no need to duplicate. Index: extend.c === RCS file: /cvs/src/usr.bin/mg/extend.c,v

mg: fix buffer overflow in displaymatch()

2023-04-17 Thread Omar Polo
When the match for a character is not in the visible part of the window, mg shows a copy of that line in the echo area. To do so, it copies the line to a local buffer, so that tabs and control characters can be rendered properly, but doesn't check for overflow. NLINE (the size of `buf') is 256,

mg: allow to change the tab width

2023-04-17 Thread Omar Polo
This makes the tab width customizable per-buffer. There's a new function called `set-tab-width' that changes the tab width for the current buffer or the default one for new buffers if called with a prefix argument (or from the startup file.) The default tab width is still 8 column if not changed

Re: mg: rework adjustname() and drop expandtilde()

2023-04-27 Thread Omar Polo
/foo/baz. On 2023/04/23 18:08:18 +0200, Omar Polo wrote: > adjustname() should canonicalize the given path, but it does not do it > always, resulting in some bizzare situations. > > it calls realpath(3) but when it fails the given path is returned > as-is. This in practice can hap

mg.1: mark up commands

2023-04-25 Thread Omar Polo
The commands are sometimes typed as-is, sometimes in single quotes 'like-this' and sometime inside Dq. I'd prefer to consistently use Ic for commands (which I believe is the appropriate mandoc macro). As a by-product, this allows to jump via :t to the description, which is very handy. I haven't

Re: mg.1: mark up commands

2023-04-25 Thread Omar Polo
On 2023/04/25 21:01:21 +0100, Jason McIntyre wrote: > On Tue, Apr 25, 2023 at 03:58:08PM +0200, Omar Polo wrote: > > The commands are sometimes typed as-is, sometimes in single quotes > > 'like-this' and sometime inside Dq. I'd prefer to consistently use Ic > > for comm

mg: enable no-tab-mode

2023-04-16 Thread Omar Polo
The `no-tab-mode' minor mode is currently hidden behind some #ifdef, and I'd like to enable it since it's really useful. It's the equivalent of vi' `expandtab', i.e. makes the TAB key inserting spaces up to the next tab stop. My plan would be to follow-up with a diff to make the tab width

mg: rework adjustname() and drop expandtilde()

2023-04-23 Thread Omar Polo
adjustname() should canonicalize the given path, but it does not do it always, resulting in some bizzare situations. it calls realpath(3) but when it fails the given path is returned as-is. This in practice can happen quite often since it's not usual for an editor to visit new files. A quick

Re: [patch] usr.bin/mg/region.c: Set default shell path if SHELL is NULL

2023-03-28 Thread Omar Polo
On 2023/03/28 10:21:59 +0200, Omar Polo wrote: > On 2023/03/27 18:58:07 -0600, Todd C. Miller wrote: > > It might be best to use the basename of the actual shell for argv[0]. > > Our ksh for instance has slightly different behavior when invoked > > as sh. > > lik

mg: don't load tags files lazily

2023-03-28 Thread Omar Polo
tagsvisit (aka `visit-tags-table') records the path to the tags file which is lazily opened upon find-tags (aka M-.). visit-tags-table tries also to be smart and checks that the argument is really a file using a stat + access dance, and loadtags() which will be called way later just opens the

Re: mg: fix tagfile parsing

2023-03-28 Thread Omar Polo
On 2023/03/28 22:25:42 +0200, Theo Buehler wrote: > Contrary to what I convinced op@ to be the case, duplicate tags may exist > in legitimate tags files. So we should ignore duplicates rather than > erroring on them. This fixes parsing the /var/db/libc.tags file. > > $ grep -wc ^memcpy

Re: [patch] usr.bin/mg/region.c: Set default shell path if SHELL is NULL

2023-03-27 Thread Omar Polo
Hello, On 2023/03/28 00:53:05 +0800, lux wrote: > Index: region.c > === > RCS file: /cvs/src/usr.bin/mg/region.c,v > retrieving revision 1.40 > diff -u -p -r1.40 region.c > --- region.c 8 Mar 2023 04:43:11 - 1.40 > +++

Re: [patch] /usr.bin/script: Fix process name hardcode for shell subprocesses

2023-03-30 Thread Omar Polo
Hello, On 2023/03/29 22:39:52 +0800, lux wrote: > Hi, the name of the shell subprocess is hardcoded in the `script' > command. > > The test is as follows: > > $ echo $SHELL > /bin/ksh > $ script -c 'echo $0' > Script started, output file is

csh.1 markup fix

2023-03-30 Thread Omar Polo
noticed because it renders oddly: kill %job kill[-s signal_name] pid kill -sig pid ... The Op on its own line becomes part of the item body instead of the item itself. Use an in-line Oo ... Oc instead, ok? diff /usr/src commit -

Re: mg: don't access(conffile), just open it

2023-03-30 Thread Omar Polo
On 2023/03/30 18:11:32 +0200, Theo Buehler wrote: > On Thu, Mar 30, 2023 at 03:47:24PM +0200, Omar Polo wrote: > > - else if (bufp[0] == '\0') > > + if (bufp[0] == '\0') > > return (FALSE); > > - return (load(fname)); > > + if ((bufp =

Re: [patch] /usr.bin/script: Fix process name hardcode for shell subprocesses

2023-03-30 Thread Omar Polo
On 2023/03/30 22:59:08 +0800, lux wrote: > On Thu, 2023-03-30 at 16:31 +0200, Omar Polo wrote: > > > > Furthermore, the man page explicitly states that script -c runs > > sh(1): > > > > -c command > > Run sh -c command, instead of an i

mg: don't access(conffile), just open it

2023-03-30 Thread Omar Polo
There's this "pattern" in mg where it first access(2) a path, then does a buch of other things and finally opens it. It can do better. Diff below removes the access() calls for conffile handling. startupfile() now does an ffropen() (fopen() wrapper) instead of access() and returns the file via

Re: mg: don't access(conffile), just open it

2023-03-30 Thread Omar Polo
On 2023/03/30 20:09:21 +0200, Theo Buehler wrote: > > Index: main.c > [...] > > @@ -159,8 +162,10 @@ main(int argc, char **argv) > > update(CMODE); > > > > /* user startup file. */ > > - if ((cp = startupfile(NULL, conffile)) != NULL) > > - (void)load(cp); > > + if (ffp) {

Re: [installer] default answer to "Is the disk partition already mounted?"

2023-04-01 Thread Omar Polo
On 2023/04/01 16:33:39 +0300, Mikhail wrote: > Currently default answer for the question is 'yes', which is not true > for install case, but correct for upgrade one. > > Changing default answer depending on the mode of the installer looks > like a good approach. Idea by Christian (naddy@),

mg: drop needless global tagsfn path

2023-03-29 Thread Omar Polo
mg keeps the path to the last loaded tag file in tagsfn which was used both for the lazily loading (now removed) and as a flag to know if any tags are currently loaded. It's redundant, we can just check if the rb tree is empty instead. The only difference I can think of is with the corner cases

Re: [patch] usr.bin/mg/region.c: Set default shell path if SHELL is NULL

2023-03-28 Thread Omar Polo
On 2023/03/28 17:02:18 +0800, lux wrote: > On Mon, 2023-03-27 at 18:58 -0600, Todd C.Miller wrote: > > > > > -   _exit(1); > > > -   if (path == NULL) > > > _exit(1); > > >   > > Hi, `pipeio' looks like a common function, so maby called in

Re: [patch] usr.bin/mg/region.c: Set default shell path if SHELL is NULL

2023-03-28 Thread Omar Polo
On 2023/03/27 18:58:07 -0600, Todd C. Miller wrote: > On Mon, 27 Mar 2023 20:06:30 +0200, Omar Polo wrote: > > > Is _PATH_BSHELL portable though? I can see a few stuff that uses it > > (vi among others) but I'm not sure. > > The paths.h header is a BSD invention,

Re: patch: profiling using utrace(2) (compatible with pledge and unveil)

2023-05-04 Thread Omar Polo
On 2023/04/11 09:28:31 +0200, Sebastien Marie wrote: > Hi, > > After otto@ work on mallocdump using utrace(2), I started to look again at > profiling (see moncontrol(2)). > > The current implementation tries to write a gmon.out file at program exit(3) > time, which isn't compatible with

smtpd-filters: swap link-auth fields

2023-06-14 Thread Omar Polo
listen on lo0 smtps pki localhost auth filter "rspamd" and try to do a login: $ nc -c -Tnoverify localhost 465 helo localhost auth login b3xw MTMyNA== Thanks, Omar Polo diff /usr/src commit - 66c6b79616659a94b04092c9f103e3a

Re: smtpd-filters: swap link-auth fields

2023-06-14 Thread Omar Polo
On 2023/06/14 16:34:39 +0200, Omar Polo wrote: > For opensmtpd-filter-rspamd I have a corresponding diff that I'll send > to Gilles as it is off-topic for tech@, but here it is too if you want > to play with it: > > https://paste.omarpolo.com/9jtli2w apologize, this one ha

Re: patch(1): don't run off the end in num_components.

2023-07-12 Thread Omar Polo
On 2023/07/12 12:54:54 +0200, Florian Obser wrote: > Found with afl, if path ends in '/', num_components will run off the end > of the string. > > OK? ok op > (this is on top of tb's fix on bugs but should be independent and not > cause conflicts.) > > diff --git pch.c pch.c > index

Re: Remove ENGINE use from relayd

2023-07-13 Thread Omar Polo
On 2023/07/13 05:44:03 +0200, Theo Buehler wrote: > This is analogous to the change that op committed to smtpd a few days > ago. Instead of using ENGINE to make RSA use privsep via imsg, create > an RSA method that has custom priv_enc/priv_dec methods, replace the > default RSA method. Ditch

Re: make: slightly better diagnostic

2023-05-28 Thread Omar Polo
On 2023/05/28 18:09:00 +0200, Marc Espie wrote: > Here's a slightly more specific diff avoiding useless stat(2) looks fine to me, and in ports it produces a nice error message: % chmod 600 Makefile % make [...] make: don't know how to make do-extract Stop

Re: Bail out on "id -R user"

2023-05-30 Thread Omar Polo
On 2023/05/29 16:37:39 +, Lucas wrote: > Ping. > > > According to both usage() and id.1, "id -R" doesn't accept any > > positional arguments. This diff makes program behave like that. sorry for the delay, i wanted to take a look earlier. fwiw I agree. Although it doesn't makes much sense

Re: ksh, test: test -t file descriptor isn't optional

2023-05-30 Thread Omar Polo
sorry for the delay, this is another mail that I meant to take a look earlier... On 2023/05/29 16:36:45 +, Lucas wrote: > Ping. > > > Hi tech@, > > > > Both test.1 and ksh.1 (under the non-POSIX compatibility flag) state > > that `test -t` will default to test whether fd 1 is a TTY if the

Re: hack game: fix launch without /usr/games in path

2023-05-31 Thread Omar Polo
On 2023/05/29 08:46:02 +0300, Anton Konyahin wrote: > I can suggest another (much less) patch, which still allows users to > play hack without path modification. But all this stuff with checking > saves creating time doesn't looks actual for me, so I keep original > patch below. Agreed. I

smtpd: add missing time.h include

2023-05-31 Thread Omar Polo
Another boring diff from opensmtpd-portable. After a report of a build fail with some old gcc on RHEL7 / Centos, I noticed that we're lacking the include time.h for time(3), clock_gettime(3) and localtime(3). Diff below adds it in all the missing files. I'm also including sys/time.h in smtpd.h,

sticky(8): mark S_ISVTX as Dv

2023-05-24 Thread Omar Polo
It makes `man -k any=S_ISVTX' slightly more useful by pointing at sticky(8) too other than strmode(3); may help if someone (like me :-) forgot about sticky(8) files. ok? diff /usr/src commit - beb1c6c70ae1e2a18abd99274d326b36106135ad path + /usr/src blob -

smtpd.h: drop two unused define

2023-05-25 Thread Omar Polo
both values have been unused for quite some time. last PROC_COUNT use was removed in 'Implement the fork+exec pattern in smtpd' by eric@ in 2016. I've checked the other #defines and they seem to be all used, except these two. ok? diff /usr/src commit - 6f5cff98d90c274a5222db1a9bd17d5c26da7920

Re: userdel: remove login group for =uid

2023-05-24 Thread Omar Polo
On 2023/05/19 10:24:58 -0600, Todd C. Miller wrote: > If /etc/usermgmt.conf has a line like: > > group =uid > > where a new user's group ID in the passwd file is the same as their > user ID, remove that group when the user is removed. The group is > only removed if it matches the login

  1   2   >