Thanks to Werner Mohras <[EMAIL PROTECTED]>
who wrote that my qpopper entry in inetd.conf had tcp6
instead of tcp.  This was indeed true.  [tcp6 means that the daemon
in question supports IPV6.]

How do I get the FAQ modified so that other people know to check
this?  I expect others will modify existing inetd.conf files and
replicate my mistake.


The only othere outstanding issue is that len is not checked at
all.  Even if no action is taken as a result I think the truncation
should be logged.

Maybe something like this untested:


----BEGINNING OF PATCH------

--- pop_init.c  2003-03-13 02:06:37.000000000 +0000
+++ pop_init_new.c      2004-01-22 14:24:17.968954000 +0000
@@ -445,6 +445,7 @@
     int                     errflag = 0;
     int                     c;
     int                     len;
+    int                     olen;              /* original value of len */
     extern char         *   optarg;
     int                     options = 0;
     int                     sp = 0;             /*  Socket pointer */
@@ -1057,7 +1058,7 @@
     /*
      * Get the address and socket of the client to whom I am speaking
      */
-    len = sizeof(cs);
+    olen = len = sizeof(cs);
     if ( getpeername ( sp, (struct sockaddr *) &cs, &len ) < 0 ) {
         pop_log ( p, POP_PRIORITY, HERE,
                   "Unable to obtain socket and address of client: %s (%d)",
@@ -1066,6 +1067,14 @@
     }

     /*
+     * Warn if the name has been truncated
+     */
+    if ( len > olen ) {
+        pop_log ( p, POP_PRIORITY, HERE,
+                  "Name of client truncated by getpeername()");
+    }
+
+    /*
      * Save the dotted decimal form of the client's IP address
      * in the POP parameter block
      */


----END OF PATCH------

perhaps?
        Thank you,
        Hugh

Reply via email to