authinfo patch for innfeed

Kenichi Okada okada at opaopa.org
Tue Aug 20 17:57:23 UTC 2002



Hi, 

This patch provides an authentication (authinfo) for innfeed.
It is useful for a feed to nnrpd.

example configuration:

peer tetoron-test {
        ip-name: newsfeed.media.kyoto-u.ac.jp
        max-connections: 3
        username: "hoge"
        password: "hoge"
}

-- 
Kenichi Okada
mailto:okada at opaopa.org

diff -c inn-CURRENT-20020820-orig/innfeed/connection.c inn-CURRENT-20020820/innfeed/connection.c
*** inn-CURRENT-20020820-orig/innfeed/connection.c	2002-04-01 03:47:05.000000000 +0900
--- inn-CURRENT-20020820/innfeed/connection.c	2002-08-21 02:42:14.000000000 +0900
***************
*** 209,214 ****
--- 209,215 ----
      bool loggedNoCr ;           /* true if we logged the NOCR_MSG */
      bool immedRecon ;           /* true if we recon immediately after flushing. */
      bool doesStreaming ;        /* true if remote will handle streaming */
+     bool authenticated ;        /* true if remote authenticated */
      bool quitWasIssued ;          /* true if QUIT command was sent. */
      bool needsChecks ;          /* true if we issue CHECK commands in
                                     streaming mode (rather than just sending
***************
*** 264,275 ****
--- 265,280 ----
  /* I/O Callbacks */
  static void connectionDone (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void getBanner (EndPoint e, IoStatus i, Buffer *b, void *d) ;
+ static void getAuthUserResponse (EndPoint e, IoStatus i, Buffer *b, void *d) ;
+ static void getAuthPassResponse (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void getModeResponse (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void responseIsRead (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void quitWritten (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void ihaveBodyDone (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void commandWriteDone (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void modeCmdIssued (EndPoint e, IoStatus i, Buffer *b, void *d) ;
+ static void authUserIssued (EndPoint e, IoStatus i, Buffer *b, void *d) ;
+ static void authPassIssued (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  static void writeProgress (EndPoint e, IoStatus i, Buffer *b, void *d) ;
  
  
***************
*** 329,334 ****
--- 334,343 ----
  static void validateConnection (Connection cxn) ;
  static const char *stateToString (CxnState state) ;
  
+ static void issueModeStream (EndPoint e, Connection cxn) ;
+ static void issueAuthUser (EndPoint e, Connection cxn) ;
+ static void issueAuthPass (EndPoint e, Connection cxn) ;
+ 
  static void prepareReopenCbk (Connection cxn) ;
  
  
***************
*** 1209,1214 ****
--- 1218,1225 ----
    fprintf (fp,"%s    max-checks : %d\n",indent,cxn->maxCheck) ;
    fprintf (fp,"%s    does-streaming : %s\n",indent,
             boolToString (cxn->doesStreaming)) ;
+   fprintf (fp,"%s    authenticated : %s\n",indent,
+            boolToString (cxn->authenticated)) ;
    fprintf (fp,"%s    quitWasIssued : %s\n",indent,
             boolToString (cxn->quitWasIssued)) ;
    fprintf (fp,"%s    needs-checks : %s\n",indent,
***************
*** 1400,1406 ****
   */
  static void getBanner (EndPoint e, IoStatus i, Buffer *b, void *d)
  {
!   Buffer *modeCmdBuffers, *readBuffers ;
    Connection cxn = (Connection) d ;
    char *p = bufferBase (b[0]) ;
    int code ;
--- 1411,1417 ----
   */
  static void getBanner (EndPoint e, IoStatus i, Buffer *b, void *d)
  {
!   Buffer *readBuffers ;
    Connection cxn = (Connection) d ;
    char *p = bufferBase (b[0]) ;
    int code ;
***************
*** 1482,1526 ****
          }
  
        if ( isOk )
!         {
!           Buffer modeBuffer ;
  
  #define  MODE_CMD "MODE STREAM\r\n"
  
!           modeBuffer = newBuffer (strlen (MODE_CMD) + 1) ;
!           p = bufferBase (modeBuffer) ;
  
!           /* now issue the MODE STREAM command */
!           d_printf (1,"%s:%d Issuing the streaming command: %s\n",
!                    hostPeerName (cxn->myHost),cxn->ident,MODE_CMD) ;
  
!           strcpy (p, MODE_CMD) ;
  
!           bufferSetDataSize (modeBuffer, strlen (p)) ;
  
!           modeCmdBuffers = makeBufferArray (modeBuffer, NULL) ;
  
!           if ( !prepareWriteWithTimeout (e, modeCmdBuffers, modeCmdIssued,
!                                          cxn) )
!             {
!               syslog (LOG_ERR, PREPARE_WRITE_FAILED, peerName, cxn->ident) ;
!               die ("Prepare write for mode stream failed") ;
!             }
  
!           bufferSetDataSize (cxn->respBuffer, 0) ;
  
!           readBuffers = makeBufferArray (bufferTakeRef(cxn->respBuffer),NULL);
  
!           if ( !prepareRead (e, readBuffers, getModeResponse, cxn, 1) )
!             {
!               syslog (LOG_ERR, PREPARE_READ_FAILED, peerName, cxn->ident) ;
!               freeBufferArray (readBuffers) ;
!               cxnSleepOrDie (cxn) ;
!             }
!         }
      }
  
!   freeBufferArray (b) ;
  }
  
  
--- 1493,1815 ----
          }
  
        if ( isOk )
! 	{
! 	  if (hostUsername (cxn->myHost) != NULL
! 	      && hostPassword (cxn->myHost) != NULL)
! 	    issueAuthUser (e,cxn);
! 	  else
! 	    issueModeStream (e,cxn);
! 	}
!     }
!   freeBufferArray (b) ;
! }
! 
! 
! 
! 
! 
! static void issueAuthUser (EndPoint e, Connection cxn)
! {
!   Buffer authUserBuffer;
!   Buffer *authUserCmdBuffers,*readBuffers;
!   size_t lenBuff = 0 ;
!   char *t ;
! 
!   /* 17 == strlen("AUTHINFO USER \r\n\0") */
!   lenBuff = (17 + strlen (hostUsername (cxn->myHost))) ;
!   authUserBuffer = newBuffer (lenBuff) ;
!   t = bufferBase (authUserBuffer) ;
! 
!   sprintf (t, "AUTHINFO USER %s\r\n", hostUsername (cxn->myHost)) ;
!   bufferSetDataSize (authUserBuffer, strlen (t)) ;
! 
!   authUserCmdBuffers = makeBufferArray (authUserBuffer, NULL) ;
! 
!   if ( !prepareWriteWithTimeout (e, authUserCmdBuffers, authUserIssued,
! 				 cxn) )
!     {
!       syslog (LOG_ERR, PREPARE_WRITE_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       die ("Prepare write for authinfo user failed") ;
!     }
! 
!   bufferSetDataSize (cxn->respBuffer, 0) ;
! 
!   readBuffers = makeBufferArray (bufferTakeRef(cxn->respBuffer),NULL);
! 
!   if ( !prepareRead (e, readBuffers, getAuthUserResponse, cxn, 1) )
!     {
!       syslog (LOG_ERR, PREPARE_READ_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       freeBufferArray (readBuffers) ;
!       cxnSleepOrDie (cxn) ;
!     }
! 
! }
! 
! 
! 
! 
! 
! 
! static void issueAuthPass (EndPoint e, Connection cxn)
! {
!   Buffer authPassBuffer;
!   Buffer *authPassCmdBuffers,*readBuffers;
!   size_t lenBuff = 0 ;
!   char *t ;
! 
!   /* 17 == strlen("AUTHINFO PASS \r\n\0") */
!   lenBuff = (17 + strlen (hostPassword (cxn->myHost))) ;
!   authPassBuffer = newBuffer (lenBuff) ;
!   t = bufferBase (authPassBuffer) ;
! 
!   sprintf (t, "AUTHINFO PASS %s\r\n", hostPassword (cxn->myHost)) ;
!   bufferSetDataSize (authPassBuffer, strlen (t)) ;
! 
!   authPassCmdBuffers = makeBufferArray (authPassBuffer, NULL) ;
! 
!   if ( !prepareWriteWithTimeout (e, authPassCmdBuffers, authPassIssued,
! 				 cxn) )
!     {
!       syslog (LOG_ERR, PREPARE_WRITE_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       die ("Prepare write for authinfo pass failed") ;
!     }
! 
!   bufferSetDataSize (cxn->respBuffer, 0) ;
! 
!   readBuffers = makeBufferArray (bufferTakeRef(cxn->respBuffer),NULL);
! 
!   if ( !prepareRead (e, readBuffers, getAuthPassResponse, cxn, 1) )
!     {
!       syslog (LOG_ERR, PREPARE_READ_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       freeBufferArray (readBuffers) ;
!       cxnSleepOrDie (cxn) ;
!     }
! 
! }
! 
! 
! 
! 
! 
! 
! static void issueModeStream (EndPoint e, Connection cxn)
! {
!   Buffer *modeCmdBuffers,*readBuffers ;
!   Buffer modeBuffer ;
!   char *p;
  
  #define  MODE_CMD "MODE STREAM\r\n"
  
!   modeBuffer = newBuffer (strlen (MODE_CMD) + 1) ;
!   p = bufferBase (modeBuffer) ;
  
!   /* now issue the MODE STREAM command */
!   d_printf (1,"%s:%d Issuing the streaming command: %s\n",
! 	    hostPeerName (cxn->myHost),cxn->ident,MODE_CMD) ;
  
!   strcpy (p, MODE_CMD) ;
  
!   bufferSetDataSize (modeBuffer, strlen (p)) ;
  
!   modeCmdBuffers = makeBufferArray (modeBuffer, NULL) ;
  
!   if ( !prepareWriteWithTimeout (e, modeCmdBuffers, modeCmdIssued,
! 				 cxn) )
!     {
!       syslog (LOG_ERR, PREPARE_WRITE_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       die ("Prepare write for mode stream failed") ;
!     }
  
!   bufferSetDataSize (cxn->respBuffer, 0) ;
  
!   readBuffers = makeBufferArray (bufferTakeRef(cxn->respBuffer),NULL);
  
!   if ( !prepareRead (e, readBuffers, getModeResponse, cxn, 1) )
!     {
!       syslog (LOG_ERR, PREPARE_READ_FAILED,
! 	      hostPeerName (cxn->myHost), cxn->ident) ;
!       freeBufferArray (readBuffers) ;
!       cxnSleepOrDie (cxn) ;
      }
+ }
  
! 
! 
! 
! 
! /*
!  *
!  */
! static void getAuthUserResponse (EndPoint e, IoStatus i, Buffer *b, void *d)
! {
!   Connection cxn = (Connection) d ;
!   int code ;
!   char *p = bufferBase (b[0]) ;
!   Buffer *buffers ;
!   const char *peerName ;
! 
!   ASSERT (e == cxn->myEp) ;
!   ASSERT (b [0] == cxn->respBuffer) ;
!   ASSERT (b [1] == NULL) ;      /* only ever one buffer on this read */
!   ASSERT (cxn->state == cxnConnectingS) ;
!   VALIDATE_CONNECTION (cxn) ;
! 
!   peerName = hostPeerName (cxn->myHost) ;
! 
!   bufferAddNullByte (b[0]) ;
! 
!   d_printf (1,"%s:%d Processing authinfo user response: %s", /* no NL */
! 	    hostPeerName (cxn->myHost), cxn->ident, p) ;
! 
!   if (i == IoDone && writeIsPending (cxn->myEp))
!     {
!       /* badness. should never happen */
!       syslog (LOG_ERR, AUTHINFO_WRITE_PENDING, peerName, cxn->ident) ;
! 
!       cxnSleepOrDie (cxn) ;
!     }
!   else if (i != IoDone)
!     {
!       if (i != IoEOF)
! 	{
! 	  errno = endPointErrno (e) ;
! 	  syslog (LOG_ERR, RESPONSE_READ_FAILED, peerName, cxn->ident) ;
! 	}
!       cxnSleepOrDie (cxn) ;
!     }
!   else if (strchr (p, '\n') == NULL)
!     {
!       /* partial read */
!       expandBuffer (b [0], BUFFER_EXPAND_AMOUNT) ;
! 
!       buffers = makeBufferArray (bufferTakeRef (b [0]), NULL) ;
!       if ( !prepareRead (e, buffers, getAuthUserResponse, cxn, 1) )
! 	{
! 	  syslog (LOG_ERR, PREPARE_READ_FAILED, peerName, cxn->ident) ;
! 	  freeBufferArray (buffers) ;
! 	  cxnSleepOrDie (cxn) ;
! 	}
!     }
!   else
!     {
!       clearTimer (cxn->readBlockedTimerId) ;
! 
!       if ( !getNntpResponse (p, &code, NULL) )
! 	{
! 	  syslog (LOG_ERR, BAD_AUTH_USER_RESPONSE, peerName, cxn->ident, p) ;
! 
! 	  cxnSleepOrDie (cxn) ;
! 	}
!       else
! 	{
! 	  syslog (LOG_NOTICE,CONNECTED,peerName, cxn->ident) ;
! 
! 	  switch (code)
! 	    {
! 	    case 381:
! 	      issueAuthPass (e,cxn);
! 	      break ;
! 
! 	    default:
! 	      syslog (LOG_ERR, BAD_AUTH_USER_RESPONSE, peerName, cxn->ident, p) ;
! 	      cxnSleepOrDie (cxn) ;
! 	      break ;
! 	    }
! 
! 	}
!     }
! }
! 
! 
! 
! 
! 
! /*
!  *
!  */
! static void getAuthPassResponse (EndPoint e, IoStatus i, Buffer *b, void *d)
! {
!   Connection cxn = (Connection) d ;
!   int code ;
!   char *p = bufferBase (b[0]) ;
!   Buffer *buffers ;
!   const char *peerName ;
! 
!   ASSERT (e == cxn->myEp) ;
!   ASSERT (b [0] == cxn->respBuffer) ;
!   ASSERT (b [1] == NULL) ;      /* only ever one buffer on this read */
!   ASSERT (cxn->state == cxnConnectingS) ;
!   VALIDATE_CONNECTION (cxn) ;
! 
!   peerName = hostPeerName (cxn->myHost) ;
! 
!   bufferAddNullByte (b[0]) ;
! 
!   d_printf (1,"%s:%d Processing authinfo pass response: %s", /* no NL */
! 	    hostPeerName (cxn->myHost), cxn->ident, p) ;
! 
!   if (i == IoDone && writeIsPending (cxn->myEp))
!     {
!       /* badness. should never happen */
!       syslog (LOG_ERR, AUTHINFO_WRITE_PENDING, peerName, cxn->ident) ;
! 
!       cxnSleepOrDie (cxn) ;
!     }
!   else if (i != IoDone)
!     {
!       if (i != IoEOF)
! 	{
! 	  errno = endPointErrno (e) ;
! 	  syslog (LOG_ERR, RESPONSE_READ_FAILED, peerName, cxn->ident) ;
! 	}
!       cxnSleepOrDie (cxn) ;
!     }
!   else if (strchr (p, '\n') == NULL)
!     {
!       /* partial read */
!       expandBuffer (b [0], BUFFER_EXPAND_AMOUNT) ;
! 
!       buffers = makeBufferArray (bufferTakeRef (b [0]), NULL) ;
!       if ( !prepareRead (e, buffers, getAuthPassResponse, cxn, 1) )
! 	{
! 	  syslog (LOG_ERR, PREPARE_READ_FAILED, peerName, cxn->ident) ;
! 	  freeBufferArray (buffers) ;
! 	  cxnSleepOrDie (cxn) ;
! 	}
!     }
!   else
!     {
!       clearTimer (cxn->readBlockedTimerId) ;
! 
!       if ( !getNntpResponse (p, &code, NULL) )
! 	{
! 	  syslog (LOG_ERR, BAD_AUTH_PASS_RESPONSE, peerName, cxn->ident, p) ;
! 
! 	  cxnSleepOrDie (cxn) ;
! 	}
!       else
! 	{
! 	  switch (code)
! 	    {
! 	    case 281:
! 	      syslog (LOG_NOTICE,AUTHENTICATED,peerName, cxn->ident) ;
! 	      cxn->authenticated = true ;
! 	      issueModeStream (e,cxn);
! 	      break ;
! 
! 	    default:
! 	      syslog (LOG_ERR, BAD_AUTH_PASS_RESPONSE, peerName, cxn->ident, p) ;
! 	      cxnSleepOrDie (cxn) ;
! 	      break ;
! 	    }
! 
! 	}
!     }
  }
  
  
***************
*** 1593,1599 ****
          }
        else
          {
!           syslog (LOG_NOTICE,CONNECTED,peerName, cxn->ident) ;
            
            switch (code)
              {
--- 1882,1889 ----
          }
        else
          {
! 	  if (!cxn->authenticated)
! 	    syslog (LOG_NOTICE,CONNECTED,peerName, cxn->ident) ;
            
            switch (code)
              {
***************
*** 1622,1631 ****
              cxnIdle (cxn) ;
            else
              cxn->state = cxnFeedingS ;
- 
            
                /* one for the connection and one for the buffer array */
!           ASSERT (bufferRefCount (cxn->respBuffer) == 2) ;
            
            /* there was only one line in there, right? */
            bufferSetDataSize (cxn->respBuffer, 0) ;
--- 1912,1920 ----
              cxnIdle (cxn) ;
            else
              cxn->state = cxnFeedingS ;
            
                /* one for the connection and one for the buffer array */
!           ASSERT (cxn->authenticated || bufferRefCount (cxn->respBuffer) == 2) ;
            
            /* there was only one line in there, right? */
            bufferSetDataSize (cxn->respBuffer, 0) ;
***************
*** 2155,2160 ****
--- 2444,2515 ----
  
  
  /*
+  * Called when the AUTHINFO USER command has been written down the pipe.
+  */
+ static void authUserIssued (EndPoint e, IoStatus i, Buffer *b, void *d)
+ {
+   Connection cxn = (Connection) d ;
+ 
+   ASSERT (e == cxn->myEp) ;
+ 
+   clearTimer (cxn->writeBlockedTimerId) ;
+ 
+   /* The authinfo user command has been sent, so start the response timer */
+   initReadBlockedTimeout (cxn) ;
+ 
+   if (i != IoDone)
+     {
+       d_printf (1,"%s:%d AUTHINFO USER command failed to write\n",
+                hostPeerName (cxn->myHost), cxn->ident) ;
+ 
+       syslog (LOG_ERR,AUTHINFO_USER_FAILED,hostPeerName (cxn->myHost),
+               cxn->ident) ;
+ 
+       cxnSleepOrDie (cxn) ;
+     }
+ 
+   freeBufferArray (b) ;
+ }
+ 
+ 
+ 
+ 
+ 
+ 
+ /*
+  * Called when the AUTHINFO USER command has been written down the pipe.
+  */
+ static void authPassIssued (EndPoint e, IoStatus i, Buffer *b, void *d)
+ {
+   Connection cxn = (Connection) d ;
+ 
+   ASSERT (e == cxn->myEp) ;
+ 
+   clearTimer (cxn->writeBlockedTimerId) ;
+ 
+   /* The authinfo pass command has been sent, so start the response timer */
+   initReadBlockedTimeout (cxn) ;
+ 
+   if (i != IoDone)
+     {
+       d_printf (1,"%s:%d AUTHINFO PASS command failed to write\n",
+                hostPeerName (cxn->myHost), cxn->ident) ;
+ 
+       syslog (LOG_ERR,AUTHINFO_PASS_FAILED,hostPeerName (cxn->myHost),
+               cxn->ident) ;
+ 
+       cxnSleepOrDie (cxn) ;
+     }
+ 
+   freeBufferArray (b) ;
+ }
+ 
+ 
+ 
+ 
+ 
+ 
+ /*
   * Called whenever some amount of data has been written to the pipe but
   * more data remains to be written
   */
***************
*** 3406,3411 ****
--- 3761,3767 ----
    cxn->maxCheck = 1 ;
    cxn->immedRecon = false ;
    cxn->doesStreaming = false ;  /* who knows, next time around maybe... */
+   cxn->authenticated = false ;
    cxn->quitWasIssued = false ;
    cxn->needsChecks = true ;
    cxn->timeCon = 0 ;
diff -c inn-CURRENT-20020820-orig/innfeed/host.c inn-CURRENT-20020820/innfeed/host.c
*** inn-CURRENT-20020820-orig/innfeed/host.c	2002-08-12 07:21:02.000000000 +0900
--- inn-CURRENT-20020820/innfeed/host.c	2002-08-21 01:54:38.000000000 +0900
***************
*** 132,137 ****
--- 132,139 ----
    double dynBacklogFilter ;
    double dynBacklogLowWaterMark ;
    double dynBacklogHighWaterMark ;
+   char *username;
+   char *password;
  } *HostParams ;
  
  struct host_s 
***************
*** 531,536 ****
--- 533,540 ----
        params->dynBacklogFilter = BACKLOGFILTER ;
        params->dynBacklogLowWaterMark = BACKLOGLWM;
        params->dynBacklogHighWaterMark = BACKLOGHWM;
+       params->username=NULL;
+       params->password=NULL;
      }
    return (params);
  }
***************
*** 2428,2433 ****
--- 2432,2453 ----
    return host->params->peerName ;
  }
  
+ /*
+  * get the username and password for authentication
+  */
+ const char *hostUsername (Host host)
+ {
+   ASSERT (host != NULL) ;
+ 
+   return host->params->username ;
+ }
+ const char *hostPassword (Host host)
+ {
+   ASSERT (host != NULL) ;
+ 
+   return host->params->password ;
+ }
+ 
  
  /* return true if the Connections for this host should attempt to do
     streaming. */
***************
*** 2583,2588 ****
--- 2603,2619 ----
  	  else
  	    p->ipName = xstrdup (name) ;
          }
+ 
+       if (getString (s,"username",&q,NO_INHERIT))
+ 	p->username = q;
+       if (getString (s,"password",&q,NO_INHERIT))
+ 	p->password = q;
+ 
+       if (p->username != NULL && p->password == NULL)
+ 	logOrPrint (LOG_ERR,fp,"cannot find password for %s",p->peerName);
+       if (p->username == NULL && p->password != NULL)
+ 	logOrPrint (LOG_ERR,fp,"cannot find username for %s",p->peerName);
+ 
      }
  
  
diff -c inn-CURRENT-20020820-orig/innfeed/host.h inn-CURRENT-20020820/innfeed/host.h
*** inn-CURRENT-20020820-orig/innfeed/host.h	2002-03-13 09:02:19.000000000 +0900
--- inn-CURRENT-20020820/innfeed/host.h	2002-08-21 00:37:17.000000000 +0900
***************
*** 175,180 ****
--- 175,184 ----
  /* get the name that INN uses for this host */
  const char *hostPeerName (Host host) ;
  
+ /* get the username and password for authentication */
+ const char *hostUsername (Host host) ;
+ const char *hostPassword (Host host) ;
+ 
  /* if VAL is true then each time the host logs its stats all its
     connections will too. */
  void hostLogConnectionStats (bool val) ;
diff -c inn-CURRENT-20020820-orig/innfeed/msgs.h inn-CURRENT-20020820/innfeed/msgs.h
*** inn-CURRENT-20020820-orig/innfeed/msgs.h	2002-08-03 06:20:55.000000000 +0900
--- inn-CURRENT-20020820/innfeed/msgs.h	2002-08-21 02:26:34.000000000 +0900
***************
*** 38,43 ****
--- 38,44 ----
  
  #define CONNECT_ERROR           "%s:%d connect : %m"
  #define CONNECTED               "%s:%d connected"
+ #define AUTHENTICATED           "%s:%d authenticated"
  #define CXN_CLOSED              "%s:%d closed"
  #define CXN_PERIODIC_CLOSE      "%s:%d periodic close"
  #define CXN_REOPEN_FAILED	"%s:%d flush re-connect failed"
***************
*** 46,57 ****
--- 47,61 ----
  #define FCNTL_ERROR             "%s:%d cxnsleep can't set socket non-blocking: %m"
  #define IHAVE_WRITE_FAILED      "%s:%d cxnsleep can't write IHAVE body : %m"
  #define MODE_STREAM_FAILED	"%s:%d cxnsleep can't write MODE STREAM : %m"
+ #define AUTHINFO_USER_FAILED	"%s:%d cxnsleep can't write AUTHINFO USER : %m"
+ #define AUTHINFO_PASS_FAILED	"%s:%d cxnsleep can't write AUTHINFO PASS : %m"
  #define QUIT_WRITE_FAILED       "%s:%d cxnsleep can't write QUIT : %m"
  #define COMMAND_WRITE_FAILED    "%s:%d cxnsleep can't write command : %m"
  #define RESPONSE_READ_FAILED    "%s:%d cxnsleep can't read response : %m"
  #define BANNER_READ_FAILED      "%s:%d cxnsleep can't read banner : %m"
  #define SOCKET_CREATE_ERROR     "%s:%d cxnsleep can't create socket : %m"
  #define MODE_WRITE_PENDING	"%s:%d cxnsleep mode stream command still pending"
+ #define AUTHINFO_WRITE_PENDING	"%s:%d cxnsleep authinfo command still pending"
  #define NOMSGID                 "%s:%d cxnsleep message-id missing in reponse code %d: %s"
  #define INVALID_MSGID           "%s:%d cxnsleep message-id invalid message-id in reponse code %d : %s"
  #define UNKNOWN_RESPONSE        "%s:%d cxnsleep response unknown : %d : %s"
***************
*** 59,64 ****
--- 63,70 ----
  #define BAD_RESPONSE		"%s:%d cxnsleep response unexpected : %d"
  
  #define BAD_MODE_RESPONSE       "%s:%d cxnsleep response to MODE STREAM : %s"
+ #define BAD_AUTH_USER_RESPONSE  "%s:%d cxnsleep response to AUTHINFO USER : %s"
+ #define BAD_AUTH_PASS_RESPONSE  "%s:%d cxnsleep response to AUTHINFO PASS : %s"
  #define INVALID_RESP_FORMAT     "%s:%d cxnsleep response format : %s"
  #define PREPARE_READ_FAILED     "%s:%d cxnsleep prepare read failed"
  #define RESPONSE_TIMEOUT        "%s:%d cxnsleep non-responsive connection"


More information about the inn-patches mailing list