From c78519057f7bfde0bff03cba5613d0c2b7e0e913 Mon Sep 17 00:00:00 2001 From: ume Date: Wed, 22 Jan 2003 14:30:20 +0000 Subject: better workaround against PF_LOCAL. --- mail/cyrus-imapd23/files/patch-df | 21 ++++++++------------- .../files/patch-master::service-thread.c | 21 ++++++++------------- 2 files changed, 16 insertions(+), 26 deletions(-) (limited to 'mail/cyrus-imapd23') diff --git a/mail/cyrus-imapd23/files/patch-df b/mail/cyrus-imapd23/files/patch-df index e95e795d2092..69a0841343ee 100644 --- a/mail/cyrus-imapd23/files/patch-df +++ b/mail/cyrus-imapd23/files/patch-df @@ -1,19 +1,14 @@ Index: master/service.c diff -u master/service.c.orig master/service.c ---- master/service.c.orig Thu Aug 15 06:02:41 2002 -+++ master/service.c Fri Aug 16 00:28:31 2002 -@@ -103,8 +103,13 @@ +--- master/service.c.orig Wed Jan 22 22:52:36 2003 ++++ master/service.c Wed Jan 22 22:57:20 2003 +@@ -102,6 +102,9 @@ + struct sockaddr_storage sin; socklen_t len = sizeof(sin); ++ /* XXX: old FreeBSD didn't fill sockaddr correctly against AF_UNIX */ ++ sin.ss_family = AF_UNIX; ++ /* is this a connection from the local host? */ -+ memset(&sin, 0, len); if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) { -- if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) { -+ switch (((struct sockaddr *)&sin)->sa_family) { -+ case AF_INET: -+ case AF_INET6: -+ break; -+ default: - return 1; - } - } + if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) { diff --git a/mail/cyrus-imapd23/files/patch-master::service-thread.c b/mail/cyrus-imapd23/files/patch-master::service-thread.c index ea5dfd8b0b2e..9a2016c3c64a 100644 --- a/mail/cyrus-imapd23/files/patch-master::service-thread.c +++ b/mail/cyrus-imapd23/files/patch-master::service-thread.c @@ -1,19 +1,14 @@ Index: master/service-thread.c diff -u master/service-thread.c.orig master/service-thread.c ---- master/service-thread.c.orig Fri Sep 13 18:43:06 2002 -+++ master/service-thread.c Fri Sep 13 19:15:50 2002 -@@ -100,8 +100,13 @@ +--- master/service-thread.c.orig Wed Jan 22 22:52:36 2003 ++++ master/service-thread.c Wed Jan 22 23:09:52 2003 +@@ -99,6 +99,9 @@ + struct sockaddr_storage sin; socklen_t len = sizeof(sin); ++ /* XXX: old FreeBSD didn't fill sockaddr correctly against AF_UNIX */ ++ sin.ss_family = AF_UNIX; ++ /* is this a connection from the local host? */ -+ memset(&sin, 0, len); if (getpeername(fd, (struct sockaddr *) &sin, &len) == 0) { -- if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) { -+ switch (((struct sockaddr *)&sin)->sa_family) { -+ case AF_INET: -+ case AF_INET6: -+ break; -+ default: - return 1; - } - } + if (((struct sockaddr *)&sin)->sa_family == AF_UNIX) { -- cgit