diff options
author | Idan Freiberg <speidy@gmail.com> | 2014-07-23 16:44:59 +0300 |
---|---|---|
committer | Idan Freiberg <speidy@gmail.com> | 2014-07-23 16:44:59 +0300 |
commit | 16929efb059e1e29c826388e5d57be82014d241b (patch) | |
tree | f8661e7495a82a4a73e68825f1a1ff44a9e100f1 /common | |
parent | 0795400fe260652f6ae3788325e2a4c8ee05fe3a (diff) | |
parent | 0c63a8feb3c52de98a5da51a0a0f743450c34645 (diff) | |
download | xrdp-proprietary-16929efb059e1e29c826388e5d57be82014d241b.tar.gz xrdp-proprietary-16929efb059e1e29c826388e5d57be82014d241b.zip |
Merge branch 'devel' of https://github.com/neutrinolabs/xrdp into
devel
Conflicts:
libxrdp/xrdp_sec.c
Diffstat (limited to 'common')
-rw-r--r-- | common/file.c | 6 | ||||
-rw-r--r-- | common/log.c | 2 | ||||
-rw-r--r-- | common/os_calls.c | 36 | ||||
-rw-r--r-- | common/xrdp_client_info.h | 2 |
4 files changed, 33 insertions, 13 deletions
diff --git a/common/file.c b/common/file.c index a9a06de9..b51a37cc 100644 --- a/common/file.c +++ b/common/file.c @@ -233,7 +233,7 @@ l_file_read_section(int fd, int max_file_size, const char *section, int len; int index; int file_size; - + data = (char *) g_malloc(FILE_MAX_LINE_BYTES * 3, 0); text = data; name = text + FILE_MAX_LINE_BYTES; @@ -364,7 +364,7 @@ file_by_name_read_sections(const char *file_name, struct list *names) fd = g_file_open(file_name); - if (fd < 1) + if (fd < 0) { return 1; } @@ -405,7 +405,7 @@ file_by_name_read_section(const char *file_name, const char *section, fd = g_file_open(file_name); - if (fd < 1) + if (fd < 0) { return 1; } diff --git a/common/log.c b/common/log.c index 54dfaa29..d7594d67 100644 --- a/common/log.c +++ b/common/log.c @@ -284,6 +284,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName) if (ret != LOG_STARTUP_OK) { + g_file_close(fd); return ret; } @@ -301,6 +302,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName) if (ret != LOG_STARTUP_OK) { + g_file_close(fd); return ret; } diff --git a/common/os_calls.c b/common/os_calls.c index 1d3a71b1..68a6a5b0 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -471,8 +471,11 @@ g_tcp_socket(void) { option_value = 0; option_len = sizeof(option_value); - setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value, - option_len); + if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } #endif @@ -484,8 +487,11 @@ g_tcp_socket(void) { option_value = 1; option_len = sizeof(option_value); - setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, - option_len); + if (setsockopt(rv, SOL_SOCKET, SO_REUSEADDR, (char *)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } @@ -498,8 +504,11 @@ g_tcp_socket(void) { option_value = 1024 * 32; option_len = sizeof(option_value); - setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, - option_len); + if (setsockopt(rv, SOL_SOCKET, SO_SNDBUF, (char *)&option_value, + option_len) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_socket: setsockopt() failed\n"); + } } } @@ -785,7 +794,10 @@ g_tcp_set_non_blocking(int sck) #else i = fcntl(sck, F_GETFL); i = i | O_NONBLOCK; - fcntl(sck, F_SETFL, i); + if (fcntl(sck, F_SETFL, i) < 0) + { + log_message(LOG_LEVEL_ERROR, "g_tcp_set_non_blocking: fcntl() failed\n"); + } #endif return 0; } @@ -1421,7 +1433,12 @@ g_set_wait_obj(tbus obj) return 1; } - sendto(s, "sig", 4, 0, (struct sockaddr *)&sa, sa_size); + if (sendto(s, "sig", 4, 0, (struct sockaddr *)&sa, sa_size) < 0) + { + close(s); + return 1; + } + close(s); return 0; #endif @@ -1934,8 +1951,7 @@ g_mkdir(const char *dirname) #if defined(_WIN32) return 0; #else - mkdir(dirname, S_IRWXU); - return 0; + return mkdir(dirname, S_IRWXU); #endif } diff --git a/common/xrdp_client_info.h b/common/xrdp_client_info.h index 954595d8..59915f37 100644 --- a/common/xrdp_client_info.h +++ b/common/xrdp_client_info.h @@ -122,6 +122,8 @@ struct xrdp_client_info int mcs_early_capability_flags; int max_fastpath_frag_bytes; + int capture_code; + int capture_format; char certificate[1024]; char key_file[1024]; |