summaryrefslogtreecommitdiffstats
path: root/sesman/scp_v1.c
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2017-03-20 18:59:44 -0700
committerjsorg71 <jay.sorg@gmail.com>2017-03-21 21:56:28 -0700
commit4b8a33e087ee9cf5556b40b717cd7e8ff243b3c3 (patch)
tree939bf7325777d0acb5b57e64cf41696ea65a4621 /sesman/scp_v1.c
parent43899b7e0c30cde282ef72f6431029c04c8ab242 (diff)
downloadxrdp-proprietary-4b8a33e087ee9cf5556b40b717cd7e8ff243b3c3.tar.gz
xrdp-proprietary-4b8a33e087ee9cf5556b40b717cd7e8ff243b3c3.zip
sesman: move auth/pam calls to main process
Diffstat (limited to 'sesman/scp_v1.c')
-rw-r--r--sesman/scp_v1.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sesman/scp_v1.c b/sesman/scp_v1.c
index f865271b..60f82112 100644
--- a/sesman/scp_v1.c
+++ b/sesman/scp_v1.c
@@ -42,7 +42,7 @@ void
scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
{
long data;
- int display;
+ int display = 0;
int retries;
int current_try;
enum SCP_SERVER_STATES_E e;
@@ -50,6 +50,7 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
struct session_item *sitem;
int scount;
SCP_SID sid;
+ bool_t do_auth_end = 1;
retries = g_cfg->sec.login_retry;
current_try = retries;
@@ -128,14 +129,20 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
log_message(LOG_LEVEL_INFO, "starting Xvnc session...");
display = session_start(data, SESMAN_SESSION_TYPE_XVNC, c, s);
}
- else
+ else if (SCP_SESSION_TYPE_XRDP == s->type)
{
log_message(LOG_LEVEL_INFO, "starting X11rdp session...");
display = session_start(data, SESMAN_SESSION_TYPE_XRDP, c, s);
}
-
+ else if (SCP_SESSION_TYPE_XORG == s->type)
+ {
+ log_message(LOG_LEVEL_INFO, "starting Xorg session...");
+ display = session_start(data, SESMAN_SESSION_TYPE_XORG, c, s);
+ }
+ /* if the session started up ok, auth_end will be called on
+ sig child */
+ do_auth_end = display == 0;
e = scp_v1s_connect_new_session(c, display);
-
switch (e)
{
case SCP_SERVER_STATE_OK:
@@ -201,7 +208,10 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
}
/* cleanup */
- auth_end(data);
+ if (do_auth_end)
+ {
+ auth_end(data);
+ }
g_free(slist);
}