diff options
author | Omar Polo <op@cvs.openbsd.org> | 2024-05-28 07:10:31 +0000 |
---|---|---|
committer | Omar Polo <op@cvs.openbsd.org> | 2024-05-28 07:10:31 +0000 |
commit | 54984cc74d6596d517d0520e4031b87c5b1f371f (patch) | |
tree | 8d51748e64a88f211dc56f85a1e4079bf49aaf60 | |
parent | 4abbf8dca72cf071fb784f484a69b8e62577f43c (diff) |
actually honour the services supported by the proc tables
ok gilles@
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 3 | ||||
-rw-r--r-- | usr.sbin/smtpd/table.c | 5 | ||||
-rw-r--r-- | usr.sbin/smtpd/table_proc.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 0ab99d7f4f4..e7ff0e3cafb 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.684 2024/05/07 12:10:06 op Exp $ */ +/* $OpenBSD: smtpd.h,v 1.685 2024/05/28 07:10:30 op Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -356,6 +356,7 @@ struct table { enum table_type t_type; char t_config[PATH_MAX]; + unsigned int t_services; void *t_handle; struct table_backend *t_backend; }; diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c index d24892ede64..2b9c9cf2511 100644 --- a/usr.sbin/smtpd/table.c +++ b/usr.sbin/smtpd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.52 2024/05/07 12:10:06 op Exp $ */ +/* $OpenBSD: table.c,v 1.53 2024/05/28 07:10:30 op Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -245,6 +245,7 @@ table_create(struct smtpd *conf, const char *backend, const char *name, fatalx("table_create: backend \"%s\" does not exist", backend); t = xcalloc(1, sizeof(*t)); + t->t_services = tb->services; t->t_backend = tb; if (config) { @@ -341,7 +342,7 @@ table_check_type(struct table *t, uint32_t mask) int table_check_service(struct table *t, uint32_t mask) { - return t->t_backend->services & mask; + return t->t_services & mask; } int diff --git a/usr.sbin/smtpd/table_proc.c b/usr.sbin/smtpd/table_proc.c index e7f2a736bbd..07598ca69c6 100644 --- a/usr.sbin/smtpd/table_proc.c +++ b/usr.sbin/smtpd/table_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_proc.c,v 1.22 2024/05/23 17:10:00 op Exp $ */ +/* $OpenBSD: table_proc.c,v 1.23 2024/05/28 07:10:30 op Exp $ */ /* * Copyright (c) 2024 Omar Polo <op@openbsd.org> @@ -172,6 +172,7 @@ table_proc_open(struct table *table) if (services == 0) fatalx("table-proc: no services registered"); + table->t_services = services; table->t_handle = priv; return (1); |