From 315b8914c853078d8bb04a7d16e47d19128ca318 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 2 Mar 2019 19:39:52 -0600 Subject: Second batch of initial commits: * Add server/group pamming * Partially fix immediate exit after login Still will not compile due to libraptorsmiface being too new --- sesman/scp_v1.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sesman/scp_v1.c') diff --git a/sesman/scp_v1.c b/sesman/scp_v1.c index 60f82112..607aeca5 100644 --- a/sesman/scp_v1.c +++ b/sesman/scp_v1.c @@ -33,6 +33,8 @@ //#include "libscp_types.h" #include "libscp.h" +#include "libraptorsmiface.h" + extern struct config_sesman *g_cfg; /* in sesman.c */ static void parseCommonStates(enum SCP_SERVER_STATES_E e, const char *f); @@ -109,6 +111,13 @@ scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s) /* list disconnected sessions */ slist = session_get_byuser(s->username, &scount, SESMAN_SESSION_STATUS_DISCONNECTED); + // RAPTOR session management + pid_t serverpid = raptor_sm_get_pid_for_username(s->username); + if (serverpid < 0) { + // Session NOT already running + scount = 0; + } + if (scount == 0) { /* no disconnected sessions - start a new one */ -- cgit v1.2.1