xrdp: allow xrdp to listen in UDS
This commit is contained in:
parent
380c1f6b7d
commit
8b1639b96b
@ -60,6 +60,7 @@ xrdp_listen_create(void)
|
||||
g_process_sem = tc_sem_create(0);
|
||||
}
|
||||
|
||||
/* setting TCP mode now, may change later */
|
||||
self->listen_trans = trans_create(TRANS_MODE_TCP, 16, 16);
|
||||
|
||||
if (self->listen_trans == 0)
|
||||
@ -186,12 +187,18 @@ xrdp_listen_get_port_address(char *port, int port_bytes,
|
||||
if (g_strcasecmp(val, "port") == 0)
|
||||
{
|
||||
val = (char *)list_get_item(values, index);
|
||||
error = g_atoi(val);
|
||||
|
||||
if ((error > 0) && (error < 65000))
|
||||
if (val[0] == '/')
|
||||
{
|
||||
g_strncpy(port, val, port_bytes - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
error = g_atoi(val);
|
||||
if ((error > 0) && (error < 65000))
|
||||
{
|
||||
g_strncpy(port, val, port_bytes - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (g_strcasecmp(val, "address") == 0)
|
||||
@ -348,7 +355,15 @@ xrdp_listen_main_loop(struct xrdp_listen *self)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*Create socket*/
|
||||
if (port[0] == '/')
|
||||
{
|
||||
/* set UDS mode */
|
||||
self->listen_trans->mode = TRANS_MODE_UNIX;
|
||||
/* not valid with UDS */
|
||||
tcp_nodelay = 0;
|
||||
}
|
||||
|
||||
/* Create socket */
|
||||
error = trans_listen_address(self->listen_trans, port, address);
|
||||
|
||||
if (error == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user