Various minor portability fixes.
authormdw <mdw>
Tue, 27 Jul 1999 18:30:53 +0000 (18:30 +0000)
committermdw <mdw>
Tue, 27 Jul 1999 18:30:53 +0000 (18:30 +0000)
acl.c
acl.h
addr.h
chan.c
configure.in
identify.c
identify.h
inet.c
socket.c
un.c

diff --git a/acl.c b/acl.c
index a7e448e..059ec9c 100644 (file)
--- a/acl.c
+++ b/acl.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: acl.c,v 1.2 1999/07/26 23:28:15 mdw Exp $
+ * $Id: acl.c,v 1.3 1999/07/27 18:30:53 mdw Exp $
  *
  * Access control list handling
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: acl.c,v $
+ * Revision 1.3  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.2  1999/07/26 23:28:15  mdw
  * Minor modifications for new design.
  *
@@ -46,6 +49,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/acl.h b/acl.h
index 45b8a40..21f398d 100644 (file)
--- a/acl.h
+++ b/acl.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: acl.h,v 1.2 1999/07/26 23:28:16 mdw Exp $
+ * $Id: acl.h,v 1.3 1999/07/27 18:30:53 mdw Exp $
  *
  * Access control list handling
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: acl.h,v $
+ * Revision 1.3  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.2  1999/07/26 23:28:16  mdw
  * Minor modifications for new design.
  *
@@ -48,6 +51,7 @@
 
 #include <stdio.h>
 
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 
diff --git a/addr.h b/addr.h
index 411d0a7..cc5b790 100644 (file)
--- a/addr.h
+++ b/addr.h
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: addr.h,v 1.1 1999/07/26 23:34:26 mdw Exp $
+ * $Id: addr.h,v 1.2 1999/07/27 18:30:53 mdw Exp $
  *
  * Generic interface to network address handlers
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: addr.h,v $
+ * Revision 1.2  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.1  1999/07/26 23:34:26  mdw
  * Socket address type management.
  *
@@ -43,6 +46,7 @@
 
 /*----- Header files ------------------------------------------------------*/
 
+#include <sys/types.h>
 #include <sys/socket.h>
 
 #include <mLib/dstr.h>
diff --git a/chan.c b/chan.c
index 855c769..72938da 100644 (file)
--- a/chan.c
+++ b/chan.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: chan.c,v 1.2 1999/07/26 23:27:52 mdw Exp $
+ * $Id: chan.c,v 1.3 1999/07/27 18:30:53 mdw Exp $
  *
  * Channel management
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: chan.c,v $
+ * Revision 1.3  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.2  1999/07/26 23:27:52  mdw
  * Minor modifications for new design.
  *
 #include <unistd.h>
 #include <sys/uio.h>
 
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
 #include <mLib/alloc.h>
 #include <mLib/conn.h>
 #include <mLib/sel.h>
index 7d7f7db..9f399b3 100644 (file)
@@ -1,6 +1,6 @@
 dnl -*-fundamental-*-
 dnl
-dnl $Id: configure.in,v 1.2 1999/07/26 23:35:09 mdw Exp $
+dnl $Id: configure.in,v 1.3 1999/07/27 18:30:53 mdw Exp $
 dnl
 dnl Configuration script for fw
 dnl
@@ -28,6 +28,9 @@ dnl Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 dnl ----- Revision history --------------------------------------------------
 dnl
 dnl $Log: configure.in,v $
+dnl Revision 1.3  1999/07/27 18:30:53  mdw
+dnl Various minor portability fixes.
+dnl
 dnl Revision 1.2  1999/07/26 23:35:09  mdw
 dnl Relatively minor changes to support new functionality.
 dnl
@@ -49,6 +52,9 @@ AC_TYPE_PID_T
 
 mdw_DECL_ENVIRON
 
+mdw_CHECK_MANYLIBS(socket, socket)
+mdw_CHECK_MANYLIBS(gethostbyname, nsl resolv)
+
 AC_CHECK_FUNCS(inet_aton)
 AC_CHECK_FUNCS(setrlimit)
 AC_CHECK_FUNCS(setgroups)
index 50f7ae2..8f0bf4c 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: identify.c,v 1.3 1999/07/26 23:26:21 mdw Exp $
+ * $Id: identify.c,v 1.4 1999/07/27 18:30:53 mdw Exp $
  *
  * Identifies and logs the client of a connection
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: identify.c,v $
+ * Revision 1.4  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.3  1999/07/26 23:26:21  mdw
  * Minor modifications for new design.
  *
@@ -268,6 +271,7 @@ void identify(const id_req *q)
     if ((fd = socket(PF_INET, SOCK_STREAM, 0)) < 0)
       id_conn(-1, i);
     else {
+      memset(&sin, 0, sizeof(sin));
       sin.sin_family = AF_INET;
       sin.sin_addr = q->lsin.sin_addr;
       sin.sin_port = 0;
index b7fe1bc..69acb61 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: identify.h,v 1.2 1999/07/26 23:26:21 mdw Exp $
+ * $Id: identify.h,v 1.3 1999/07/27 18:30:53 mdw Exp $
  *
  * Identifies and logs the client of a connection
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: identify.h,v $
+ * Revision 1.3  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.2  1999/07/26 23:26:21  mdw
  * Minor modifications for new design.
  *
@@ -46,6 +49,7 @@
 
 /*----- Header files ------------------------------------------------------*/
 
+#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 
diff --git a/inet.c b/inet.c
index 9980199..7aa8e30 100644 (file)
--- a/inet.c
+++ b/inet.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: inet.c,v 1.1 1999/07/26 23:34:11 mdw Exp $
+ * $Id: inet.c,v 1.2 1999/07/27 18:30:53 mdw Exp $
  *
  * Protocol specific definitions for IPv4 sockets
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: inet.c,v $
+ * Revision 1.2  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.1  1999/07/26 23:34:11  mdw
  * New socket address types.
  *
@@ -88,6 +91,7 @@ static addr *inet_read(scanner *sc, unsigned type)
 
   ia->a.ops = &inet_ops;
   ia->a.sz = sizeof(struct sockaddr_in);
+  memset(&ia->sin, 0, sizeof(ia->sin));
   ia->sin.sin_family = AF_INET;
 
   /* --- Read the host address part --- */
index 941bcd5..6df5c4d 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: socket.c,v 1.1 1999/07/26 23:33:32 mdw Exp $
+ * $Id: socket.c,v 1.2 1999/07/27 18:30:53 mdw Exp $
  *
  * Socket source and target definitions
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: socket.c,v $
+ * Revision 1.2  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.1  1999/07/26 23:33:32  mdw
  * New sources and targets.
  *
@@ -44,6 +47,9 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <sys/types.h>
+#include <unistd.h>
+
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
diff --git a/un.c b/un.c
index c0a2cc9..6b3c71f 100644 (file)
--- a/un.c
+++ b/un.c
@@ -1,6 +1,6 @@
 /* -*-c-*-
  *
- * $Id: un.c,v 1.1 1999/07/26 23:34:11 mdw Exp $
+ * $Id: un.c,v 1.2 1999/07/27 18:30:53 mdw Exp $
  *
  * Protocol specific definitions for Unix-domain sockets
  *
@@ -29,6 +29,9 @@
 /*----- Revision history --------------------------------------------------* 
  *
  * $Log: un.c,v $
+ * Revision 1.2  1999/07/27 18:30:53  mdw
+ * Various minor portability fixes.
+ *
  * Revision 1.1  1999/07/26 23:34:11  mdw
  * New socket address types.
  *
@@ -37,6 +40,7 @@
 /*----- Header files ------------------------------------------------------*/
 
 #include "config.h"
+#undef sun /* Cretins */
 
 #include <ctype.h>
 #include <errno.h>
@@ -94,6 +98,7 @@ static addr *un_read(scanner *sc, unsigned type)
               d.len + 1);
   ua->a.ops = &un_ops;
   ua->a.sz = offsetof(struct sockaddr_un, sun_path) + d.len + 1;
+  memset(&ua->sun, 0, ua->a.sz);
   ua->sun.sun_family = AF_UNIX;
   memcpy(ua->sun.sun_path, d.buf, d.len + 1);
   dstr_destroy(&d);