aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--gacopyz/gacopyz.c2
-rw-r--r--gacopyz/gacopyz.h3
-rw-r--r--src/engine.c15
4 files changed, 18 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 2eeaadd9..d522dac6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-16 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ Ported r1571 from branches/gmach:
+
+ * src/engine.c: (milter_conn_accept): Take a third argument,
+ specifying the actual length of the sa structure.
+ Return 0 if mailfromd_acl is not given.
+ * gacopyz/gacopyz.h, gacopyz/gacopyz.c: xxfi_accept takes third
+ argument, specifying the actual lengthof the sa structure.
+
2008-01-14 Sergey Poznyakoff <gray@gnu.org.ua>
* src/engine.c, src/mailfromd.h, src/main.c: Implement ACLs.
diff --git a/gacopyz/gacopyz.c b/gacopyz/gacopyz.c
index 98926384..c4d7292e 100644
--- a/gacopyz/gacopyz.c
+++ b/gacopyz/gacopyz.c
@@ -1461,7 +1461,7 @@ gacopyz_handle_connection(gacopyz_conn_t conn)
}
if (conn->desc.xxfi_accept
- && conn->desc.xxfi_accept(conn, fd, &addr)) {
+ && conn->desc.xxfi_accept(conn, fd, &addr, addrlen)) {
if (GACOPYZ_CONN_LOG_MATCH(conn, SMI_LOG_DEBUG))
gacopyz_log(SMI_LOG_DEBUG,
_("connection refused by xxfi_accept"));
diff --git a/gacopyz/gacopyz.h b/gacopyz/gacopyz.h
index 180b5097..2798914a 100644
--- a/gacopyz/gacopyz.h
+++ b/gacopyz/gacopyz.h
@@ -205,7 +205,8 @@ struct gacopyz_milter_descr
int (*xxfi_start) (); /* Child start callback */
int (*xxfi_finish) (); /* Child finish callback */
int (*xxfi_idle) (gacopyz_conn_t); /* Idle handler */
- int (*xxfi_accept) (gacopyz_conn_t, int, const milter_sockaddr_t *);
+ int (*xxfi_accept) (gacopyz_conn_t, int, const milter_sockaddr_t *,
+ int salen);
int logmask;
struct timeval ctx_timeout;
diff --git a/src/engine.c b/src/engine.c
index d125f982..b18de94e 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -1194,20 +1194,15 @@ child_start()
}
static int
-milter_conn_accept (gacopyz_conn_t conn, int fd, const milter_sockaddr_t *msa)
+milter_conn_accept (gacopyz_conn_t conn, int fd, const milter_sockaddr_t *msa,
+ int len)
{
- int len;
mu_acl_result_t res;
int rc;
char *p;
-
- switch (msa->sa.sa_family) {
- case AF_UNIX:
- len = sizeof(struct sockaddr_un);
- break;
- case AF_INET:
- len = sizeof(struct sockaddr_in);
- }
+
+ if (!mailfromd_acl)
+ return 0;
rc = mu_acl_check_sockaddr (mailfromd_acl, &msa->sa, len, &res);
if (rc) {

Return to:

Send suggestions and report system problems to the System administrator.