summaryrefslogtreecommitdiffstats
path: root/common/os_calls.c
Commit message (Collapse)AuthorAgeFilesLines
* Implements the accept/close logic for vsockJustin Terry (VM)2017-11-171-0/+42
|
* common, return -1 for bad socketJay Sorg2017-11-071-2/+2
|
* use g_memcpy, bracesJay Sorg2017-11-071-1/+1
|
* vsock, move some definesJay Sorg2017-11-071-10/+6
|
* Implements XRDP over vsockJustin Terry (VM)2017-11-071-0/+36
| | | | | 1. Implements the ability to use AV_VSOCK for the transport rather than TCP. 2. Updates the ini file to be able to conditionally turn this feature on.
* common: prevent raw use of snprintfKoichiro IWAO2017-10-031-7/+7
|
* common: fix g_write_ip_address() didn't return correct IP addressKoichiro IWAO2017-09-261-14/+58
| | | | Fixes: #878.
* append a / to ensure the full path is created even when the config variable ↵Ian Geiser2017-07-191-1/+1
| | | | lacks a trailing /
* common: fix more glitches in IPv4 initializationKoichiro IWAO2017-07-141-2/+2
|
* Use g_create_path instead of g_create_dirIan Geiser2017-07-141-7/+7
| | | | Rename g_mk_temp_dir to g_mk_socket_path
* common: use log_messageKoichiro IWAO2017-07-131-2/+3
|
* common: fix a glitch with IPv4 struct initializationKoichiro IWAO2017-07-101-1/+1
| | | | | Pointed out by: andrecbarros Closes: #803
* common: implement g_file_readable for WIN32Koichiro IWAO2017-06-121-1/+1
|
* Log user-friendly message when certificate/privkey is inaccessibleKoichiro IWAO2017-06-121-0/+12
| | | | | | | | | | | | We shouldn't assume that xrdp daemon is running under root privilege. In many cases, root privilege is not really needed for xrdp daemon. xrdp may fail to load certificate/privkey due to lack of permissions when running under user privilege. Checking existence of files is not enough and xrdp should output user-friendly log in such case. Reported by Debian user in bug 856436 [1]. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=856436
* Removed error message while falling back to IPv4 (issue #714)MichaelSweden2017-04-251-2/+1
|
* Fix to handle OS disabled IPv6, issue #714.MichaelSweden2017-04-251-124/+228
| | | | | | | | | - Changes made only in the os_calls.c file. - Exported functions changed: g_tcp_bind g_tcp_bind_address g_tcp_connect - Support three network configurations: 1) Normal network, with IPv6 2) Partly disabled IPv6 via sysctl.conf 3) Total disabled IPv6 via grub
* Log socket fd in g_sck_accept(), fix AF_UNIX loggingPavel Roskin2017-03-211-4/+17
|
* Make socket directory configurable, don't hardcode /tmp/.xrdpPavel Roskin2017-03-171-5/+6
| | | | | | | | | | Use XRDP_SOCKET_PATH in file_loc.h Don't define any non-socket paths in file_loc.h, they should come from the makefiles. Define all paths unconditionally, they should not be defined elsewhere. Pass XRDP_SOCKET_PATH as environment variable to the backends.
* Eliminate APP_CC and DEFAULT_CCPavel Roskin2017-03-141-142/+142
|
* Add GNU/kFreeBSD support (#645)mirabilos2017-01-261-2/+2
| | | | | | * GNU/kFreeBSD is a FreeBSD variant, for code purposes. * GNU/kFreeBSD uses GNU/Linux-ish init scripts, however.
* Don't use colon to separate IPv6 address from the portPavel Roskin2016-12-091-1/+1
| | | | | IPv6 addresses can have colons in their names, so the final colon can be confusing.
* vnc: code cleanupJay Sorg2016-12-041-0/+28
|
* common: If IPv6 not supported, fall back to IPv4Koichiro IWAO2016-11-221-0/+16
| | | | | | | The system to run xrdp does not necessarily support IPv6 even though it is compiled with IPv6. Fixes #432.
* Merge pull request #460 from metalefty/ipv6/logsItamar Reis Peixoto2016-11-201-29/+104
|\ | | | | common: Fix client IP address logging when IPv6 is enabled
| * common: Address family it not always AF_INET6Koichiro IWAO2016-11-041-36/+84
| | | | | | | | even if XRDP_ENABLE_IPV6 defined.
| * common: Fix client IP address logging when IPv6 is enabledKoichiro IWAO2016-11-041-25/+52
| | | | | | | | | | | | | | | | g_tcp_accept() and g_sck_accept() should use sockadd_in6 when IPv6 is enabled. The former code logs client IP address always "0.0.0.0" in such case. Fixes #412.
* | Use g_get_strerror() instead of strerror(errno) for portabilityPavel Roskin2016-11-081-2/+2
|/
* Use const pointers in function arguments when possiblePavel Roskin2016-10-171-2/+2
|
* Don't use final newline in log calls, it's already appendedPavel Roskin2016-10-171-4/+4
|
* Fix outgoing connections on Mac OSXPavel Roskin2016-09-081-1/+17
| | | | connect() on an already established connection returns error with errno set to EISCONN. Treat it as success.
* Add socklen_t check with substitution, use socklen_t as neededPavel Roskin2016-09-081-63/+12
|
* Improve debug information when closing a socketPavel Roskin2016-09-081-10/+76
| | | | | | | 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.
* Fix clipboard when text/filename contains non-ASCII charactersKoichiro IWAO2016-08-181-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge pull request #390 from proski/june21jsorg712016-08-051-13/+11
|\ | | | | Cleanups and C++ compatibility
| * Fix signed to unsigned comparisons reported by g++ 6.1.0Pavel Roskin2016-07-081-1/+1
| |
| * Fix warnings detected by -Wwrite-stringsPavel Roskin2016-07-081-5/+5
| |
| * Fix format warnings in log_message() callsPavel Roskin2016-06-211-6/+4
| |
| * Fix incorrect use of "it's" and "its", adjust wordingPavel Roskin2016-06-211-1/+1
| |
* | sesman: env_set_user, fix potential bof issuesspeidy2016-07-221-7/+11
|/
* Merge pull request #332 from metalefty/freebsd/ipv6jsorg712016-05-051-40/+47
|\ | | | | common: add log for g_tcp_connect
| * common: no logic change, indent 2 -> 4Koichiro IWAO2016-02-231-39/+39
| |
| * common: no logic change, fix alignment, whitespacesKoichiro IWAO2016-02-231-2/+2
| |
| * common: add log for g_tcp_connectKoichiro IWAO2016-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in case getaddrinfo(3) might fail. In FreeBSD, AI_V4MAPPED support for getaddrinfo(3) was very recently implemented[1]. Most of FreeBSD systems in the world do not have this implementation yet. This will be a problem when AI_V4MAPPED isn't supported and xrdp is built with IPv6 option. In such a case, g_tcp_connect always fails. Of course getaddrinfo(3) might fail in other cases. The log helps us to know what's happening. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198092
* | common: fix warningsJay Sorg2016-04-021-3/+7
| |
* | fix warnings, move some calls to os_callsJay Sorg2016-03-161-0/+22
| |
* | Don't attempt to intercept SIGKILL, it doesn't work on any OSJay Sorg2016-03-141-11/+0
|/
* Fix typosPavel Roskin2016-02-131-2/+2
|
* Merge pull request #254 from metalefty/freebsd/ipv6Itamar Reis Peixoto2016-02-081-3/+7
|\ | | | | Unbreak IPv6 on FreeBSD and add IPv6-only option
| * common: add --enable-ipv6only optionKoichiro IWAO2015-07-021-0/+4
| |
| * common: drop ipv6 autodetection only valid for linuxKoichiro IWAO2015-07-021-3/+3
| |