diff options
author | ilsimo <ilsimo> | 2008-07-30 10:58:30 +0000 |
---|---|---|
committer | ilsimo <ilsimo> | 2008-07-30 10:58:30 +0000 |
commit | d14b076a700e1ad87048549945f0f1e658db6cd5 (patch) | |
tree | cba23a5e8d2175796912e738164c26da4ce345b6 /sesman/scp_v1.c | |
parent | a8a2f0a0b0749fa0d7376d2322b05f3984356e29 (diff) | |
download | xrdp-proprietary-d14b076a700e1ad87048549945f0f1e658db6cd5.tar.gz xrdp-proprietary-d14b076a700e1ad87048549945f0f1e658db6cd5.zip |
still more work on logging
libscp makefile fix
Diffstat (limited to 'sesman/scp_v1.c')
-rw-r--r-- | sesman/scp_v1.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/sesman/scp_v1.c b/sesman/scp_v1.c index 32a3ffe8..c5ff2d4c 100644 --- a/sesman/scp_v1.c +++ b/sesman/scp_v1.c @@ -30,7 +30,7 @@ //#include "libscp_types.h" #include "libscp.h" -extern struct config_sesman g_cfg; +extern struct config_sesman* g_cfg; static void parseCommonStates(enum SCP_SERVER_STATES_E e, char* f); @@ -48,7 +48,7 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) int scount; SCP_SID sid; - retries = g_cfg.sec.login_retry; + retries = g_cfg->sec.login_retry; current_try = retries; data = auth_userpass(s->username, s->password); @@ -56,7 +56,7 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) while ((!data) && ((retries == 0) || (current_try > 0))) { - LOG_DBG("data %d - retry %d - currenttry %d - expr %d", data, retries, current_try, ((!data) && ((retries==0) || (current_try>0)))); + LOG_DBG(&(g_cfg->log), "data %d - retry %d - currenttry %d - expr %d", data, retries, current_try, ((!data) && ((retries==0) || (current_try>0)))); e=scp_v1s_request_password(c,s,"Wrong username and/or password"); @@ -83,7 +83,7 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) if (!data) { scp_v1s_deny_connection(c, "Login failed"); - log_message(&(g_cfg.log), LOG_LEVEL_INFO, + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "Login failed for user %s. Connection terminated", s->username); free_session(s); return; @@ -93,7 +93,7 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) if (0 == access_login_allowed(s->username)) { scp_v1s_deny_connection(c, "Access to Terminal Server not allowed."); - log_message(&(g_cfg.log), LOG_LEVEL_INFO, + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "User %s not allowed on TS. Connection terminated", s->username); free_session(s); return; @@ -107,16 +107,16 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) if (scount == 0) { /* no disconnected sessions - start a new one */ - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "granted TS access to user %s", s->username); + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "granted TS access to user %s", s->username); if (SCP_SESSION_TYPE_XVNC == s->type) { - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "starting Xvnc session..."); + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "starting Xvnc session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XVNC); } else { - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "starting X11rdp session..."); + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "starting X11rdp session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XRDP); } @@ -145,7 +145,7 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) /*case SCP_SERVER_STATE_FORCE_NEW:*/ /* we should check for MaxSessions */ case SCP_SERVER_STATE_SELECTION_CANCEL: - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "Connection cancelled after session listing"); + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "Connection cancelled after session listing"); break; case SCP_SERVER_STATE_OK: /* ok, reconnecting... */ @@ -153,14 +153,14 @@ scp_v1_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) if (0==sitem) { e=scp_v1s_connection_error(c, "Internal error"); - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "Cannot find session item on the chain"); + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "Cannot find session item on the chain"); } else { display=sitem->display; /*e=scp_v1s_reconnect_session(c, sitem, display);*/ e=scp_v1s_reconnect_session(c, display); - log_message(&(g_cfg.log), LOG_LEVEL_INFO, "User %s reconnected to session %d on port %d", \ + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "User %s reconnected to session %d on port %d", \ s->username, sitem->pid, display); } break; @@ -188,27 +188,27 @@ static void parseCommonStates(enum SCP_SERVER_STATES_E e, char* f) switch (e) { case SCP_SERVER_STATE_VERSION_ERR: - LOG_DBG(&(g_cfg.log), "version error") + LOG_DBG(&(g_cfg->log), "version error") case SCP_SERVER_STATE_SIZE_ERR: /* an unknown scp version was requested, so we shut down the */ /* connection (and log the fact) */ - log_message(&(g_cfg.log), LOG_LEVEL_WARNING, + log_message(&(g_cfg->log), LOG_LEVEL_WARNING, "protocol violation. connection closed."); break; case SCP_SERVER_STATE_NETWORK_ERR: - log_message(&(g_cfg.log), LOG_LEVEL_WARNING, "libscp network error."); + log_message(&(g_cfg->log), LOG_LEVEL_WARNING, "libscp network error."); break; case SCP_SERVER_STATE_SEQUENCE_ERR: - log_message(&(g_cfg.log), LOG_LEVEL_WARNING, "libscp sequence error."); + log_message(&(g_cfg->log), LOG_LEVEL_WARNING, "libscp sequence error."); break; case SCP_SERVER_STATE_INTERNAL_ERR: /* internal error occurred (eg. malloc() error, ecc.) */ - log_message(&(g_cfg.log), LOG_LEVEL_ERROR, "libscp internal error occurred."); + log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "libscp internal error occurred."); break; default: /* dummy: scp_v1s_request_password won't generate any other */ /* error other than the ones before */ - log_message(&(g_cfg.log), LOG_LEVEL_ALWAYS, "unknown return from %s", f); + log_message(&(g_cfg->log), LOG_LEVEL_ALWAYS, "unknown return from %s", f); break; } } |