From: Wilfried Goesgens Date: Tue, 24 Apr 2012 09:45:28 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel X-Git-Tag: v8.11~75 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=dba8d7a9fb79dd7a776478781736c2425b19bd17;hp=246e14629b2ced1fd2a66ae1441f76d614f6a902;p=citadel.git Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel --- diff --git a/citadel/context.h b/citadel/context.h index 5e9d998ac..c25780360 100644 --- a/citadel/context.h +++ b/citadel/context.h @@ -129,6 +129,7 @@ struct CitContext { struct cit_ical *CIT_ICAL; /* calendaring data */ struct ma_info *ma; /* multipart/alternative data */ const char *ServiceName; /* readable purpose of this session */ + long tcp_port; void *openid_data; /* Data stored by the OpenID module */ char *ldap_dn; /* DN of user when using AUTHMODE_LDAP */ diff --git a/citadel/modules/smtp/serv_smtpeventclient.c b/citadel/modules/smtp/serv_smtpeventclient.c index 05b06aac4..1698ab747 100644 --- a/citadel/modules/smtp/serv_smtpeventclient.c +++ b/citadel/modules/smtp/serv_smtpeventclient.c @@ -136,7 +136,25 @@ eNextState FinalizeMessageSend_DB4(AsyncIO *IO); ******************************************************************************/ inline void FinalizeMessageSend_1(AsyncIO *IO) { + const char *Status; SmtpOutMsg *Msg = IO->Data; + + if (Msg->MyQEntry->Status == 2) + Status = "Delivery Successfull."; + else if (Msg->MyQEntry->Status == 5) + Status = "Delivery failed permanently; giving up."; + else + Status = "Delivery failed temporarily; will retry later."; + + EVS_syslog(LOG_INFO, + "SMTP: %s Recipient <%s> @ <%s> (%s) Statusmessage: %s\n", + Status, + Msg->user, + Msg->node, + Msg->name, + ChrPtr(Msg->MyQEntry->StatusMessage)); + + Msg->IDestructQueItem = DecreaseQReference(Msg->MyQItem); Msg->nRemain = CountActiveQueueEntries(Msg->MyQItem); diff --git a/citadel/modules/smtp/smtp_clienthandlers.c b/citadel/modules/smtp/smtp_clienthandlers.c index 30f6a6f50..09a1bd881 100644 --- a/citadel/modules/smtp/smtp_clienthandlers.c +++ b/citadel/modules/smtp/smtp_clienthandlers.c @@ -373,7 +373,7 @@ eNextState SMTPC_read_QUIT_reply(SmtpOutMsg *Msg) AsyncIO *IO = &Msg->IO; SMTP_DBG_READ(); - EVS_syslog(LOG_INFO, + EVS_syslog(LOG_DEBUG, "SMTP client[%ld]: delivery to <%s> @ <%s> (%s) succeeded\n", Msg->n, Msg->user, diff --git a/citadel/sysdep.c b/citadel/sysdep.c index 2b83270c0..422370772 100644 --- a/citadel/sysdep.c +++ b/citadel/sysdep.c @@ -1271,6 +1271,7 @@ do_select: force_purge = 0; con = CreateNewContext(); /* Assign our new socket number to it. */ + con->tcp_port = serviceptr->tcp_port; con->client_socket = ssock; con->h_command_function = serviceptr->h_command_function; con->h_async_function = serviceptr->h_async_function; diff --git a/citadel/user_ops.c b/citadel/user_ops.c index 370d00811..7bc53ce36 100644 --- a/citadel/user_ops.c +++ b/citadel/user_ops.c @@ -934,16 +934,17 @@ void start_chkpwd_daemon(void) { int CtdlTryPassword(const char *password, long len) { int code; + CitContext *CCC = CC; - if ((CC->logged_in)) { + if ((CCC->logged_in)) { syslog(LOG_WARNING, "CtdlTryPassword: already logged in\n"); return pass_already_logged_in; } - if (!strcmp(CC->curr_user, NLI)) { + if (!strcmp(CCC->curr_user, NLI)) { syslog(LOG_WARNING, "CtdlTryPassword: no user selected\n"); return pass_no_user; } - if (CtdlGetUser(&CC->user, CC->curr_user)) { + if (CtdlGetUser(&CCC->user, CCC->curr_user)) { syslog(LOG_ERR, "CtdlTryPassword: internal error\n"); return pass_internal_error; } @@ -953,7 +954,7 @@ int CtdlTryPassword(const char *password, long len) } code = (-1); - if (CC->is_master) { + if (CCC->is_master) { code = strcmp(password, config.c_master_pass); } @@ -961,7 +962,7 @@ int CtdlTryPassword(const char *password, long len) /* host auth mode */ - if (validpw(CC->user.uid, password)) { + if (validpw(CCC->user.uid, password)) { code = 0; /* @@ -972,9 +973,9 @@ int CtdlTryPassword(const char *password, long len) * this is a security hazard, comment it out. */ - CtdlGetUserLock(&CC->user, CC->curr_user); - safestrncpy(CC->user.password, password, sizeof CC->user.password); - CtdlPutUserLock(&CC->user); + CtdlGetUserLock(&CCC->user, CCC->curr_user); + safestrncpy(CCC->user.password, password, sizeof CCC->user.password); + CtdlPutUserLock(&CCC->user); /* * (sooper-seekrit hack ends here) @@ -991,7 +992,7 @@ int CtdlTryPassword(const char *password, long len) /* LDAP auth mode */ - if ((CC->ldap_dn) && (!CtdlTryPasswordLDAP(CC->ldap_dn, password))) { + if ((CCC->ldap_dn) && (!CtdlTryPasswordLDAP(CCC->ldap_dn, password))) { code = 0; } else { @@ -1008,11 +1009,11 @@ int CtdlTryPassword(const char *password, long len) pw = (char*) malloc(len + 1); memcpy(pw, password, len + 1); strproc(pw); - strproc(CC->user.password); - code = strcasecmp(CC->user.password, pw); + strproc(CCC->user.password); + code = strcasecmp(CCC->user.password, pw); strproc(pw); - strproc(CC->user.password); - code = strcasecmp(CC->user.password, pw); + strproc(CCC->user.password); + code = strcasecmp(CCC->user.password, pw); free (pw); } @@ -1020,7 +1021,16 @@ int CtdlTryPassword(const char *password, long len) do_login(); return pass_ok; } else { - syslog(LOG_WARNING, "Bad password specified for <%s>\n", CC->curr_user); + syslog(LOG_WARNING, "Bad password specified for <%s> Service <%s> Port <%ld> Remote <%s / %s>\n", + CCC->curr_user, + CCC->ServiceName, + CCC->tcp_port, + CCC->cs_host, + CCC->cs_addr); + + +//citserver[5610]: Bad password specified for Service Remote + return pass_wrong_password; } }