From 4d4ebbf3632bed609b41a9d36969c08d36791417 Mon Sep 17 00:00:00 2001 From: norrarvid Date: Sun, 27 May 2012 17:17:39 +0200 Subject: Initial syslog support in XRDP --- sesman/scp_v0.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index 0b4dc791..e36aeaf6 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -47,39 +47,39 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) display = s_item->display; if (0 != s->client_ip) { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); + log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); } else { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d", s->username, display, s_item->pid); + log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d", s->username, display, s_item->pid); } auth_end(data); /* don't set data to null here */ } else { - LOG_DBG(&(g_cfg->log), "pre auth"); + LOG_DBG("pre auth"); if (1 == access_login_allowed(s->username)) { if (0 != s->client_ip) { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "++ created session (access granted): username %s, ip %s", s->username, s->client_ip); + log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s, ip %s", s->username, s->client_ip); } else { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "++ created session (access granted): username %s", s->username); + log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s", s->username); } if (SCP_SESSION_TYPE_XVNC == s->type) { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "starting Xvnc session..."); + log_message( LOG_LEVEL_INFO, "starting Xvnc session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XVNC, s->domain, s->program, s->directory, s->client_ip); } else { - log_message(&(g_cfg->log), LOG_LEVEL_INFO, "starting X11rdp session..."); + log_message(LOG_LEVEL_INFO, "starting X11rdp session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XRDP, s->domain, s->program, s->directory, s->client_ip); -- cgit v1.2.1 From 10fdc5c17f7aec2df8885d2cf7354f6681af76f6 Mon Sep 17 00:00:00 2001 From: norrarvid Date: Thu, 31 May 2012 16:57:17 +0200 Subject: separate pam authentication for gateways --- sesman/scp_v0.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index 0b4dc791..71b1ffad 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -38,9 +38,28 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) struct session_item* s_item; data = auth_userpass(s->username, s->password); - - if (data) + if(s->type==SCP_GW_AUTHENTICATION) { + /* this is just authentication in a gateway situation */ + /* g_writeln("SCP_GW_AUTHENTICATION message received"); */ + if(data){ + if (1 == access_login_allowed(s->username)) + { + /* the user is member of the correct groups. */ + scp_v0s_replyauthentication(c,0); + /* g_writeln("Connection allowed"); */ + }else{ + scp_v0s_replyauthentication(c,3); + /* g_writeln("user password ok, but group problem"); */ + } + }else{ + /* g_writeln("username or password error"); */ + scp_v0s_replyauthentication(c,2); + } + auth_end(data); + } + else if (data) + { s_item = session_get_bydata(s->username, s->width, s->height, s->bpp, s->type); if (s_item != 0) { -- cgit v1.2.1 From 42edcbb6c193e5e825e7600a6784bd48fa9bf503 Mon Sep 17 00:00:00 2001 From: norrarvid Date: Thu, 7 Jun 2012 13:46:44 +0200 Subject: Improved logging --- sesman/scp_v0.c | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index 75abb14a..b4e1a845 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -42,21 +42,32 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) { /* this is just authentication in a gateway situation */ /* g_writeln("SCP_GW_AUTHENTICATION message received"); */ - if(data){ - if (1 == access_login_allowed(s->username)) - { + if(data) + { + if (1 == access_login_allowed(s->username)) + { /* the user is member of the correct groups. */ scp_v0s_replyauthentication(c,0); + log_message( LOG_LEVEL_INFO,"Access permitted for user: %s", + s->username); /* g_writeln("Connection allowed"); */ - }else{ - scp_v0s_replyauthentication(c,3); + } + else + { + scp_v0s_replyauthentication(c,3); + log_message( LOG_LEVEL_INFO,"Username okey but group problem for user: %s", + s->username); /* g_writeln("user password ok, but group problem"); */ - } - }else{ - /* g_writeln("username or password error"); */ - scp_v0s_replyauthentication(c,2); - } - auth_end(data); + } + } + else + { + /* g_writeln("username or password error"); */ + log_message( LOG_LEVEL_INFO,"Username or password error for user: %s", + s->username); + scp_v0s_replyauthentication(c,2); + } + auth_end(data); } else if (data) { @@ -66,11 +77,13 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) display = s_item->display; if (0 != s->client_ip) { - log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); + log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, " + "session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); } else { - log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, session_pid %d", s->username, display, s_item->pid); + log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, " + "session_pid %d", s->username, display, s_item->pid); } auth_end(data); /* don't set data to null here */ @@ -82,11 +95,13 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) { if (0 != s->client_ip) { - log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s, ip %s", s->username, s->client_ip); + log_message(LOG_LEVEL_INFO, "++ created session (access granted): " + "username %s, ip %s", s->username, s->client_ip); } else { - log_message(LOG_LEVEL_INFO, "++ created session (access granted): username %s", s->username); + log_message(LOG_LEVEL_INFO, "++ created session (access granted): " + "username %s", s->username); } if (SCP_SESSION_TYPE_XVNC == s->type) -- cgit v1.2.1 From 1d35ba19a6a59ab16a111dfb86a03cc657893c72 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 16 Jul 2012 13:05:22 -0700 Subject: sesman: no logic change, code cleanup --- sesman/scp_v0.c | 58 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 27 deletions(-) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index b4e1a845..da60f294 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -38,52 +38,55 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) struct session_item* s_item; data = auth_userpass(s->username, s->password); - if(s->type==SCP_GW_AUTHENTICATION) + if (s->type == SCP_GW_AUTHENTICATION) { /* this is just authentication in a gateway situation */ /* g_writeln("SCP_GW_AUTHENTICATION message received"); */ - if(data) + if (data) { - if (1 == access_login_allowed(s->username)) - { - /* the user is member of the correct groups. */ - scp_v0s_replyauthentication(c,0); - log_message( LOG_LEVEL_INFO,"Access permitted for user: %s", - s->username); - /* g_writeln("Connection allowed"); */ - } + if (1 == access_login_allowed(s->username)) + { + /* the user is member of the correct groups. */ + scp_v0s_replyauthentication(c, 0); + log_message(LOG_LEVEL_INFO, "Access permitted for user: %s", + s->username); + /* g_writeln("Connection allowed"); */ + } else { scp_v0s_replyauthentication(c,3); - log_message( LOG_LEVEL_INFO,"Username okey but group problem for user: %s", - s->username); - /* g_writeln("user password ok, but group problem"); */ - } + log_message(LOG_LEVEL_INFO, "Username okey but group problem for " + "user: %s", s->username); + /* g_writeln("user password ok, but group problem"); */ + } } else { - /* g_writeln("username or password error"); */ - log_message( LOG_LEVEL_INFO,"Username or password error for user: %s", - s->username); - scp_v0s_replyauthentication(c,2); + /* g_writeln("username or password error"); */ + log_message(LOG_LEVEL_INFO, "Username or password error for user: %s", + s->username); + scp_v0s_replyauthentication(c, 2); } auth_end(data); } else if (data) - { - s_item = session_get_bydata(s->username, s->width, s->height, s->bpp, s->type); + { + s_item = session_get_bydata(s->username, s->width, s->height, + s->bpp, s->type); if (s_item != 0) { display = s_item->display; if (0 != s->client_ip) { - log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, " - "session_pid %d, ip %s", s->username, display, s_item->pid, s->client_ip); + log_message( LOG_LEVEL_INFO, "++ reconnected session: username %s, " + "display :%d.0, session_pid %d, ip %s", + s->username, display, s_item->pid, s->client_ip); } else { - log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, display :%d.0, " - "session_pid %d", s->username, display, s_item->pid); + log_message(LOG_LEVEL_INFO, "++ reconnected session: username %s, " + "display :%d.0, session_pid %d", s->username, display, + s_item->pid); } auth_end(data); /* don't set data to null here */ @@ -109,14 +112,16 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) log_message( LOG_LEVEL_INFO, "starting Xvnc session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XVNC, - s->domain, s->program, s->directory, s->client_ip); + s->domain, s->program, s->directory, + s->client_ip); } else { log_message(LOG_LEVEL_INFO, "starting X11rdp session..."); display = session_start(s->width, s->height, s->bpp, s->username, s->password, data, SESMAN_SESSION_TYPE_XRDP, - s->domain, s->program, s->directory, s->client_ip); + s->domain, s->program, s->directory, + s->client_ip); } } else @@ -139,4 +144,3 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) scp_v0s_deny_connection(c); } } - -- cgit v1.2.1 From a246fd582de861f3d4bb69ed2aa9fc47e1b7b441 Mon Sep 17 00:00:00 2001 From: Jay Sorg Date: Mon, 16 Jul 2012 13:20:26 -0700 Subject: sesman: added option to run reconnectwm.sh on session reconnect --- sesman/scp_v0.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sesman/scp_v0.c') diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c index da60f294..dac04ad3 100644 --- a/sesman/scp_v0.c +++ b/sesman/scp_v0.c @@ -88,6 +88,7 @@ scp_v0_process(struct SCP_CONNECTION* c, struct SCP_SESSION* s) "display :%d.0, session_pid %d", s->username, display, s_item->pid); } + session_reconnect(display, s->username); auth_end(data); /* don't set data to null here */ } -- cgit v1.2.1