Add support for SCP create_sockdir message to sesman

This commit is contained in:
matt335672 2024-09-13 12:06:34 +01:00
parent c0ccb56908
commit 661885f71d

View File

@ -578,6 +578,32 @@ process_list_sessions_request(struct pre_session_item *psi)
/******************************************************************************/
static int
process_create_sockdir_request(struct pre_session_item *psi)
{
enum scp_create_sockdir_status status = E_SCP_CS_OTHER_ERROR;
if (psi->login_state == E_PS_LOGIN_NOT_LOGGED_IN)
{
status = E_SCP_CS_NOT_LOGGED_IN;
}
else
{
LOG(LOG_LEVEL_INFO,
"Received request from %s to create sockdir for user %s",
psi->peername, psi->username);
if (create_xrdp_socket_path(psi->uid) == 0)
{
status = E_SCP_CS_OK;
}
}
return scp_send_create_sockdir_response(psi->client_trans, status);
}
/******************************************************************************/
static int
process_close_connection_request(struct pre_session_item *psi)
{
@ -625,6 +651,10 @@ scp_process(struct pre_session_item *psi)
rv = process_list_sessions_request(psi);
break;
case E_SCP_CREATE_SOCKDIR_REQUEST:
rv = process_create_sockdir_request(psi);
break;
case E_SCP_CLOSE_CONNECTION_REQUEST:
rv = process_close_connection_request(psi);
break;