summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2008-01-16 13:59:09 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2008-01-16 13:59:09 (GMT)
commite6567554edba88735a97a846d1edb89025fa9863 (patch) (side-by-side diff)
treedc7392f996ed5601e7c5dd4a658164d153da57a6
parenta12e57ce84b3066deeb430d47e568b076330dda9 (diff)
downloadmailfromd-gmach-before-rename.tar.gz
mailfromd-gmach-before-rename.tar.bz2
Ported r1571 from branches/gmach:gmach-before-rename
* 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 length of the sa structure. git-svn-id: file:///svnroot/mailfromd/branches/gmach-before-rename@1574 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (more/less context) (ignore whitespace changes)
-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 2eeaadd..d522dac 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 9892638..c4d7292 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 180b509..2798914 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 d125f98..b18de94 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.