Browse Source

Adding a specific error for 482 "auth. commands issued out of sequence"

Reporting 482 "authentication commands issued out of sequence" as
AUTHENTIFICATION REJECTED tricks clients into thinking that the
supplied credentials are invalid, while it is definitely not the case
(but rather, this is caused by a flaw in the client's logic).

AFAIK there is no adequate error for this in libetpan, hence the
introduction of a new error:
  NEWSNNTP_ERROR_AUTHENTICATION_OUT_OF_SEQUENCE

It is mapped to MAIL_ERROR_BAD_STATE in nntpdriver-tools:
nntpdriver_nntp_error_to_mail_error() --not sure about this, but
included here so that it is not forgotten and it will be eventually
fixed in case the patch is accepted.

Signed-off-by: Sébastien Bigaret <sebastien.bigaret@telecom-bretagne.eu>
dvh-chacham15-master
Sébastien Bigaret 10 years ago
parent
commit
2cb13557ad
3 changed files with 9 additions and 3 deletions
  1. +1
    -0
      src/driver/implementation/nntp/nntpdriver_tools.c
  2. +6
    -2
      src/low-level/nntp/newsnntp.c
  3. +2
    -1
      src/low-level/nntp/newsnntp_types.h

+ 1
- 0
src/driver/implementation/nntp/nntpdriver_tools.c View File

@ -111,6 +111,7 @@ int nntpdriver_nntp_error_to_mail_error(int error)
return MAIL_ERROR_LOGIN;
case NEWSNNTP_ERROR_BAD_STATE:
case NEWSNNTP_ERROR_AUTHENTICATION_OUT_OF_SEQUENCE:
return MAIL_ERROR_BAD_STATE;
case NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_USERNAME:


+ 6
- 2
src/low-level/nntp/newsnntp.c View File

@ -605,9 +605,11 @@ int newsnntp_authinfo_username(newsnntp * f, const char * username)
return NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_USERNAME;
case 481:
case 482:
return NEWSNNTP_ERROR_AUTHENTICATION_REJECTED;
case 482:
return NEWSNNTP_ERROR_AUTHENTICATION_OUT_OF_SEQUENCE;
case 381:
return NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_PASSWORD;
@ -641,9 +643,11 @@ int newsnntp_authinfo_password(newsnntp * f, const char * password)
return NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_USERNAME;
case 481:
case 482:
return NEWSNNTP_ERROR_AUTHENTICATION_REJECTED;
case 482:
return NEWSNNTP_ERROR_AUTHENTICATION_OUT_OF_SEQUENCE;
case 381:
return NEWSNNTP_WARNING_REQUEST_AUTHORIZATION_PASSWORD;


+ 2
- 1
src/low-level/nntp/newsnntp_types.h View File

@ -70,7 +70,8 @@ enum {
NEWSNNTP_ERROR_MEMORY,
NEWSNNTP_ERROR_AUTHENTICATION_REJECTED,
NEWSNNTP_ERROR_BAD_STATE,
NEWSNNTP_ERROR_SSL
NEWSNNTP_ERROR_SSL,
NEWSNNTP_ERROR_AUTHENTICATION_OUT_OF_SEQUENCE,
};
struct newsnntp


Loading…
Cancel
Save