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 > +++ patch.

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: smtpd: implement nullmx RFC 7505

2023-10-17 Thread Omar Polo
+ !strcasecmp(buf, "localhost")) { 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 c

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

2023-10-10 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 here

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: https://github.com/trogl

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

2023-09-21 Thread Omar Polo
nou8 = 0; > + while (i != len) ...and even then, 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

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 > +++ b/usr.bin/ssh/

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: bioctl: do not confirm new passphrases on stdin

2023-08-18 Thread Omar Polo
is enough 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: bioctl: do not confirm new passphrases on stdin

2023-08-17 Thread Omar Polo
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 interati

Re: httpd server "default" is not what I expected

2023-08-13 Thread Omar Polo
On 2023/08/13 11:27:18 +0100, Jason McIntyre wrote: > On Sun, Aug 13, 2023 at 11:21:39AM +0100, Stuart Henderson wrote: > > On 2023/08/13 11:13, Omar Polo wrote: > > > @@ -179,7 +179,8 @@ section starts with a declaration of the server > > > Each > > > .Ic

Re: httpd server "default" is not what I expected

2023-08-13 Thread Omar Polo
[moving to tech@, there's a diff for the manpage below] On 2023/08/13 01:04:11 -0700, Alfred Morgan wrote: > I was surprised that `server "default"` didn't act like I expected. In this > example I expected `test1` to get 200 and everything else to get 404 but > this is not the case. In this examp

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 numer

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 63543a609f

Re: httpd: use the host name in SERVER_NAME

2023-06-30 Thread Omar Polo
On 2023/06/30 15:29:07 +0200, Omar Polo wrote: > duh. sorry for the dumb question, it was obvious. Here's a better > diff. > > I've made strictier the syntax checks for IPv6 (after the closing ']' > there's the optional port but then nothing else)

Re: httpd: use the host name in SERVER_NAME

2023-06-30 Thread Omar Polo
On 2023/06/30 11:14:51 +0200, Florian Obser wrote: > On 2023-06-30 10:46 +02, Omar Polo wrote: > > On 2023/06/29 23:43:25 +0200, Omar Polo wrote: > >> On 2023/06/29 19:55:52 +0200, Florian Obser wrote: > >> > I'm worried that we pass un-sanitized input throu

Re: httpd: use the host name in SERVER_NAME

2023-06-30 Thread Omar Polo
On 2023/06/29 23:43:25 +0200, Omar Polo wrote: > On 2023/06/29 19:55:52 +0200, Florian Obser wrote: > > I'm worried that we pass un-sanitized input through to fcgi. > > Of course we are passing *a lot* of un-sanitized input through to fcgi, > > so does this matter in

Re: httpd: use the host name in SERVER_NAME

2023-06-29 Thread Omar Polo
On 2023/06/29 19:55:52 +0200, Florian Obser wrote: > I'm worried that we pass un-sanitized input through to fcgi. > Of course we are passing *a lot* of un-sanitized input through to fcgi, > so does this matter in the grand scheme of things? > But I'd like if server_http_parsehost() enforces syntac

Re: ftp: drop needless strcspn

2023-06-28 Thread Omar Polo
On 2023/06/28 18:47:17 +0200, Theo Buehler wrote: > On Wed, Jun 28, 2023 at 06:37:43PM +0200, Omar Polo wrote: > > A similar thing could be applied to rpki-client' http.c as well, it > > should work the same. > > Could you please send a diff? The files have diverged

ftp: drop needless strcspn

2023-06-28 Thread Omar Polo
since fetch.c revision 1.211 ("strip spaces at end of header lines and in chunked encoding headers") ftp removes trailing whitespaces early so we don't need to re-do that upon every header we parse. it can also be misleading since one can wonder why LAST_MODIFIED doesn't have " \t" but only "\t",

Re: mg.1: add no-tab-mode to set-default-mode description

2023-06-28 Thread Omar Polo
Hi, On 2023/06/27 18:53:44 -0700, "Simon Branch" wrote: > Hello! > > I've been enjoying the resurrection of no-tab-mode in mg(1). > It is simple to enable by default: > > set-default-mode notab > > The manual page says that "built in modes include fill, indent and > overwrite". This patch

smtpd, relayd, iked: drop ssl_init

2023-06-24 Thread Omar Polo
while talking about a related matter with tb and jsing, jsing noted that ssl_init() in smtpd is completely useless. All its loading is already done automatically by libcrypto at runtime, and judging by the implementation of the called functions there's no need to actually force the initialization.

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

2023-06-23 Thread Omar Polo
On 2023/06/22 13:18:43 -0600, Todd C. Miller wrote: > On Tue, 07 Feb 2023 20:35:10 -0700, Todd C. Miller wrote: > > > On Tue, 07 Feb 2023 17:17:02 -0700, Todd C. Miller wrote: > > > > > Yes, the bug is that the number is not displayed. The following > > > diff fixes that but there is still a bug

smtpd: allow arguments on NOOP

2023-06-23 Thread Omar Polo
another diff from the -portable repo: https://github.com/OpenSMTPD/OpenSMTPD/pull/1150 per rfc-5321 § 4.1.1.9 the NOOP command allows optionally one argument that we SHOULD ignore. The original diff set the check function in the commands table to NULL because NOOP is not a phase that can

Re: avoid truncation of filtered smtpd data lines

2023-06-21 Thread Omar Polo
On 2023/06/20 14:38:37 -0600, Todd C. Miller wrote: > > qid = ep+1; > > - if ((ep = strchr(qid, '|')) == NULL) > > - fatalx("Missing reqid: %s", line); > > - ep[0] = '\0'; > > - > > This is not a new problem but we really should set errno=0 before > calling strtoull() for the fi

Re: [patch] usr.sbin/smtpd filter localhost relays

2023-06-21 Thread Omar Polo
Hello, sorry for the delay and thanks for the patch. On 2023/02/28 12:16:17 +0100, Philipp wrote: > Hi > > On github someone reported an issue[0] regarding localhost MX entries. > Currently smtpd will just use the localhost relay. This leads to a > loop. Here a patch filtering localhost and loc

avoid truncation of filtered smtpd data lines

2023-06-20 Thread Omar Polo
hello tech@, this was reported some time ago on the OpenSMTPD-portable repository[0] [0]: https://github.com/OpenSMTPD/OpenSMTPD/pull/1192 Filters can register to the data-line event to alter the mail content. smtpd, when parsing the filter' output it first copies the received line in a temporar

httpd: use the host name in SERVER_NAME

2023-06-19 Thread Omar Polo
currently httpd uses the name specified in the config `server' block which is not guaranteed to be a valid hostname. quoting rfc3875: The SERVER_NAME variable MUST be set to the name of the server host to which the client request is directed. It is a case-insensitive hostname or network

smtpd: sync imsg_to_str()

2023-06-18 Thread Omar Polo
some imsg types are missing from the big switch in imsg_to_str(), noticed after a report in m...@opensmtpd.org. Tracing shows: : imsg: lka <- dispatcher: IMSG_??? (139) (len=42) (imsg #139 should be IMSG_REPORT_SMTP_FILTER_RESPONSE if I'm counting right.) Instead of checking one by one (they're

Re: K&R -> ANSI functions in config(8)

2023-06-16 Thread Omar Polo
On 2023/06/16 18:08:17 +0200, Theo Buehler wrote: > Trivial, but config is important, so I'd rather have an ok. fwiw ok op@ too, this time I remembered to pay attention to the order :) > Index: scan.l > === > RCS file: /cvs/src/usr.

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 o

smtpd-filters: swap link-auth fields

2023-06-14 Thread Omar Polo
c-exec "filter-rspamd" 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

vmd: relax absolute path requirement for configtest

2023-06-14 Thread Omar Polo
ny vm it should be fine, but apologize if I've missed something. Thanks, Omar Polo diff /usr/src commit - 66c6b79616659a94b04092c9f103e3aa29809704 path + /usr/src blob - 86a5132fe224856a3679f1a1d6863b87b561c9d0 file + usr.sbin/vmd/vmd.c --- usr.sbin/vmd/vmd.c +++ usr.sbin/vmd/vmd.c @@ -874,

Re: Diff for evaluation (WACOM tablet)

2023-06-11 Thread Omar Polo
e the content... Thanks, Omar Polo

Re: libtls, smtpd: switch to EC_KEY_METHOD

2023-06-10 Thread Omar Polo
On 2023/05/25 19:23:48 +0200, Omar Polo wrote: > As far as I (and grep) can see, smtpd and the part it needs in libtls > are the only user of ECDSA_METHOD in tree. > > What I've understood talking with tb (and apologizes if I'm making > mistakes) is that ECDSA

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

2023-06-03 Thread Omar Polo
On 2023/05/31 18:36:42 +0300, Anton Konyahin wrote: > On 31/05, Omar Polo wrote: > > >Agreed. I prefer the second patch too, which I'm reattaching since it > >was mangled (whitespaces; 'patch -l' is not enough, but 'got patch' > >manag

switch mail.local to getline()

2023-06-03 Thread Omar Polo
As per subject. While here I couldn't resist simplifying the "From " check too, although it is indipendent from the rest of the diff. (could commit separately if preferred.) ok? diff /usr/src commit - 79631e141468cced94e502d777a484fa0eb1f60f path + /usr/src blob - 815fe58323c8b912f5676a7d5a29cc9

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,

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 prefer

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: 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 t

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: make: slightly better diagnostic

2023-05-28 Thread Omar Polo
On 2023/05/28 13:16:34 +0200, Marc Espie wrote: > Turns out that, due to the search rules we use, make > is mostly silent in case it couldn't read a Makefile > > The following patch lets it track the makefilenames that > do exist, but that it wasn't able to open, so that > a post-mortem can inclu

libtls, smtpd: switch to EC_KEY_METHOD

2023-05-25 Thread Omar Polo
As far as I (and grep) can see, smtpd and the part it needs in libtls are the only user of ECDSA_METHOD in tree. What I've understood talking with tb (and apologizes if I'm making mistakes) is that ECDSA_METHOD was replaced with EC_KEY_METHOD. "We" inherited the former, it got used in smtpd, and

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 p

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

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 - 5577ca04b51f728d40b28bafa2d8de891d2fdac0

smtpd.conf.5: fix markup for action maildir

2023-05-19 Thread Omar Polo
it's currently rendered as maildir [pathname [junk]] whereas it really is maildir [pathname] [junk] i.e. both the path and `junk' are optional but indipendently so. it's quite clear from the grammar in parse.y. ok? diff /usr/src commit - beb1c6c70ae1e2a18abd99274d326b36106135

Re: user: handle paths with whitespace / metacharacters

2023-05-18 Thread Omar Polo
On 2023/05/18 11:28:58 -0600, Todd C. Miller wrote: > On Thu, 18 May 2023 18:13:57 +0200, Omar Polo wrote: > > > + if (ret != 0) > > > + warnx("[Warning] unable to run `%s'", buf); > > > > more than &qu

Re: user: handle paths with whitespace / metacharacters

2023-05-18 Thread Omar Polo
On 2023/05/18 09:11:59 -0600, Todd C. Miller wrote: > The way user(8) runs commands via system(3) is fragile. It does > not correctly handle paths with whitespace or shell metacharacters. > Rather than try to quote everything (which is also fragile) I think > it is safest to just exec the command

Re: useradd: use "cp" instead of "pax" to copy dot files

2023-05-16 Thread Omar Polo
On 2023/05/16 11:39:17 -0600, Todd C. Miller wrote: > We can just use "cp -a skeldir/. homedir" to copy the skeleton dot > files to the new user's homedir. There's no good reason to use pax > when cp will do and this will simplify a future commit of mine. hard links are handled differently, but

smtpd: some fatal -> fatalx

2023-05-16 Thread Omar Polo
while debugging a pebkac in -portable, I noticed that in various places we use fatal() for libtls failures. errno doesn't generally contains anything useful after libtls functions, and in most it's explicitly cleared to avoid misuse. just to provide a quick example, with `listen on ... ciphers fo

Re: smtpd: nits to reduce the diff with -portable

2023-05-15 Thread Omar Polo
On 2023/05/15 07:34:03 -0600, "Todd C. Miller" wrote: > On Mon, 15 May 2023 13:54:35 +0200, Omar Polo wrote: > > > almost always (cast)var. I've adjusted the spacing in the line I was > > touching, grepping for common types I could only find one instance of >

Re: smtpd: nits to reduce the diff with -portable

2023-05-15 Thread Omar Polo
On 2023/05/15 09:40:50 +0200, theo Buehler wrote: > Do we care that sometimes we (cast)var and sometimes we (cast) var? > Is this at least consistent per-file? almost always (cast)var. I've adjusted the spacing in the line I was touching, grepping for common types I could only find one instance

Re: smtpd: nits to reduce the diff with -portable

2023-05-15 Thread Omar Polo
On 2023/05/15 09:03:47 +0200, Omar Polo wrote: > On 2023/05/14 18:03:17 -0600, "Theo de Raadt" wrote: > > Omar Polo wrote: > > > On 2023/05/10 09:30:12 +0200, Theo Buehler wrote: > > > > > I forgot to include one off_t cast since it was in a different

Re: smtpd: nits to reduce the diff with -portable

2023-05-15 Thread Omar Polo
On 2023/05/14 18:03:17 -0600, "Theo de Raadt" wrote: > Omar Polo wrote: > > On 2023/05/10 09:30:12 +0200, Theo Buehler wrote: > > > > I forgot to include one off_t cast since it was in a different > > > > directory and -even if off topic because it&#

Re: smtpd: nits to reduce the diff with -portable

2023-05-10 Thread Omar Polo
On 2023/05/10 09:30:12 +0200, Theo Buehler wrote: > > I forgot to include one off_t cast since it was in a different > > directory and -even if off topic because it's not in portable- instead > > of "const"-ify only tz why don't mark as const also the two arrays day > > and month? > > ok. > > Th

Re: smtpd: nits to reduce the diff with -portable

2023-05-10 Thread Omar Polo
On 2023/05/09 19:41:51 -0600, "Todd C. Miller" wrote: > On Wed, 10 May 2023 00:55:54 +0200, Omar Polo wrote: > > > As per subject, here's a few misc nits that would reduce the > > difference with -portable. There's some printing of time_t via > >

smtpd: nits to reduce the diff with -portable

2023-05-09 Thread Omar Polo
As per subject, here's a few misc nits that would reduce the difference with -portable. There's some printing of time_t via casting to long long, some missing includes (even if in tree it builds nevertheless) and a const for a variable (no idea how it went there in -portable but it's not wrong so

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 pledge

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

2023-04-27 Thread Omar Polo
, i.e. $PWD/foo/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 p

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 > &

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

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 way

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

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, s

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 retrie

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 customi

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@), implem

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: 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)); >

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

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 - 5e332dd6b4d6aadab29719a5f3abe

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 type

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 pa

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 o

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 /var/db/li

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 stor

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. > > like t

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] 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 > +++ reg

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-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 compositor. 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. Using

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. > Ac

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 gi

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 a

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 yields

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 po

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/regr

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

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-u)

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

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 + /home/op/w/mg.m

Re: cwm: do not overlap menu entries

2022-10-14 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!

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, > `cwm

  1   2   >