Browse code

Use gethostbyname_r when available

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@686 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/07/22 18:18:14
Showing 3 changed files
... ...
@@ -1,8 +1,11 @@
1
+Thu Jul 22 10:17:01 BST 2004 (njh)
2
+----------------------------------
3
+  * clamav-milter:	Use gethostbyname_r when available
4
+
1 5
 Wed Jul 21 22:23:58 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * clamav-milter:	Add mutex around gethostbyname
4 8
 
5
-
6 9
 Wed Jul 21 23:18:51 CEST 2004 (tk)
7 10
 ----------------------------------
8 11
   * configure: test for gethostbyname_r
... ...
@@ -437,6 +437,7 @@ Changes
437 437
 0.74d	18/7/04	Added sanity check in clamfi_connect
438 438
 0.74e	21/7/04	Fixed thread unsafe code causing problems with multi-CPU
439 439
 		machines running Solaris
440
+0.74f	22/7/04	Use gethostbyname_r() if available
440 441
 
441 442
 BUG REPORTS
442 443
 
... ...
@@ -26,6 +26,9 @@
26 26
  *
27 27
  * Change History:
28 28
  * $Log: clamav-milter.c,v $
29
+ * Revision 1.107  2004/07/22 09:14:32  nigelhorne
30
+ * Use gethostbyname_r when available
31
+ *
29 32
  * Revision 1.106  2004/07/21 21:23:29  nigelhorne
30 33
  * Mutex gethostbyname result
31 34
  *
... ...
@@ -329,9 +332,9 @@
329 329
  * Revision 1.6  2003/09/28 16:37:23  nigelhorne
330 330
  * Added -f flag use MaxThreads if --max-children not set
331 331
  */
332
-static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.106 2004/07/21 21:23:29 nigelhorne Exp $";
332
+static	char	const	rcsid[] = "$Id: clamav-milter.c,v 1.107 2004/07/22 09:14:32 nigelhorne Exp $";
333 333
 
334
-#define	CM_VERSION	"0.74e"
334
+#define	CM_VERSION	"0.74f"
335 335
 
336 336
 /*#define	CONFDIR	"/usr/local/etc"*/
337 337
 
... ...
@@ -1502,7 +1505,7 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
1502 1502
 	 */
1503 1503
 	if(strncasecmp(port, "inet:", 5) == 0) {
1504 1504
 		const char *hostmail;
1505
-#ifdef	GETHOSTBYNAME_R
1505
+#ifdef	HAVE_GETHOSTBYNAME_R
1506 1506
 		struct hostent *hp, hostent;
1507 1507
 		char buf[BUFSIZ];
1508 1508
 		int ret;
... ...
@@ -1521,7 +1524,7 @@ clamfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
1521 1521
 			hostmail = "unknown";
1522 1522
 		}
1523 1523
 
1524
-#ifdef	GETHOSTBYNAME_R
1524
+#ifdef	HAVE_GETHOSTBYNAME_R
1525 1525
 		if(gethostbyname_r(hostmail, &hostent, buf, sizeof(buf), &hp, &ret) != 0) {
1526 1526
 			if(use_syslog)
1527 1527
 				syslog(LOG_WARNING, "Access Denied: Host Unknown (%s)", hostname);