Merge pull request #2247 from matt335672/remove_tcp_sock_from_chansrv

Remove TCP socket support from chansrv (part of UDS migration)
This commit is contained in:
matt335672 2022-05-04 09:26:36 +01:00 committed by GitHub
commit e6ff36f1b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;