remove tabs, no logic change

ulab-next
Jay Sorg 11 years ago
parent 5adbf2d32b
commit f8e876a8f7

@ -956,42 +956,49 @@ xrdp_sec_process_mcs_data_channels(struct xrdp_sec *self, struct stream *s)
static int APP_CC static int APP_CC
xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s) xrdp_sec_process_mcs_data_monitors(struct xrdp_sec *self, struct stream *s)
{ {
int index; int index;
int monitorCount; int monitorCount;
int flags; int flags;
struct mcs_monitor_item *monitor_item; struct mcs_monitor_item *monitor_item;
DEBUG(("processing monitors data, allow_multimon is %d", self->multimon)); DEBUG(("processing monitors data, allow_multimon is %d", self->multimon));
/* this is an option set in xrdp.ini */ /* this is an option set in xrdp.ini */
if (self->multimon != 1) /* are multi-monitors allowed ? */ if (self->multimon != 1) /* are multi-monitors allowed ? */
{ {
DEBUG(("[INFO] xrdp_sec_process_mcs_data_monitors: multimon is not allowed, skipping")); DEBUG(("[INFO] xrdp_sec_process_mcs_data_monitors: multimon is not "
"allowed, skipping"));
return 0; return 0;
} }
in_uint32_le(s, flags); /* flags */ in_uint32_le(s, flags); /* flags */
//verify flags - must be 0x0 //verify flags - must be 0x0
if (flags != 0){ if (flags != 0)
DEBUG(("[ERROR] xrdp_sec_process_mcs_data_monitors: flags MUST be zero, detected: %d", flags)); {
return 0; DEBUG(("[ERROR] xrdp_sec_process_mcs_data_monitors: flags MUST be "
"zero, detected: %d", flags));
return 0;
} }
in_uint32_le(s, monitorCount); in_uint32_le(s, monitorCount);
//verify monitorCount - max 16 //verify monitorCount - max 16
if (monitorCount > 16){ if (monitorCount > 16)
DEBUG(("[ERROR] xrdp_sec_process_mcs_data_monitors: max allowed monitors is 16, detected: %d", monitorCount)); {
return 0; DEBUG(("[ERROR] xrdp_sec_process_mcs_data_monitors: max allowed "
"monitors is 16, detected: %d", monitorCount));
return 0;
} }
for (index = 0; index < monitorCount; index++) for (index = 0; index < monitorCount; index++)
{ {
monitor_item = (struct mcs_monitor_item *) monitor_item = (struct mcs_monitor_item *)
g_malloc(sizeof(struct mcs_monitor_item), 1); g_malloc(sizeof(struct mcs_monitor_item), 1);
in_uint32_le(s, monitor_item->left); in_uint32_le(s, monitor_item->left);
in_uint32_le(s, monitor_item->top); in_uint32_le(s, monitor_item->top);
in_uint32_le(s, monitor_item->right); in_uint32_le(s, monitor_item->right);
in_uint32_le(s, monitor_item->bottom); in_uint32_le(s, monitor_item->bottom);
in_uint32_le(s, monitor_item->is_primary); in_uint32_le(s, monitor_item->is_primary);
list_add_item(self->mcs_layer->monitor_list, (long)monitor_item); list_add_item(self->mcs_layer->monitor_list, (long)monitor_item);
DEBUG(("got monitor: left: %d, top: %d, right: %d, bottom: %d, is primary: %d", DEBUG(("got monitor: left: %d, top: %d, right: %d, bottom: %d, is "
monitor_item->left, monitor_item->top, monitor_item->right, monitor_item->bottom, monitor_item->is_primary)); "primary: %d", monitor_item->left, monitor_item->top,
monitor_item->right, monitor_item->bottom,
monitor_item->is_primary));
} }
return 0; return 0;
@ -1045,7 +1052,7 @@ xrdp_sec_process_mcs_data(struct xrdp_sec *self)
case SEC_TAG_CLI_4: case SEC_TAG_CLI_4:
break; break;
case SEC_TAG_CLI_MONITOR: case SEC_TAG_CLI_MONITOR:
xrdp_sec_process_mcs_data_monitors(self, s); xrdp_sec_process_mcs_data_monitors(self, s);
break; break;
default: default:
g_writeln("error unknown xrdp_sec_process_mcs_data tag %d size %d", g_writeln("error unknown xrdp_sec_process_mcs_data tag %d size %d",
@ -1093,27 +1100,31 @@ xrdp_sec_out_mcs_data(struct xrdp_sec *self)
out_uint8(s, 0x63); /* c */ out_uint8(s, 0x63); /* c */
out_uint8(s, 0x44); /* D */ out_uint8(s, 0x44); /* D */
out_uint8(s, 0x6e); /* n */ out_uint8(s, 0x6e); /* n */
if (self->mcs_layer->iso_layer->selectedProtocol != -1) { // Check for RDPNEGDATA availability if (self->mcs_layer->iso_layer->selectedProtocol != -1)
out_uint16_be(s, 0x80fc + (num_channels_even * 2) + 4); { // Check for RDPNEGDATA availability
out_uint16_be(s, 0x80fc + (num_channels_even * 2) + 4);
} }
else else
{ {
out_uint16_be(s, 0x80fc + (num_channels_even * 2)); out_uint16_be(s, 0x80fc + (num_channels_even * 2));
} }
out_uint16_le(s, SEC_TAG_SRV_INFO); out_uint16_le(s, SEC_TAG_SRV_INFO);
if (self->mcs_layer->iso_layer->selectedProtocol != -1) { if (self->mcs_layer->iso_layer->selectedProtocol != -1)
out_uint16_le(s, 12); /* len */ {
out_uint16_le(s, 12); /* len */
} }
else else
{ {
out_uint16_le(s, 8); /* len */ out_uint16_le(s, 8); /* len */
} }
out_uint8(s, 4); /* 4 = rdp5 1 = rdp4 */ out_uint8(s, 4); /* 4 = rdp5 1 = rdp4 */
out_uint8(s, 0); out_uint8(s, 0);
out_uint8(s, 8); out_uint8(s, 8);
out_uint8(s, 0); out_uint8(s, 0);
if (self->mcs_layer->iso_layer->selectedProtocol != -1) { if (self->mcs_layer->iso_layer->selectedProtocol != -1)
out_uint32_le(s, self->mcs_layer->iso_layer->selectedProtocol); /* clientReqeustedProtocol */ {
/* clientReqeustedProtocol */
out_uint32_le(s, self->mcs_layer->iso_layer->selectedProtocol);
} }
out_uint16_le(s, SEC_TAG_SRV_CHANNELS); out_uint16_le(s, SEC_TAG_SRV_CHANNELS);
out_uint16_le(s, 8 + (num_channels_even * 2)); /* len */ out_uint16_le(s, 8 + (num_channels_even * 2)); /* len */
@ -1244,7 +1255,8 @@ xrdp_sec_incoming(struct xrdp_sec *self)
if (file_by_name_read_section(key_file, "keys", items, values) != 0) if (file_by_name_read_section(key_file, "keys", items, values) != 0)
{ {
/* this is a show stopper */ /* this is a show stopper */
log_message(LOG_LEVEL_ALWAYS,"XRDP cannot read file: %s (check permissions)", key_file); log_message(LOG_LEVEL_ALWAYS, "XRDP cannot read file: %s "
"(check permissions)", key_file);
list_delete(items); list_delete(items);
list_delete(values); list_delete(values);
return 1; return 1;

Loading…
Cancel
Save