Don't assume AF_INET family. Don't assume the socket is connected. Report
local address and port. Don't try to close non-sockets and invalid file
descriptors. Report errors getting socket information and closing the
socket. Use more appropriate log levels.
because 1st argument to clipboard_get_file() is given as URL encoded.
Decoding only filename is incomplete.
Without this fix, clipboard file doesn't work in case pathname
contains non-ASCII characters or non-alphanumeric ASCII characters.
broken by #314. This is compatible with the fix introduced in #314.
To use non-ASCII text/filename in clipboard, chansrv needs to be run
with LC_CTYPE=*.UTF-8 because the behaviour of mbstowcs(3) function
called in chansrv depends on LC_CTYPE[1]. However #314 made
LC_CTYPE=C in chansrv context. Even if LANG and LC_* are set in
.bashrc, /etc/profile, /etc/locale.conf or something like that,
it doesn't affect in chansrv context because chansrv doesn't source
any of them unlike sesman.
So do not set LC_CTYPE to blank or "C" in g_init() in order to get
g_mbstowcs and g_wcstombs to work properly with non-ASCII UTF-8
characters in any context.
Setting LC_CTYPE to *.UTF-8 doesn't obstruct applying system
language in RHEL [2].
[1] Linux man page says:
The behavior of mbstowcs() depends on the LC_CTYPE category of
the current locale.
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1290820
When xfuse_create_file_in_xrdp_fs is failed, it returns NULL.
Without this fix, xinode->size causes SEGV, so implementation is changed
to return -1 and check the return value in caller.
This fixes loading modules compiled with a C++ compiler. Remote thandle
type, it's unused. Use tintptr for module data. Don't cast pointers to
long, they won't fit on Win64.
String literals are const in C++. Using this warnings moves us closer to
the stated goal of C++ compatibility, makes the code cleaner and lets
compilers optimize the code better.
Add m4/ax_append_compile_flags.m4 from Autoconf Archives for the
AX_APPEND_COMPILE_FLAGS macro and m4/ax_check_compile_flag.m4 as its
dependency.
Using the same argument for binary and text data is not a good idea. If
string support is ever needed, it should be a separate function.
Remove SCP_ADDRESS_TYPE_IPV4_BIN and SCP_ADDRESS_TYPE_IPV6_BIN, use
SCP_ADDRESS_TYPE_IPV4 and SCP_ADDRESS_TYPE_IPV6, which simplifies the
code.