Merge pull request #2049 from awakecoding/master

Shadow Server
build: fix compilation for non monolithic builds

set_complex_link_libraries isn't required anymore for winpr
since it's always build monolithic.
handle user@corp.net username correctly

(cherry picked from commit 248c9185084e99121ea5e99610384bb3a2c0f803)
Merge pull request #2051 from bmiklautz/feat/atusername

handle user@corp.net username correctly
Merge pull request #2050 from bmiklautz/fix/winpr_monolithic

build: fix compilation for non monolithic builds
(hopefully) proper window style setup in wfreerdp at startup
Fix multiple cases of use of uninitialized vars

* Zeroing xevent helped address some erratic behavior.
* valgrind complained about using xfBitmap uninitialized
  during shutdown, traced it back to the initialization.
  Bitmap_Prototype->size > sizeof(rdpBitmap).
* Early exit from recv_tpkt_pdu is necessary to address
  a shutdown crash - the channelId value was being used
  without being set in the disconnect case.
Adjust the code to work with the new GDI color
representation.
* client/X11/xf_gdi.c:
Use freerdp_color_convert_drawing_order_color_to_gdi_color() to convert
from drawing order color representation to GDI color representation
troughout.
* client/X11/xf_graphics.c: Likewise.
WM_GETMINMAXINFO: use latest determined canvas diff
wfreerdp: WM_SIZE: only update canvas diff if window size is bigger than 0
channels: fix memory leak in stream pools.
Merge pull request #2066 from llyzs/llyzs

channels: fix memory leak in stream pools.
channels: fix possible overflow in logging

Fixes clang compiler warning:

"warning: the value of the size argument in 'strncat' is too large,
might lead to a buffer overflow [-Wstrncat-size]"

strncat requires an extra byte for '\0' so dest needs to have a size of
n+1
rdpdr/drive: fixes for hung peers & info requests

drive_file_init: only allow directories and regular files
This is fixes issue #2071

Even if the server is only interested in getting a file's or directory's
attributes FreeRDP still tries to open the object with read permissions.
If the FreeRDP client has no read permissions for this object the call will
fail which forces the server to perform some expensive workarounds (e.g.
getting to the stat buffers via a directory enumeration request).

On Linux we can try to open the file or directory with the O_PATH flag in
order to obtain a file descriptor who's only purpose is to perform operations
that act purely at the file descriptor level.
X11: Convert GDI color to X11 color troughout.
* client/X11/xf_client.c (xf_pre_connect): Set the field `colormap' of
`struct xfContext' to the default colormap.
* client/X11/xfreerdp.h (xf_gdi_get_color): Declare new external function.
* client/X11/xf_gdi.c (xf_gdi_get_color): Define new external function.
Use xf_gdi_get_color() to get the appropriate X color index from the GDI
color representation.
* client/X11/xf_graphics.c: Likewise.
Merge pull request #2067 from bmiklautz/fix/clog

channels: fix possible overflow in logging
Merge pull request #2055 from dbungert/initialize

Fix multiple cases of use of uninitialized vars
Merge pull request #2072 from nfedera/fix-2014-09-01-01

rdpdr/drive: fixes for hung peers & info requests
Merge pull request #2057 from ptsekov/software-gdi-improvements

Adjust the X11 code to work with the new GDI color
Merge pull request #2054 from erbth/wfreerdp

(hopefully) proper window style setup in wfreerdp at startup