Adam Warner <[EMAIL PROTECTED]> writes:

> Hi all,
>
> I'm now using Raymond Toy's 2004-12-02 snapshot (thanks!)
>
> Good security practice requires that when you create a socket server for
> use solely by the local computer you should never bind to all network
> interfaces.

If the server really never wants to talk to the network, you might
want to consider using unix domain sockets.

> The listener can be supplied with a host keyword. This doesn't appear to
> work for localhost or 127.0.0.1:
>
> (ext:create-inet-listener 9991 :stream :host "localhost")
>
> Error in function CREATE-INET-LISTENER:
>    Error binding socket to port 9991: Cannot assign requested address
>    [Condition of type SIMPLE-ERROR]
>

It looks like there's a buglet in create-inet-listener.  Someone
forgot the htonl for addr.  Here's a patch:

--- internet.lisp~      2004-07-25 15:32:38.000000000 -0400
+++ internet.lisp       2004-12-11 20:57:13.000000000 -0500
@@ -468,7 +468,7 @@
     (with-alien ((sockaddr inet-sockaddr))
       (setf (slot sockaddr 'family) af-inet)
       (setf (slot sockaddr 'port) (htons port))
-      (setf (slot sockaddr 'addr) addr)
+      (setf (slot sockaddr 'addr) (htonl addr))
       (when (minusp (unix:unix-bind socket
                                    (alien-sap sockaddr)
                                    (alien-size inet-sockaddr :bytes)))


Todd

-- 
Todd Sabin                                          <[EMAIL PROTECTED]>


Reply via email to