Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: smtpd: actually save the services supported by proc tables
To:
gilles@poolp.org
Cc:
tech@openbsd.org
Date:
Tue, 28 May 2024 09:15:13 +0200

Download raw body.

Thread
On 2024/05/27 19:09:36 +0000, gilles@poolp.org wrote:
> May 27, 2024 7:59 PM, "Omar Polo" <op@omarpolo.com> wrote:
> 
> > for proc tables the actual services supported is known only after the
> > handshake. However, we still assume K_ANY for them, and it's a bit
> > gross. This is a step toward respecting what the actual table reported
> > it supports.
> > 
> > (this is also needed for Gilles' diff to offload authentication, since
> > otherwise all proc tables will hit the K_AUTH codepath.)
> > 
> > We could also remove K_ANY and leave the default services for the table
> > proc to zero at this point.
> > 
> > ok?
> > 
> 
> I'd rather have this diff than removing K_ANY as it's easier to understand
> what happens here.
> 
> ok gilles@

committed, thanks.

Just to be clear, whit a was thinking was to eventually follow-up with
this, with or without the removal of K_ANY (which would be unused if we
set the services to zero for proc tables.)

I'm not attached to this, can drop if you think it won't be clearer.

Index: smtpd-api.h
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/smtpd-api.h,v
diff -u -p -r1.36 smtpd-api.h
--- smtpd-api.h	23 Dec 2018 16:06:24 -0000	1.36
+++ smtpd-api.h	28 May 2024 07:13:45 -0000
@@ -136,7 +136,6 @@ enum table_service {
 	K_STRING	= 0x400,
 	K_REGEX		= 0x800,
 };
-#define K_ANY		  0xfff
 
 enum {
 	PROC_TABLE_OK,
Index: table_proc.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/table_proc.c,v
diff -u -p -r1.23 table_proc.c
--- table_proc.c	28 May 2024 07:10:30 -0000	1.23
+++ table_proc.c	28 May 2024 07:13:45 -0000
@@ -302,7 +302,7 @@ table_proc_fetch(struct table *table, en
 
 struct table_backend table_backend_proc = {
 	.name = "proc",
-	.services = K_ANY,
+	.services = 0,
 	.config = NULL,
 	.add = NULL,
 	.dump = NULL,