|
|
@ -2174,8 +2174,7 @@ is_channel_enabled(char *inName, struct list *names, struct list *values)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int reply = 0; /*means not in the list*/
|
|
|
|
int reply = 0; /*means not in the list*/
|
|
|
|
int index;
|
|
|
|
int index;
|
|
|
|
char *val;
|
|
|
|
char *val;
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
index = find_name_in_lists(inName, names);
|
|
|
|
index = find_name_in_lists(inName, names);
|
|
|
|
if ( index >= 0 )
|
|
|
|
if ( index >= 0 )
|
|
|
@ -2184,9 +2183,13 @@ is_channel_enabled(char *inName, struct list *names, struct list *values)
|
|
|
|
reply = text2bool(val);
|
|
|
|
reply = text2bool(val);
|
|
|
|
if (reply == 0)
|
|
|
|
if (reply == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
log_message(LOG_LEVEL_INFO,"This channel is disabled: %s", name);
|
|
|
|
log_message(LOG_LEVEL_INFO,"This channel is disabled: %s", inName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
log_message(LOG_LEVEL_INFO,"This channel is disabled (not in List): %s", inName);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return reply;
|
|
|
|
return reply;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2212,7 +2215,8 @@ void init_channel_allowed(struct xrdp_wm *wm)
|
|
|
|
|
|
|
|
|
|
|
|
names = list_create();
|
|
|
|
names = list_create();
|
|
|
|
values = list_create();
|
|
|
|
values = list_create();
|
|
|
|
|
|
|
|
/* You can override the list of allowed channels individually for each
|
|
|
|
|
|
|
|
* session type. */
|
|
|
|
if ( read_allowed_channel_names(names, values)
|
|
|
|
if ( read_allowed_channel_names(names, values)
|
|
|
|
&& update_allowed_channel_names(wm, names, values) )
|
|
|
|
&& update_allowed_channel_names(wm, names, values) )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2226,13 +2230,13 @@ void init_channel_allowed(struct xrdp_wm *wm)
|
|
|
|
/* examples of channel names: rdpdr ; rdpsnd ; drdynvc ; cliprdr */
|
|
|
|
/* examples of channel names: rdpdr ; rdpsnd ; drdynvc ; cliprdr */
|
|
|
|
if (is_channel_enabled(channelname, names, values))
|
|
|
|
if (is_channel_enabled(channelname, names, values))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_writeln("The following channel is allowed: %s (%d)", channelname, index);
|
|
|
|
log_message(LOG_LEVEL_INFO,"The following channel is allowed: %s (%d)", channelname, index);
|
|
|
|
wm->allowedchannels[allowindex] = index;
|
|
|
|
wm->allowedchannels[allowindex] = index;
|
|
|
|
allowindex++;
|
|
|
|
allowindex++;
|
|
|
|
|
|
|
|
|
|
|
|
if (allowindex >= MAX_NR_CHANNELS)
|
|
|
|
if (allowindex >= MAX_NR_CHANNELS)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
g_writeln("Programming error in is_channel_allowed");
|
|
|
|
log_message(LOG_LEVEL_ALWAYS,"Programming error in is_channel_allowed");
|
|
|
|
error = 1; /* end loop */
|
|
|
|
error = 1; /* end loop */
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2268,7 +2272,7 @@ int DEFAULT_CC is_channel_allowed(struct xrdp_wm *wm, int channel_id)
|
|
|
|
if (wm->allowedinitialized == 0)
|
|
|
|
if (wm->allowedinitialized == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
init_channel_allowed(wm);
|
|
|
|
init_channel_allowed(wm);
|
|
|
|
g_writeln("allow channel list initialized");
|
|
|
|
log_message(LOG_LEVEL_DEBUG,"The allow channel list now initialized for this session");
|
|
|
|
wm->allowedinitialized = 1;
|
|
|
|
wm->allowedinitialized = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2287,11 +2291,7 @@ int DEFAULT_CC is_channel_allowed(struct xrdp_wm *wm, int channel_id)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*if (reply == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
g_writeln("This channel is NOT allowed: %d",channel_id) ;
|
|
|
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
return reply;
|
|
|
|
return reply;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|