Remove TCP socket support fron chansrv

The code in xrdp_mm.c to connect to chansrv over a TCP socket has
been removed, with the move to UDS. This PR simply removes the
chansrv TCP listening code. Without doing this, some configurations
result in a failure of xrdp to connect to chansrv.
This commit is contained in:
matt335672 2022-05-03 10:57:41 +01:00
parent 7868622a79
commit 8f1bdaa95e
3 changed files with 3 additions and 60 deletions

View File

@ -1241,18 +1241,9 @@ setup_listen(void)
trans_delete(g_lis_trans);
}
if (g_cfg->use_unix_socket)
{
g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, XRDP_CHANSRV_STR, g_display_num);
}
else
{
g_lis_trans = trans_create(TRANS_MODE_TCP, 8192, 8192);
g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, "%d", 7200 + g_display_num);
}
g_lis_trans = trans_create(TRANS_MODE_UNIX, 8192, 8192);
g_lis_trans->is_term = g_is_term;
g_snprintf(port, 255, XRDP_CHANSRV_STR, g_display_num);
g_lis_trans->trans_conn_in = my_trans_conn_in;
error = trans_listen(g_lis_trans, port);

View File

@ -35,7 +35,6 @@
#include "string_calls.h"
/* Default settings */
#define DEFAULT_USE_UNIX_SOCKET 0
#define DEFAULT_RESTRICT_OUTBOUND_CLIPBOARD 0
#define DEFAULT_RESTRICT_INBOUND_CLIPBOARD 0
#define DEFAULT_ENABLE_FUSE_MOUNT 1
@ -84,41 +83,6 @@ log_to_stdout(const enum logLevels lvl, const char *msg, ...)
return LOG_STARTUP_OK;
}
/***************************************************************************//**
* Reads the config values we need from the [Globals] section
*
* @param logmsg Function to use to log messages
* @param names List of definitions in the section
* @params values List of corresponding values for the names
* @params cfg Pointer to structure we're filling in
*
* @return 0 for success
*/
static int
read_config_globals(log_func_t logmsg,
struct list *names, struct list *values,
struct config_chansrv *cfg)
{
int error = 0;
int index;
for (index = 0; index < names->count; ++index)
{
const char *name = (const char *)list_get_item(names, index);
const char *value = (const char *)list_get_item(values, index);
if (g_strcasecmp(name, "ListenAddress") == 0)
{
if (g_strcasecmp(value, "127.0.0.1") == 0)
{
cfg->use_unix_socket = 1;
}
}
}
return error;
}
/***************************************************************************//**
* Reads the config values we need from the [Security] section
*
@ -243,7 +207,6 @@ new_config(void)
}
else
{
cfg->use_unix_socket = DEFAULT_USE_UNIX_SOCKET;
cfg->enable_fuse_mount = DEFAULT_ENABLE_FUSE_MOUNT;
cfg->restrict_outbound_clipboard = DEFAULT_RESTRICT_OUTBOUND_CLIPBOARD;
cfg->restrict_inbound_clipboard = DEFAULT_RESTRICT_INBOUND_CLIPBOARD;
@ -285,12 +248,6 @@ config_read(int use_logger, const char *sesman_ini)
names->auto_free = 1;
values->auto_free = 1;
if (!error && file_read_section(fd, "Globals", names, values) == 0)
{
error = read_config_globals(logmsg, names, values, cfg);
}
if (!error && file_read_section(fd, "Security", names, values) == 0)
{
error = read_config_security(logmsg, names, values, cfg);
@ -322,8 +279,6 @@ void
config_dump(struct config_chansrv *config)
{
g_writeln("Global configuration:");
g_writeln(" UseUnixSocket (derived): %s",
g_bool2text(config->use_unix_socket));
char buf[256];
g_writeln("\nSecurity configuration:");

View File

@ -23,9 +23,6 @@
struct config_chansrv
{
/** Whether to use a UNIX socket for chansrv */
int use_unix_socket;
/** Whether the FUSE mount is enabled or not */
int enable_fuse_mount;