[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.99.55 caused DoS attack
On Fri, 2003-04-11 at 22:21, Roy Bixler wrote:
> My day today has been rather "interesting" so far. Campus networking
> twice had to disable the network port for our Z-Mailer 2.99.55 mail
> server due to DoS attack on their name servers.
The function that creates bounce report uses dns to find *local* host
name. If you have several entries in the "search" line, it issues as
many DNS requests. This is the fix that I use here:
Index: libc/myhostname.c
===================================================================
RCS file: /cvsroot/zmailer/libc/myhostname.c,v
retrieving revision 1.6
diff -u -r1.6 myhostname.c
--- libc/myhostname.c 2000/11/16 16:58:41 1.6
+++ libc/myhostname.c 2002/11/27 14:57:31
@@ -23,8 +23,8 @@
#endif
#include "libc.h"
-int
-getmyhostname(namebuf, len)
+static int
+_getmyhostname(namebuf, len)
char *namebuf;
int len;
{
@@ -130,4 +130,25 @@
#endif
return 0;
#endif
+}
+
+int
+getmyhostname(namebuf, len)
+ char *namebuf;
+ int len;
+{
+ int rc;
+ static char *savedname=NULL;
+
+ if (savedname) {
+ strncpy(namebuf, savedname, len);
+ namebuf[len - 1] = 0;
+ return 0;
+ }
+ rc = _getmyhostname(namebuf, len);
+ if (rc == 0) {
+ savedname=(char*)malloc(strlen(namebuf)+1);
+ strcpy(savedname, namebuf);
+ }
+ return rc;
}
--
Eugene Crosser, head of Internet Applications section, +7 501 787 1000
ROL, Teleross, Golden Telecom, http://user.rol.ru/~crosser/
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi