summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am3
-rwxr-xr-xbootstrap6
-rw-r--r--common/Makefile.am2
-rw-r--r--common/arch.h2
-rw-r--r--common/file.c4
-rw-r--r--common/log.c9
-rw-r--r--common/os_calls.c394
-rw-r--r--common/os_calls.h59
-rw-r--r--common/ssl_calls.c2
-rw-r--r--common/trans.c129
-rw-r--r--configure.ac35
-rw-r--r--design.txt2
-rw-r--r--docs/man/xrdp-keygen.84
-rw-r--r--[-rwxr-xr-x]fontdump/Makefile0
-rw-r--r--[-rwxr-xr-x]fontdump/fontdump.c0
-rw-r--r--genkeymap/Makefile.am7
-rw-r--r--install.txt6
-rw-r--r--instfiles/Makefile.am14
-rw-r--r--instfiles/init.d/xrdp4
-rw-r--r--instfiles/km-0411.ini32
-rw-r--r--instfiles/km-100c.ini659
-rw-r--r--instfiles/km-e0010411.ini32
-rw-r--r--instfiles/km-e0200411.ini32
-rw-r--r--instfiles/km-e0210411.ini32
-rw-r--r--instfiles/rc.d/xrdp23
-rw-r--r--instfiles/xrdp-sesman.service3
-rw-r--r--instfiles/xrdp.service5
-rw-r--r--keygen/Makefile.am6
-rw-r--r--libxrdp/Makefile.am11
-rw-r--r--libxrdp/libxrdp.c4
-rw-r--r--libxrdp/libxrdp.h2
-rw-r--r--libxrdp/xrdp_channel.c2
-rw-r--r--libxrdp/xrdp_jpeg_compress.c2
-rw-r--r--libxrdp/xrdp_mcs.c2
-rw-r--r--libxrdp/xrdp_orders.c4
-rw-r--r--libxrdp/xrdp_orders_rail.c6
-rw-r--r--m4/.gitignore1
-rw-r--r--mc/Makefile.am6
-rw-r--r--mc/mc.h2
-rw-r--r--neutrinordp/Makefile.am6
-rw-r--r--neutrinordp/xrdp-neutrinordp.h2
-rw-r--r--prog_std.txt2
-rw-r--r--rdp/Makefile.am6
-rw-r--r--rdp/rdp.h2
-rw-r--r--rdp/rdp_mcs.c2
-rw-r--r--rdp/rdp_orders.c2
-rw-r--r--rdp/rdp_tcp.c2
-rw-r--r--readme.txt12
-rw-r--r--sesman/Makefile.am12
-rw-r--r--sesman/access.c2
-rw-r--r--sesman/chansrv/Makefile.am12
-rw-r--r--sesman/chansrv/chansrv_fuse.c19
-rw-r--r--sesman/chansrv/clipboard.c8
-rw-r--r--sesman/chansrv/clipboard_file.c3
-rw-r--r--sesman/chansrv/pulse/module-xrdp-sink.c2
-rw-r--r--sesman/chansrv/pulse/module-xrdp-source.c2
-rw-r--r--sesman/chansrv/rail.c2
-rw-r--r--sesman/env.c30
-rw-r--r--sesman/libscp/Makefile.am6
-rw-r--r--sesman/libscp/libscp_lock.c2
-rw-r--r--sesman/libscp/libscp_lock.h4
-rw-r--r--sesman/libscp/libscp_v1s.c7
-rw-r--r--sesman/lock.c121
-rw-r--r--sesman/lock.h104
-rw-r--r--sesman/scp.c10
-rw-r--r--sesman/scp_v0.c14
-rw-r--r--sesman/scp_v1.c2
-rw-r--r--sesman/sesman.c32
-rw-r--r--sesman/sesman.h3
-rw-r--r--sesman/session.c241
-rw-r--r--sesman/session.h9
-rw-r--r--sesman/sessvc/Makefile.am6
-rw-r--r--sesman/sessvc/sessvc.c2
-rw-r--r--sesman/thread.c173
-rw-r--r--sesman/thread.h56
-rw-r--r--sesman/tools/Makefile.am14
-rw-r--r--sesman/tools/config.c1
-rw-r--r--sesman/tools/sesadmin.c13
-rw-r--r--sesman/tools/sestest.c13
-rw-r--r--sesman/tools/xcon.c1
-rw-r--r--tcutils/README.txt2
-rw-r--r--tests/gtcp_proxy/gtcp-proxy.c4
-rw-r--r--tests/tcp_proxy/main.c4
-rw-r--r--vnc/Makefile.am6
-rw-r--r--vnc/vnc.c29
-rw-r--r--vnc/vnc.h2
-rw-r--r--xorg/X11R7.6/rdp/rdp.h4
-rw-r--r--xorg/X11R7.6/rdp/rdpPolyFillRect.c8
-rw-r--r--xorg/X11R7.6/rdp/rdpinput.c2
-rw-r--r--xorg/X11R7.6/rdp/rdpmain.c2
-rw-r--r--xorg/X11R7.6/rdp/rdpup.c10
-rw-r--r--xorg/X11R7.6/x11_file_list.txt2
-rw-r--r--xorg/tests/randr/trandr.c2
-rw-r--r--xorg/tests/xdemo/yosemite.bmpbin1843254 -> 1843254 bytes
m---------xorgxrdp0
-rw-r--r--xrdp/Makefile.am11
-rw-r--r--[-rwxr-xr-x]xrdp/ad256.bmpbin19766 -> 19766 bytes
-rw-r--r--xrdp/lang.c2
-rw-r--r--xrdp/rdp-scan-codes.txt2
-rw-r--r--[-rwxr-xr-x]xrdp/sans-10.fv1bin658956 -> 658956 bytes
-rw-r--r--xrdp/xrdp.c66
-rw-r--r--xrdp/xrdp.h6
-rw-r--r--[-rwxr-xr-x]xrdp/xrdp256.bmpbin49278 -> 49278 bytes
-rw-r--r--xrdp/xrdp_bitmap.c2
-rw-r--r--xrdp/xrdp_mm.c27
-rw-r--r--xrdp/xrdp_types.h4
-rw-r--r--xrdp/xrdp_wm.c9
-rw-r--r--xrdp/xrdpwin.c8
-rw-r--r--xrdpapi/Makefile.am6
-rw-r--r--xrdpapi/xrdpapi.c15
-rw-r--r--xrdpvr/Makefile.am6
-rw-r--r--xup/Makefile.am6
-rw-r--r--xup/xup.c18
-rw-r--r--xup/xup.h4
115 files changed, 1454 insertions, 1326 deletions
diff --git a/.gitignore b/.gitignore
index 7b45b684..0437bf57 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,6 @@ autom4te.cache/
ChangeLog
config_ac.h
config_ac-h.in
-config.c
config.guess
config.log
config.status
diff --git a/Makefile.am b/Makefile.am
index e8905c98..8e6e18b8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,6 @@
+ACLOCAL_AMFLAGS = -I m4
+AM_DISTCHECK_CONFIGURE_FLAGS = --without-systemdsystemunitdir
+
EXTRA_DIST = bootstrap COPYING design.txt faq-compile.txt faq-general.txt file-loc.txt install.txt prog_std.txt readme.txt
if XRDP_NEUTRINORDP
diff --git a/bootstrap b/bootstrap
index 1fae2a0e..be61972e 100755
--- a/bootstrap
+++ b/bootstrap
@@ -28,10 +28,4 @@ then
exit 1
fi
-touch configure.ac
-touch NEWS
-touch AUTHORS
-touch README
-touch ChangeLog
-ln -s ../config.c $PWD/sesman/tools/config.c
autoreconf -fvi
diff --git a/common/Makefile.am b/common/Makefile.am
index 8224c52d..c8501586 100644
--- a/common/Makefile.am
+++ b/common/Makefile.am
@@ -19,7 +19,7 @@ EXTRA_DIST = \
xrdp_rail.h \
crc16.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
diff --git a/common/arch.h b/common/arch.h
index 14ab9d7d..d3ae460e 100644
--- a/common/arch.h
+++ b/common/arch.h
@@ -22,7 +22,7 @@
/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
in the makefile to override */
-/* check endianess */
+/* check endianness */
#if !(defined(L_ENDIAN) || defined(B_ENDIAN))
#if !defined(__BYTE_ORDER) && defined(__linux__)
#include <endian.h>
diff --git a/common/file.c b/common/file.c
index a14f9ff6..09a8d57f 100644
--- a/common/file.c
+++ b/common/file.c
@@ -319,7 +319,7 @@ file_read_sections(int fd, struct list *names)
/*****************************************************************************/
/* return error */
-/* this function should be prefered over file_read_sections because it can
+/* this function should be preferred over file_read_sections because it can
read any file size */
int APP_CC
file_by_name_read_sections(const char *file_name, struct list *names)
@@ -359,7 +359,7 @@ file_read_section(int fd, const char *section,
/*****************************************************************************/
/* return error */
-/* this function should be prefered over file_read_section because it can
+/* this function should be preferred over file_read_section because it can
read any file size */
int APP_CC
file_by_name_read_section(const char *file_name, const char *section,
diff --git a/common/log.c b/common/log.c
index 97053178..b3ae9c22 100644
--- a/common/log.c
+++ b/common/log.c
@@ -59,6 +59,13 @@ internal_log_file_open(const char *fname)
S_IRUSR | S_IWUSR);
}
+#ifdef FD_CLOEXEC
+ if (ret != -1)
+ {
+ fcntl(ret, F_SETFD, FD_CLOEXEC);
+ }
+#endif
+
return ret;
}
@@ -186,7 +193,7 @@ internal_log_end(struct log_config *l_cfg)
/* closing log file */
log_message(LOG_LEVEL_ALWAYS, "shutting down log subsystem...");
- if (0 > l_cfg->fd)
+ if (-1 != l_cfg->fd)
{
/* closing logfile... */
g_file_close(l_cfg->fd);
diff --git a/common/os_calls.c b/common/os_calls.c
index de879fa5..0034cb5b 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -100,23 +100,10 @@ extern char **environ;
#define INADDR_NONE ((unsigned long)-1)
#endif
-static char g_temp_base[128] = "";
-static char g_temp_base_org[128] = "";
-
/*****************************************************************************/
int APP_CC
g_rm_temp_dir(void)
{
- if (g_temp_base[0] != 0)
- {
- if (!g_remove_dir(g_temp_base))
- {
- printf("g_rm_temp_dir: removing temp directory [%s] failed\n", g_temp_base);
- }
-
- g_temp_base[0] = 0;
- }
-
return 0;
}
@@ -124,58 +111,19 @@ g_rm_temp_dir(void)
int APP_CC
g_mk_temp_dir(const char *app_name)
{
- if (app_name != 0)
+ if (!g_directory_exist("/tmp/.xrdp"))
{
- if (app_name[0] != 0)
+ if (!g_create_dir("/tmp/.xrdp"))
{
+ /* if failed, still check if it got created by someone else */
if (!g_directory_exist("/tmp/.xrdp"))
{
- if (!g_create_dir("/tmp/.xrdp"))
- {
- /* if failed, still check if it got created by someone else */
- if (!g_directory_exist("/tmp/.xrdp"))
- {
- printf("g_mk_temp_dir: g_create_dir failed\n");
- return 1;
- }
- }
-
- g_chmod_hex("/tmp/.xrdp", 0x1777);
- }
-
- snprintf(g_temp_base, sizeof(g_temp_base),
- "/tmp/.xrdp/%s-XXXXXX", app_name);
- snprintf(g_temp_base_org, sizeof(g_temp_base_org),
- "/tmp/.xrdp/%s-XXXXXX", app_name);
-
- if (mkdtemp(g_temp_base) == 0)
- {
- printf("g_mk_temp_dir: mkdtemp failed [%s]\n", g_temp_base);
+ printf("g_mk_temp_dir: g_create_dir failed\n");
return 1;
}
}
- else
- {
- printf("g_mk_temp_dir: bad app name\n");
- return 1;
- }
+ g_chmod_hex("/tmp/.xrdp", 0x1777);
}
- else
- {
- if (g_temp_base_org[0] == 0)
- {
- printf("g_mk_temp_dir: g_temp_base_org not set\n");
- return 1;
- }
-
- g_strncpy(g_temp_base, g_temp_base_org, 127);
-
- if (mkdtemp(g_temp_base) == 0)
- {
- printf("g_mk_temp_dir: mkdtemp failed [%s]\n", g_temp_base);
- }
- }
-
return 0;
}
@@ -463,7 +411,7 @@ g_tcp_socket(void)
unsigned int option_len;
#endif
-#if defined(XRDP_ENABLE_IPV6) && !defined(NO_ARPA_INET_H_IP6)
+#if defined(XRDP_ENABLE_IPV6)
rv = (int)socket(AF_INET6, SOCK_STREAM, 0);
#else
rv = (int)socket(AF_INET, SOCK_STREAM, 0);
@@ -472,14 +420,18 @@ g_tcp_socket(void)
{
return -1;
}
-#if defined(XRDP_ENABLE_IPV6) && !defined(NO_ARPA_INET_H_IP6)
+#if defined(XRDP_ENABLE_IPV6)
option_len = sizeof(option_value);
if (getsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value,
&option_len) == 0)
{
if (option_value != 0)
{
+#if defined(XRDP_ENABLE_IPV6ONLY)
+ option_value = 1;
+#else
option_value = 0;
+#endif
option_len = sizeof(option_value);
if (setsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value,
option_len) < 0)
@@ -617,7 +569,7 @@ g_sck_get_recv_buffer_bytes(int sck, int *bytes)
/*****************************************************************************/
int APP_CC
-g_tcp_local_socket(void)
+g_sck_local_socket(void)
{
#if defined(_WIN32)
return 0;
@@ -691,7 +643,7 @@ g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid)
/*****************************************************************************/
void APP_CC
-g_tcp_close(int sck)
+g_sck_close(int sck)
{
char ip[256];
@@ -711,7 +663,7 @@ g_tcp_close(int sck)
/*****************************************************************************/
/* returns error, zero is good */
-#if defined(XRDP_ENABLE_IPV6) && !defined(NO_ARPA_INET_H_IP6)
+#if defined(XRDP_ENABLE_IPV6)
int APP_CC
g_tcp_connect(int sck, const char *address, const char *port)
{
@@ -794,7 +746,7 @@ g_tcp_connect(int sck, const char* address, const char* port)
/*****************************************************************************/
/* returns error, zero is good */
int APP_CC
-g_tcp_local_connect(int sck, const char *port)
+g_sck_local_connect(int sck, const char *port)
{
#if defined(_WIN32)
return -1;
@@ -812,7 +764,7 @@ g_tcp_local_connect(int sck, const char *port)
/*****************************************************************************/
int APP_CC
-g_tcp_set_non_blocking(int sck)
+g_sck_set_non_blocking(int sck)
{
unsigned long i;
@@ -824,7 +776,7 @@ g_tcp_set_non_blocking(int sck)
i = i | O_NONBLOCK;
if (fcntl(sck, F_SETFL, i) < 0)
{
- log_message(LOG_LEVEL_ERROR, "g_tcp_set_non_blocking: fcntl() failed\n");
+ log_message(LOG_LEVEL_ERROR, "g_sck_set_non_blocking: fcntl() failed\n");
}
#endif
return 0;
@@ -956,7 +908,7 @@ g_tcp_bind(int sck, const char* port)
/*****************************************************************************/
int APP_CC
-g_tcp_local_bind(int sck, const char *port)
+g_sck_local_bind(int sck, const char *port)
{
#if defined(_WIN32)
return -1;
@@ -1004,7 +956,7 @@ g_tcp_bind_address(int sck, const char* port, const char* address)
/*****************************************************************************/
/* returns error, zero is good */
int APP_CC
-g_tcp_listen(int sck)
+g_sck_listen(int sck)
{
return listen(sck, 2);
}
@@ -1120,7 +1072,7 @@ g_sleep(int msecs)
/*****************************************************************************/
int APP_CC
-g_tcp_last_error_would_block(int sck)
+g_sck_last_error_would_block(int sck)
{
#if defined(_WIN32)
return WSAGetLastError() == WSAEWOULDBLOCK;
@@ -1131,7 +1083,7 @@ g_tcp_last_error_would_block(int sck)
/*****************************************************************************/
int APP_CC
-g_tcp_recv(int sck, void *ptr, int len, int flags)
+g_sck_recv(int sck, void *ptr, int len, int flags)
{
#if defined(_WIN32)
return recv(sck, (char *)ptr, len, flags);
@@ -1142,7 +1094,7 @@ g_tcp_recv(int sck, void *ptr, int len, int flags)
/*****************************************************************************/
int APP_CC
-g_tcp_send(int sck, const void *ptr, int len, int flags)
+g_sck_send(int sck, const void *ptr, int len, int flags)
{
#if defined(_WIN32)
return send(sck, (const char *)ptr, len, flags);
@@ -1154,7 +1106,7 @@ g_tcp_send(int sck, const void *ptr, int len, int flags)
/*****************************************************************************/
/* returns boolean */
int APP_CC
-g_tcp_socket_ok(int sck)
+g_sck_socket_ok(int sck)
{
#if defined(_WIN32)
int opt;
@@ -1181,7 +1133,7 @@ g_tcp_socket_ok(int sck)
/* wait 'millis' milliseconds for the socket to be able to write */
/* returns boolean */
int APP_CC
-g_tcp_can_send(int sck, int millis)
+g_sck_can_send(int sck, int millis)
{
fd_set wfds;
struct timeval time;
@@ -1198,7 +1150,7 @@ g_tcp_can_send(int sck, int millis)
if (rv > 0)
{
- return g_tcp_socket_ok(sck);
+ return 1;
}
}
@@ -1209,12 +1161,13 @@ g_tcp_can_send(int sck, int millis)
/* wait 'millis' milliseconds for the socket to be able to receive */
/* returns boolean */
int APP_CC
-g_tcp_can_recv(int sck, int millis)
+g_sck_can_recv(int sck, int millis)
{
fd_set rfds;
struct timeval time;
int rv;
+ g_memset(&time, 0, sizeof(time));
time.tv_sec = millis / 1000;
time.tv_usec = (millis * 1000) % 1000000;
FD_ZERO(&rfds);
@@ -1226,7 +1179,7 @@ g_tcp_can_recv(int sck, int millis)
if (rv > 0)
{
- return g_tcp_socket_ok(sck);
+ return 1;
}
}
@@ -1235,18 +1188,14 @@ g_tcp_can_recv(int sck, int millis)
/*****************************************************************************/
int APP_CC
-g_tcp_select(int sck1, int sck2)
+g_sck_select(int sck1, int sck2)
{
fd_set rfds;
struct timeval time;
- int max = 0;
- int rv = 0;
+ int max;
+ int rv;
- g_memset(&rfds, 0, sizeof(fd_set));
g_memset(&time, 0, sizeof(struct timeval));
-
- time.tv_sec = 0;
- time.tv_usec = 0;
FD_ZERO(&rfds);
if (sck1 > 0)
@@ -1291,93 +1240,91 @@ g_tcp_select(int sck1, int sck2)
}
/*****************************************************************************/
-/* returns 0 on error */
-tbus APP_CC
-g_create_wait_obj(char *name)
+/* returns boolean */
+static int APP_CC
+g_fd_can_read(int fd)
{
-#ifdef _WIN32
- tbus obj;
-
- obj = (tbus)CreateEvent(0, 1, 0, name);
- return obj;
-#else
- tbus obj;
- struct sockaddr_un sa;
- size_t len;
- tbus sck;
- int i;
- int safety;
- int unnamed;
+ fd_set rfds;
+ struct timeval time;
+ int rv;
- if (g_temp_base[0] == 0)
+ g_memset(&time, 0, sizeof(time));
+ FD_ZERO(&rfds);
+ FD_SET(((unsigned int)fd), &rfds);
+ rv = select(fd + 1, &rfds, 0, 0, &time);
+ if (rv == 1)
{
- return 0;
+ return 1;
}
+ return 0;
+}
- sck = socket(PF_UNIX, SOCK_DGRAM, 0);
+/*****************************************************************************/
+/* returns error */
+/* O_NONBLOCK = 0x00000800 */
+static int APP_CC
+g_set_nonblock(int fd)
+{
+ int error;
+ int flags;
- if (sck < 0)
+ error = fcntl(fd, F_GETFL);
+ if (error < 0)
{
- return 0;
+ return 1;
}
-
- safety = 0;
- g_memset(&sa, 0, sizeof(sa));
- sa.sun_family = AF_UNIX;
- unnamed = 1;
-
- if (name != 0)
+ flags = error;
+ if ((flags & O_NONBLOCK) != O_NONBLOCK)
{
- if (name[0] != 0)
+ flags |= O_NONBLOCK;
+ error = fcntl(fd, F_SETFL, flags);
+ if (error < 0)
{
- unnamed = 0;
+ return 1;
}
}
+ return 0;
+}
- if (unnamed)
- {
- do
- {
- if (safety > 100)
- {
- break;
- }
+/*****************************************************************************/
+/* returns 0 on error */
+tintptr APP_CC
+g_create_wait_obj(char *name)
+{
+#ifdef _WIN32
+ tintptr obj;
- safety++;
- g_random((char *)&i, sizeof(i));
- len = sizeof(sa.sun_path);
- g_snprintf(sa.sun_path, len, "%s/auto_%8.8x", g_temp_base, i);
- len = sizeof(sa);
- }
- while (bind(sck, (struct sockaddr *)&sa, len) < 0);
+ obj = (tintptr)CreateEvent(0, 1, 0, name);
+ return obj;
+#else
+ int fds[2];
+ int error;
+
+ error = pipe(fds);
+ if (error != 0)
+ {
+ return 0;
}
- else
+ if (g_set_nonblock(fds[0]) != 0)
{
- do
- {
- if (safety > 100)
- {
- break;
- }
-
- safety++;
- g_random((char *)&i, sizeof(i));
- len = sizeof(sa.sun_path);
- g_snprintf(sa.sun_path, len, "%s/%s_%8.8x", g_temp_base, name, i);
- len = sizeof(sa);
- }
- while (bind(sck, (struct sockaddr *)&sa, len) < 0);
+ close(fds[0]);
+ close(fds[1]);
+ return 0;
}
-
- obj = (tbus)sck;
- return obj;
+ if (g_set_nonblock(fds[1]) != 0)
+ {
+ close(fds[0]);
+ close(fds[1]);
+ return 0;
+ }
+ return (fds[1] << 16) | fds[0];
#endif
}
/*****************************************************************************/
/* returns 0 on error */
-tbus APP_CC
-g_create_wait_obj_from_socket(tbus socket, int write)
+tintptr APP_CC
+g_create_wait_obj_from_socket(tintptr socket, int write)
{
#ifdef _WIN32
/* Create and return corresponding event handle for WaitForMultipleObjets */
@@ -1405,7 +1352,7 @@ g_create_wait_obj_from_socket(tbus socket, int write)
/*****************************************************************************/
void APP_CC
-g_delete_wait_obj_from_socket(tbus wait_obj)
+g_delete_wait_obj_from_socket(tintptr wait_obj)
{
#ifdef _WIN32
@@ -1422,54 +1369,60 @@ g_delete_wait_obj_from_socket(tbus wait_obj)
/*****************************************************************************/
/* returns error */
int APP_CC
-g_set_wait_obj(tbus obj)
+g_set_wait_obj(tintptr obj)
{
#ifdef _WIN32
-
if (obj == 0)
{
return 0;
}
-
SetEvent((HANDLE)obj);
return 0;
#else
- socklen_t sa_size;
- int s;
- struct sockaddr_un sa;
+ int error;
+ int fd;
+ int written;
+ int to_write;
+ char buf[4] = "sig";
if (obj == 0)
{
return 0;
}
-
- if (g_tcp_can_recv((int)obj, 0))
+ fd = obj & 0xffff;
+ if (g_fd_can_read(fd))
{
/* already signalled */
return 0;
}
-
- sa_size = sizeof(sa);
-
- if (getsockname((int)obj, (struct sockaddr *)&sa, &sa_size) < 0)
+ fd = obj >> 16;
+ to_write = 4;
+ written = 0;
+ while (written < to_write)
{
- return 1;
- }
-
- s = socket(PF_UNIX, SOCK_DGRAM, 0);
-
- if (s < 0)
- {
- return 1;
- }
-
- if (sendto(s, "sig", 4, 0, (struct sockaddr *)&sa, sa_size) < 0)
- {
- close(s);
- return 1;
+ error = write(fd, buf + written, to_write - written);
+ if (error == -1)
+ {
+ error = errno;
+ if ((error == EAGAIN) || (error == EWOULDBLOCK) ||
+ (error == EINPROGRESS) || (error == EINTR))
+ {
+ /* ok */
+ }
+ else
+ {
+ return 1;
+ }
+ }
+ else if (error > 0)
+ {
+ written += error;
+ }
+ else
+ {
+ return 1;
+ }
}
-
- close(s);
return 0;
#endif
}
@@ -1477,30 +1430,46 @@ g_set_wait_obj(tbus obj)
/*****************************************************************************/
/* returns error */
int APP_CC
-g_reset_wait_obj(tbus obj)
+g_reset_wait_obj(tintptr obj)
{
#ifdef _WIN32
-
if (obj == 0)
{
return 0;
}
-
ResetEvent((HANDLE)obj);
return 0;
#else
- char buf[64];
+ char buf[4];
+ int error;
+ int fd;
if (obj == 0)
{
return 0;
}
-
- while (g_tcp_can_recv((int)obj, 0))
+ fd = obj & 0xffff;
+ while (g_fd_can_read(fd))
{
- recvfrom((int)obj, &buf, 64, 0, 0, 0);
+ error = read(fd, buf, 4);
+ if (error == -1)
+ {
+ error = errno;
+ if ((error == EAGAIN) || (error == EWOULDBLOCK) ||
+ (error == EINPROGRESS) || (error == EINTR))
+ {
+ /* ok */
+ }
+ else
+ {
+ return 1;
+ }
+ }
+ else if (error == 0)
+ {
+ return 1;
+ }
}
-
return 0;
#endif
}
@@ -1508,86 +1477,55 @@ g_reset_wait_obj(tbus obj)
/*****************************************************************************/
/* returns boolean */
int APP_CC
-g_is_wait_obj_set(tbus obj)
+g_is_wait_obj_set(tintptr obj)
{
#ifdef _WIN32
-
if (obj == 0)
{
return 0;
}
-
if (WaitForSingleObject((HANDLE)obj, 0) == WAIT_OBJECT_0)
{
return 1;
}
-
return 0;
#else
-
if (obj == 0)
{
return 0;
}
-
- return g_tcp_can_recv((int)obj, 0);
+ return g_fd_can_read(obj & 0xffff);
#endif
}
/*****************************************************************************/
/* returns error */
int APP_CC
-g_delete_wait_obj(tbus obj)
+g_delete_wait_obj(tintptr obj)
{
#ifdef _WIN32
-
if (obj == 0)
{
return 0;
}
-
/* Close event handle */
CloseHandle((HANDLE)obj);
return 0;
#else
- socklen_t sa_size;
- struct sockaddr_un sa;
-
if (obj == 0)
{
return 0;
}
-
- sa_size = sizeof(sa);
-
- if (getsockname((int)obj, (struct sockaddr *)&sa, &sa_size) < 0)
- {
- return 1;
- }
-
- close((int)obj);
- unlink(sa.sun_path);
+ close(obj & 0xffff);
+ close(obj >> 16);
return 0;
#endif
}
/*****************************************************************************/
/* returns error */
-/* close but do not delete the wait obj, used after fork */
-int APP_CC
-g_close_wait_obj(tbus obj)
-{
-#ifdef _WIN32
-#else
- close((int)obj);
-#endif
- return 0;
-}
-
-/*****************************************************************************/
-/* returns error */
int APP_CC
-g_obj_wait(tbus *read_objs, int rcount, tbus *write_objs, int wcount,
+g_obj_wait(tintptr *read_objs, int rcount, tintptr *write_objs, int wcount,
int mstimeout)
{
#ifdef _WIN32
@@ -1627,24 +1565,20 @@ g_obj_wait(tbus *read_objs, int rcount, tbus *write_objs, int wcount,
fd_set rfds;
fd_set wfds;
struct timeval time;
- struct timeval *ptime = (struct timeval *)NULL;
+ struct timeval *ptime;
int i = 0;
int res = 0;
int max = 0;
int sck = 0;
- g_memset(&rfds, 0, sizeof(fd_set));
- g_memset(&wfds, 0, sizeof(fd_set));
- g_memset(&time, 0, sizeof(struct timeval));
-
max = 0;
-
if (mstimeout < 1)
{
- ptime = (struct timeval *)NULL;
+ ptime = 0;
}
else
{
+ g_memset(&time, 0, sizeof(struct timeval));
time.tv_sec = mstimeout / 1000;
time.tv_usec = (mstimeout % 1000) * 1000;
ptime = &time;
@@ -1658,7 +1592,7 @@ g_obj_wait(tbus *read_objs, int rcount, tbus *write_objs, int wcount,
{
for (i = 0; i < rcount; i++)
{
- sck = (int)(read_objs[i]);
+ sck = read_objs[i] & 0xffff;
if (sck > 0)
{
@@ -1869,7 +1803,7 @@ g_file_read(int fd, char *ptr, int len)
}
/*****************************************************************************/
-/* write to file, returns the number of bytes writen or -1 on error */
+/* write to file, returns the number of bytes written or -1 on error */
int APP_CC
g_file_write(int fd, char *ptr, int len)
{
diff --git a/common/os_calls.h b/common/os_calls.h
index 0682195a..acfbe475 100644
--- a/common/os_calls.h
+++ b/common/os_calls.h
@@ -27,6 +27,20 @@
#include "arch.h"
+#define g_tcp_can_recv g_sck_can_recv
+#define g_tcp_can_send g_sck_can_send
+#define g_tcp_recv g_sck_recv
+#define g_tcp_send g_sck_send
+#define g_tcp_close g_sck_close
+#define g_tcp_last_error_would_block g_sck_last_error_would_block
+#define g_tcp_set_non_blocking g_sck_set_non_blocking
+#define g_tcp_local_socket g_sck_local_socket
+#define g_tcp_local_connect g_sck_local_connect
+#define g_tcp_listen g_sck_listen
+#define g_tcp_local_bind g_sck_local_bind
+#define g_tcp_select g_sck_select
+#define g_close_wait_obj g_delete_wait_obj
+
int APP_CC g_rm_temp_dir(void);
int APP_CC g_mk_temp_dir(const char* app_name);
void APP_CC g_init(const char* app_name);
@@ -49,39 +63,36 @@ int APP_CC g_sck_set_send_buffer_bytes(int sck, int bytes);
int APP_CC g_sck_get_send_buffer_bytes(int sck, int *bytes);
int APP_CC g_sck_set_recv_buffer_bytes(int sck, int bytes);
int APP_CC g_sck_get_recv_buffer_bytes(int sck, int *bytes);
-int APP_CC g_tcp_local_socket(void);
+int APP_CC g_sck_local_socket(void);
int APP_CC g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid);
-void APP_CC g_tcp_close(int sck);
+void APP_CC g_sck_close(int sck);
int APP_CC g_tcp_connect(int sck, const char* address, const char* port);
-int APP_CC g_tcp_local_connect(int sck, const char* port);
-int APP_CC g_tcp_force_send(int sck, char* data, int len);
-int APP_CC g_tcp_force_recv(int sck, char* data, int len);
-int APP_CC g_tcp_set_non_blocking(int sck);
+int APP_CC g_sck_local_connect(int sck, const char* port);
+int APP_CC g_sck_set_non_blocking(int sck);
int APP_CC g_tcp_bind(int sck, const char *port);
-int APP_CC g_tcp_local_bind(int sck, const char* port);
+int APP_CC g_sck_local_bind(int sck, const char* port);
int APP_CC g_tcp_bind_address(int sck, const char* port, const char* address);
-int APP_CC g_tcp_listen(int sck);
+int APP_CC g_sck_listen(int sck);
int APP_CC g_tcp_accept(int sck);
int APP_CC g_sck_accept(int sck, char *addr, int addr_bytes,
char *port, int port_bytes);
-int APP_CC g_tcp_recv(int sck, void* ptr, int len, int flags);
-int APP_CC g_tcp_send(int sck, const void* ptr, int len, int flags);
-int APP_CC g_tcp_last_error_would_block(int sck);
-int APP_CC g_tcp_socket_ok(int sck);
-int APP_CC g_tcp_can_send(int sck, int millis);
-int APP_CC g_tcp_can_recv(int sck, int millis);
-int APP_CC g_tcp_select(int sck1, int sck2);
+int APP_CC g_sck_recv(int sck, void* ptr, int len, int flags);
+int APP_CC g_sck_send(int sck, const void* ptr, int len, int flags);
+int APP_CC g_sck_last_error_would_block(int sck);
+int APP_CC g_sck_socket_ok(int sck);
+int APP_CC g_sck_can_send(int sck, int millis);
+int APP_CC g_sck_can_recv(int sck, int millis);
+int APP_CC g_sck_select(int sck1, int sck2);
void APP_CC g_write_ip_address(int rcv_sck, char* ip_address, int bytes);
void APP_CC g_sleep(int msecs);
-tbus APP_CC g_create_wait_obj(char* name);
-tbus APP_CC g_create_wait_obj_from_socket(tbus socket, int write);
-void APP_CC g_delete_wait_obj_from_socket(tbus wait_obj);
-int APP_CC g_set_wait_obj(tbus obj);
-int APP_CC g_reset_wait_obj(tbus obj);
-int APP_CC g_is_wait_obj_set(tbus obj);
-int APP_CC g_delete_wait_obj(tbus obj);
-int APP_CC g_close_wait_obj(tbus obj);
-int APP_CC g_obj_wait(tbus* read_objs, int rcount, tbus* write_objs,
+tintptr APP_CC g_create_wait_obj(char* name);
+tintptr APP_CC g_create_wait_obj_from_socket(tintptr socket, int write);
+void APP_CC g_delete_wait_obj_from_socket(tintptr wait_obj);
+int APP_CC g_set_wait_obj(tintptr obj);
+int APP_CC g_reset_wait_obj(tintptr obj);
+int APP_CC g_is_wait_obj_set(tintptr obj);
+int APP_CC g_delete_wait_obj(tintptr obj);
+int APP_CC g_obj_wait(tintptr* read_objs, int rcount, tintptr* write_objs,
int wcount,int mstimeout);
void APP_CC g_random(char* data, int len);
int APP_CC g_abs(int i);
diff --git a/common/ssl_calls.c b/common/ssl_calls.c
index 7bc33fcb..43002a40 100644
--- a/common/ssl_calls.c
+++ b/common/ssl_calls.c
@@ -841,6 +841,6 @@ ssl_tls_can_recv(struct ssl_tls *tls, int sck, int millis)
return 1;
}
g_reset_wait_obj(tls->rwo);
- return g_tcp_can_recv(sck, millis);
+ return g_sck_can_recv(sck, millis);
}
diff --git a/common/trans.c b/common/trans.c
index 973bafaa..2c44f28c 100644
--- a/common/trans.c
+++ b/common/trans.c
@@ -77,7 +77,7 @@ trans_tcp_send(struct trans *self, const void *data, int len)
int APP_CC
trans_tcp_can_recv(struct trans *self, int sck, int millis)
{
- return g_tcp_can_recv(sck, millis);
+ return g_sck_can_recv(sck, millis);
}
/*****************************************************************************/
@@ -249,6 +249,18 @@ trans_send_waiting(struct trans *self, int block)
}
}
}
+ else if (block)
+ {
+ /* check for term here */
+ if (self->is_term != 0)
+ {
+ if (self->is_term())
+ {
+ /* term */
+ return 1;
+ }
+ }
+ }
}
else
{
@@ -285,7 +297,7 @@ trans_check_wait_objs(struct trans *self)
if (self->type1 == TRANS_TYPE_LISTENER) /* listening */
{
- if (g_tcp_can_recv(self->sck, 0))
+ if (g_sck_can_recv(self->sck, 0))
{
in_sck = g_sck_accept(self->sck, self->addr, sizeof(self->addr),
self->port, sizeof(self->port));
@@ -412,6 +424,7 @@ trans_check_wait_objs(struct trans *self)
return rv;
}
+
/*****************************************************************************/
int APP_CC
trans_force_read_s(struct trans *self, struct stream *in_s, int size)
@@ -422,7 +435,6 @@ trans_force_read_s(struct trans *self, struct stream *in_s, int size)
{
return 1;
}
-
while (size > 0)
{
/* make sure stream has room */
@@ -430,47 +442,47 @@ trans_force_read_s(struct trans *self, struct stream *in_s, int size)
{
return 1;
}
-
- rcvd = self->trans_recv(self, in_s->end, size);
-
- if (rcvd == -1)
+ if (self->trans_can_recv(self, self->sck, 100))
{
- if (g_tcp_last_error_would_block(self->sck))
+ rcvd = self->trans_recv(self, in_s->end, size);
+ if (rcvd == -1)
{
- if (!g_tcp_can_recv(self->sck, 100))
+ if (g_tcp_last_error_would_block(self->sck))
{
- /* check for term here */
- if (self->is_term != 0)
- {
- if (self->is_term())
- {
- /* term */
- self->status = TRANS_STATUS_DOWN;
- return 1;
- }
- }
+ }
+ else
+ {
+ /* error */
+ self->status = TRANS_STATUS_DOWN;
+ return 1;
}
}
- else
+ else if (rcvd == 0)
{
/* error */
self->status = TRANS_STATUS_DOWN;
return 1;
}
- }
- else if (rcvd == 0)
- {
- /* error */
- self->status = TRANS_STATUS_DOWN;
- return 1;
+ else
+ {
+ in_s->end += rcvd;
+ size -= rcvd;
+ }
}
else
{
- in_s->end += rcvd;
- size -= rcvd;
+ /* check for term here */
+ if (self->is_term != 0)
+ {
+ if (self->is_term())
+ {
+ /* term */
+ self->status = TRANS_STATUS_DOWN;
+ return 1;
+ }
+ }
}
}
-
return 0;
}
@@ -493,57 +505,55 @@ trans_force_write_s(struct trans *self, struct stream *out_s)
{
return 1;
}
-
size = (int) (out_s->end - out_s->data);
total = 0;
-
if (trans_send_waiting(self, 1) != 0)
{
self->status = TRANS_STATUS_DOWN;
return 1;
}
-
while (total < size)
{
- sent = self->trans_send(self, out_s->data + total, size - total);
-
- if (sent == -1)
+ if (g_tcp_can_send(self->sck, 100))
{
- if (g_tcp_last_error_would_block(self->sck))
+ sent = self->trans_send(self, out_s->data + total, size - total);
+ if (sent == -1)
{
- if (!g_tcp_can_send(self->sck, 100))
+ if (g_tcp_last_error_would_block(self->sck))
{
- /* check for term here */
- if (self->is_term != 0)
- {
- if (self->is_term())
- {
- /* term */
- self->status = TRANS_STATUS_DOWN;
- return 1;
- }
- }
+ }
+ else
+ {
+ /* error */
+ self->status = TRANS_STATUS_DOWN;
+ return 1;
}
}
- else
+ else if (sent == 0)
{
/* error */
self->status = TRANS_STATUS_DOWN;
return 1;
}
- }
- else if (sent == 0)
- {
- /* error */
- self->status = TRANS_STATUS_DOWN;
- return 1;
+ else
+ {
+ total = total + sent;
+ }
}
else
{
- total = total + sent;
+ /* check for term here */
+ if (self->is_term != 0)
+ {
+ if (self->is_term())
+ {
+ /* term */
+ self->status = TRANS_STATUS_DOWN;
+ return 1;
+ }
+ }
}
}
-
return 0;
}
@@ -607,11 +617,12 @@ trans_write_copy_s(struct trans *self, struct stream *out_s)
return 0;
}
/* did not send right away, have to copy */
- make_stream(wait_s);
+ make_stream(wait_s);
init_stream(wait_s, size);
if (self->si != 0)
{
- if (self->si->cur_source != 0)
+ if ((self->si->cur_source != 0) &&
+ (self->si->cur_source != self->my_source))
{
self->si->source[self->si->cur_source] += size;
wait_s->source = self->si->source + self->si->cur_source;
@@ -872,6 +883,7 @@ trans_get_out_s(struct trans *self, int size)
return rv;
}
+
/*****************************************************************************/
/* returns error */
int APP_CC
@@ -897,6 +909,7 @@ trans_set_tls_mode(struct trans *self, const char *key, const char *cert)
return 0;
}
+
/*****************************************************************************/
/* returns error */
int APP_CC
diff --git a/configure.ac b/configure.ac
index bca4adfe..7535620d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,10 @@
# Process this file with autoconf to produce a configure script
AC_PREREQ(2.59)
-AC_INIT([xrdp], [0.9.0], [xrdp-devel@lists.sourceforge.net])
+AC_INIT([xrdp], [0.9.0], [xrdp-devel@googlegroups.com])
AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in)
AM_INIT_AUTOMAKE([1.6 foreign])
+AC_CONFIG_MACRO_DIRS([m4])
AC_PROG_CC
AC_C_CONST
AC_PROG_LIBTOOL
@@ -53,6 +54,9 @@ AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_pam != xyes])
AC_ARG_ENABLE(ipv6, AS_HELP_STRING([--enable-ipv6],
[Build IPv6 support (default: no, experimental)]),
[], [enable_ipv6=no])
+AC_ARG_ENABLE(ipv6only, AS_HELP_STRING([--enable-ipv6only],
+ [Build IPv6-only (default: no)]),
+ [], [enable_ipv6only=no])
AC_ARG_ENABLE(kerberos, AS_HELP_STRING([--enable-kerberos],
[Build kerberos support (default: no)]),
[], [enable_kerberos=no])
@@ -98,8 +102,6 @@ AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus],
[], [enable_opus=no])
AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes])
-AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"])
-
# checking for openssl
AC_CHECK_HEADER([openssl/rc4.h], [],
[AC_MSG_ERROR([please install libssl-dev or openssl-devel])],
@@ -127,16 +129,17 @@ then
fi
fi
+if test "x$enable_ipv6only" = "xyes"
+then
+ enable_ipv6=yes
+ AC_DEFINE([XRDP_ENABLE_IPV6ONLY],1,[Enable IPv6 only])
+fi
+
if test "x$enable_ipv6" = "xyes"
then
AC_DEFINE([XRDP_ENABLE_IPV6],1,[Enable IPv6])
fi
-AC_CHECK_MEMBER([struct in6_addr.s6_addr],
- [],
- [AC_DEFINE(NO_ARPA_INET_H_IP6, 1, [for IPv6])],
- [#include <arpa/inet.h>])
-
if test "x$enable_pam" != "xyes" || test "x$bsd" = "xtrue"
then
AC_DEFINE([USE_NOPAM],1,[Disable PAM])
@@ -200,16 +203,26 @@ else
fi
fi
-# checking for Xlib, Xfixes
-AC_CHECK_HEADER([X11/Xlib.h], [],
- [AC_MSG_ERROR([please install libx11-dev or libX11-devel])])
+AC_PATH_XTRA
+if test "x$no_x" == "xyes"; then
+ AC_MSG_ERROR([please install libx11-dev or libX11-devel])
+fi
+
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $X_CFLAGS"
+
+# checking for Xfixes
AC_CHECK_HEADER([X11/extensions/Xfixes.h], [],
[AC_MSG_ERROR([please install libx11-dev and libxfixes-dev or libXfixes-devel])],
[#include <X11/Xlib.h>])
+
+# checking for Xrandr
AC_CHECK_HEADER([X11/extensions/Xrandr.h], [],
[AC_MSG_ERROR([please install libxrandr-dev or libXrandr-devel])],
[#include <X11/Xlib.h>])
+CFLAGS="$save_CFLAGS"
+
libdir="${libdir}/xrdp";
if test "x${prefix}" = "xNONE" ; then
sysconfdir="/etc";
diff --git a/design.txt b/design.txt
index 431bcbd1..3b120c89 100644
--- a/design.txt
+++ b/design.txt
@@ -31,5 +31,5 @@ is lost, the session remains.
For X11, start the XServer after the user is
authenticated. First check for the next available X11 display,
-create a user session, start the XServer and set the DISPLAY enviromenet
+create a user session, start the XServer and set the DISPLAY environment
variable.
diff --git a/docs/man/xrdp-keygen.8 b/docs/man/xrdp-keygen.8
index 71269f5c..4a7e627e 100644
--- a/docs/man/xrdp-keygen.8
+++ b/docs/man/xrdp-keygen.8
@@ -1,4 +1,8 @@
.\" Hey, EMACS: -*- nroff -*-
+.\"-
+.\" Copyright © 2007, 2008 Vincent Bernat <bernat@debian.org>
+.\" License: GPL-2+
+.\"-
.TH xrdp\-keygen 8 "0.7.0" "xrdp team"
.SH NAME
xrdp\-keygen \- xrdp RSA key generation utility
diff --git a/fontdump/Makefile b/fontdump/Makefile
index 0a742582..0a742582 100755..100644
--- a/fontdump/Makefile
+++ b/fontdump/Makefile
diff --git a/fontdump/fontdump.c b/fontdump/fontdump.c
index 03609cf0..03609cf0 100755..100644
--- a/fontdump/fontdump.c
+++ b/fontdump/fontdump.c
diff --git a/genkeymap/Makefile.am b/genkeymap/Makefile.am
index aed72512..25767395 100644
--- a/genkeymap/Makefile.am
+++ b/genkeymap/Makefile.am
@@ -1,9 +1,12 @@
+AM_CFLAGS = $(X_CFLAGS)
bin_PROGRAMS = \
xrdp-genkeymap
xrdp_genkeymap_SOURCES = genkeymap.c evdev-map.c
+xrdp_genkeymap_LDFLAGS = \
+ $(X_LIBS)
+
xrdp_genkeymap_LDADD = \
- -L/usr/X11R6/lib \
- -lX11
+ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
diff --git a/install.txt b/install.txt
index 5683d1e5..dd36f4e3 100644
--- a/install.txt
+++ b/install.txt
@@ -11,11 +11,11 @@ You can build sesman without pam, there is a Makefile parameter
for that.
I also have a replacement ssl_calls.c to avoid the openssl dependency
email me(Jay) for it or see http://server1.xrdp.org/xrdp/openssl.
-Due to the licence, I can't include it in this project.
+Due to the license, I can't include it in this project.
http://server1.xrdp.org/xrdp/openssl/
-unpackage the tarball
+unpack the tarball
tar -zxvf xrdp-0.1.tar.gz
@@ -28,7 +28,7 @@ run make
as root, run make install
This will install most of the files in /usr/local/xrdp.
-Some files install in /etc/xrdp. These are configuation
+Some files install in /etc/xrdp. These are configuration
files.
files and location
diff --git a/instfiles/Makefile.am b/instfiles/Makefile.am
index 975b1702..99f37b61 100644
--- a/instfiles/Makefile.am
+++ b/instfiles/Makefile.am
@@ -1,7 +1,8 @@
-EXTRA_DIST = xrdp.sh km-0407.ini km-0409.ini km-040c.ini km-0410.ini km-0411.ini km-0419.ini km-041d.ini km-0816.ini km-0415.ini km-0807.ini \
-km-e0010411.ini km-e0200411.ini km-e0210411.ini \
-xrdp-sesman.service \
-xrdp.service
+EXTRA_DIST = \
+ xrdp.sh \
+ xrdp-sesman.service \
+ xrdp.service \
+ $(startscript_DATA)
#
# files for all platforms
@@ -14,11 +15,16 @@ startscript_DATA = \
km-040c.ini \
km-0410.ini \
km-0411.ini \
+ km-0414.ini \
km-0415.ini \
+ km-0416.ini \
km-0419.ini \
km-041d.ini \
km-0807.ini \
+ km-080c.ini \
+ km-0813.ini \
km-0816.ini \
+ km-100c.ini \
km-e0010411.ini \
km-e0200411.ini \
km-e0210411.ini
diff --git a/instfiles/init.d/xrdp b/instfiles/init.d/xrdp
index dcdb01a4..8e5f42d1 100644
--- a/instfiles/init.d/xrdp
+++ b/instfiles/init.d/xrdp
@@ -18,7 +18,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
BASE=__BASE__
DAEMON=${BASE}/sbin/xrdp
SDAEMON=${BASE}/sbin/xrdp-sesman
-PIDDIR=/var/run/xrdp/
+PIDDIR=/var/run/
SESMAN_START=yes
#USERID=xrdp
# the X11rdp backend only works as root at the moment - GH 20/03/2013
@@ -139,7 +139,7 @@ case "$1" in
;;
force-stop)
$0 stop
- # because it doesn't allways die the right way
+ # because it doesn't always die the right way
force_stop
;;
restart|force-reload)
diff --git a/instfiles/km-0411.ini b/instfiles/km-0411.ini
index 50ba669f..e860e6fd 100644
--- a/instfiles/km-0411.ini
+++ b/instfiles/km-0411.ini
@@ -120,9 +120,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -252,9 +252,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -384,9 +384,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -516,9 +516,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -648,9 +648,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -780,9 +780,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -912,9 +912,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -1044,9 +1044,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
diff --git a/instfiles/km-100c.ini b/instfiles/km-100c.ini
new file mode 100644
index 00000000..fd963fc0
--- /dev/null
+++ b/instfiles/km-100c.ini
@@ -0,0 +1,659 @@
+[noshift]
+Key8=0:0
+Key9=65307:27
+Key10=49:49
+Key11=50:50
+Key12=51:51
+Key13=52:52
+Key14=53:53
+Key15=54:54
+Key16=55:55
+Key17=56:56
+Key18=57:57
+Key19=48:48
+Key20=39:39
+Key21=65106:94
+Key22=65288:8
+Key23=65289:9
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=122:122
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=232:232
+Key35=65111:168
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=233:233
+Key48=224:224
+Key49=167:167
+Key50=65505:0
+Key51=36:36
+Key52=121:121
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=44:44
+Key60=46:46
+Key61=45:45
+Key62=65506:0
+Key63=65450:42
+Key64=65513:0
+Key65=32:32
+Key66=65509:0
+Key67=65470:0
+Key68=65471:0
+Key69=65472:0
+Key70=65473:0
+Key71=65474:0
+Key72=65475:0
+Key73=65476:0
+Key74=65477:0
+Key75=65478:0
+Key76=65479:0
+Key77=65407:0
+Key78=65300:0
+Key79=65429:0
+Key80=65431:0
+Key81=65434:0
+Key82=65453:45
+Key83=65430:0
+Key84=65437:0
+Key85=65432:0
+Key86=65451:43
+Key87=65436:0
+Key88=65433:0
+Key89=65435:0
+Key90=65438:0
+Key91=65439:0
+Key92=0:0
+Key93=65406:0
+Key94=60:60
+Key95=65480:0
+Key96=65481:0
+Key97=65360:0
+Key98=65362:0
+Key99=65365:0
+Key100=65361:0
+Key101=0:0
+Key102=65363:0
+Key103=65367:0
+Key104=65364:0
+Key105=65366:0
+Key106=65379:0
+Key107=65535:127
+Key108=65421:13
+Key109=65508:0
+Key110=65299:0
+Key111=65377:0
+Key112=65455:47
+Key113=65027:0
+Key114=0:0
+Key115=0:0
+Key116=0:0
+Key117=0:0
+Key118=0:0
+Key119=0:0
+Key120=0:0
+Key121=0:0
+Key122=0:0
+Key123=0:0
+Key124=65027:0
+Key125=0:0
+Key126=65469:61
+Key127=0:0
+Key128=0:0
+Key129=0:0
+Key130=0:0
+Key131=0:0
+Key132=0:0
+Key133=0:0
+Key134=0:0
+Key135=0:0
+Key136=0:0
+Key137=0:0
+
+[shift]
+Key8=0:0
+Key9=65307:27
+Key10=43:43
+Key11=34:34
+Key12=42:42
+Key13=231:231
+Key14=37:37
+Key15=38:38
+Key16=47:47
+Key17=40:40
+Key18=41:41
+Key19=61:61
+Key20=63:63
+Key21=65104:96
+Key22=65288:8
+Key23=65056:0
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=90:90
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=252:252
+Key35=33:33
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=246:246
+Key48=228:228
+Key49=176:176
+Key50=65505:0
+Key51=163:163
+Key52=89:89
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=59:59
+Key60=58:58
+Key61=95:95
+Key62=65506:0
+Key63=65450:42
+Key64=65511:0
+Key65=32:32
+Key66=65509:0
+Key67=65470:0
+Key68=65471:0
+Key69=65472:0
+Key70=65473:0
+Key71=65474:0
+Key72=65475:0
+Key73=65476:0
+Key74=65477:0
+Key75=65478:0
+Key76=65479:0
+Key77=65273:0
+Key78=65300:0
+Key79=65463:55
+Key80=65464:56
+Key81=65465:57
+Key82=65453:45
+Key83=65460:52
+Key84=65461:53
+Key85=65462:54
+Key86=65451:43
+Key87=65457:49
+Key88=65458:50
+Key89=65459:51
+Key90=65456:48
+Key91=65454:46
+Key92=0:0
+Key93=65406:0
+Key94=62:62
+Key95=65480:0
+Key96=65481:0
+Key97=65360:0
+Key98=65362:0
+Key99=65365:0
+Key100=65361:0
+Key101=0:0
+Key102=65363:0
+Key103=65367:0
+Key104=65364:0
+Key105=65366:0
+Key106=65379:0
+Key107=65535:127
+Key108=65421:13
+Key109=65508:0
+Key110=65299:0
+Key111=65377:0
+Key112=65455:47
+Key113=65312:0
+Key114=0:0
+Key115=0:0
+Key116=0:0
+Key117=0:0
+Key118=0:0
+Key119=0:0
+Key120=0:0
+Key121=0:0
+Key122=0:0
+Key123=0:0
+Key124=65027:0
+Key125=65513:0
+Key126=65469:61
+Key127=65515:0
+Key128=65517:0
+Key129=0:0
+Key130=0:0
+Key131=0:0
+Key132=0:0
+Key133=0:0
+Key134=0:0
+Key135=0:0
+Key136=0:0
+Key137=0:0
+
+[altgr]
+Key8=0:0
+Key9=65307:27
+Key10=124:124
+Key11=64:64
+Key12=35:35
+Key13=188:188
+Key14=189:189
+Key15=172:172
+Key16=166:166
+Key17=162:162
+Key18=93:93
+Key19=125:125
+Key20=65105:180
+Key21=65107:126
+Key22=65288:8
+Key23=65289:9
+Key24=64:64
+Key25=435:322
+Key26=8364:8364
+Key27=182:182
+Key28=956:359
+Key29=2299:8592
+Key30=2302:8595
+Key31=2301:8594
+Key32=248:248
+Key33=254:254
+Key34=91:91
+Key35=93:93
+Key36=65293:13
+Key37=65507:0
+Key38=230:230
+Key39=223:223
+Key40=240:240
+Key41=496:273
+Key42=959:331
+Key43=689:295
+Key44=106:106
+Key45=930:312
+Key46=435:322
+Key47=65105:180
+Key48=123:123
+Key49=172:172
+Key50=65505:0
+Key51=125:125
+Key52=171:171
+Key53=187:187
+Key54=162:162
+Key55=2770:8220
+Key56=2771:8221
+Key57=110:110
+Key58=181:181
+Key59=2211:0
+Key60=183:183
+Key61=65120:0
+Key62=65506:0
+Key63=65450:42
+Key64=65513:0
+Key65=32:32
+Key66=65509:0
+Key67=65470:0
+Key68=65471:0
+Key69=65472:0
+Key70=65473:0
+Key71=65474:0
+Key72=65475:0
+Key73=65476:0
+Key74=65477:0
+Key75=65478:0
+Key76=65479:0
+Key77=65407:0
+Key78=65300:0
+Key79=65429:0
+Key80=65431:0
+Key81=65434:0
+Key82=65453:45
+Key83=65430:0
+Key84=65437:0
+Key85=65432:0
+Key86=65451:43
+Key87=65436:0
+Key88=65433:0
+Key89=65435:0
+Key90=65438:0
+Key91=65439:0
+Key92=0:0
+Key93=65406:0
+Key94=92:92
+Key95=65480:0
+Key96=65481:0
+Key97=65360:0
+Key98=65362:0
+Key99=65365:0
+Key100=65361:0
+Key101=0:0
+Key102=65363:0
+Key103=65367:0
+Key104=65364:0
+Key105=65366:0
+Key106=65379:0
+Key107=65535:127
+Key108=65421:13
+Key109=65508:0
+Key110=65299:0
+Key111=0:0
+Key112=65455:47
+Key113=65027:0
+Key114=0:0
+Key115=0:0
+Key116=0:0
+Key117=0:0
+Key118=0:0
+Key119=0:0
+Key120=0:0
+Key121=0:0
+Key122=0:0
+Key123=0:0
+Key124=65027:0
+Key125=0:0
+Key126=65469:61
+Key127=0:0
+Key128=0:0
+Key129=0:0
+Key130=0:0
+Key131=0:0
+Key132=0:0
+Key133=0:0
+Key134=0:0
+Key135=0:0
+Key136=0:0
+Key137=0:0
+
+[capslock]
+Key8=0:0
+Key9=65307:27
+Key10=49:49
+Key11=50:50
+Key12=51:51
+Key13=52:52
+Key14=53:53
+Key15=54:54
+Key16=55:55
+Key17=56:56
+Key18=57:57
+Key19=48:48
+Key20=39:39
+Key21=65106:94
+Key22=65288:8
+Key23=65289:9
+Key24=81:81
+Key25=87:87
+Key26=69:69
+Key27=82:82
+Key28=84:84
+Key29=90:90
+Key30=85:85
+Key31=73:73
+Key32=79:79
+Key33=80:80
+Key34=200:200
+Key35=65111:168
+Key36=65293:13
+Key37=65507:0
+Key38=65:65
+Key39=83:83
+Key40=68:68
+Key41=70:70
+Key42=71:71
+Key43=72:72
+Key44=74:74
+Key45=75:75
+Key46=76:76
+Key47=201:201
+Key48=192:192
+Key49=167:167
+Key50=65505:0
+Key51=36:36
+Key52=89:89
+Key53=88:88
+Key54=67:67
+Key55=86:86
+Key56=66:66
+Key57=78:78
+Key58=77:77
+Key59=44:44
+Key60=46:46
+Key61=45:45
+Key62=65506:0
+Key63=65450:42
+Key64=65513:0
+Key65=32:32
+Key66=65509:0
+Key67=65470:0
+Key68=65471:0
+Key69=65472:0
+Key70=65473:0
+Key71=65474:0
+Key72=65475:0
+Key73=65476:0
+Key74=65477:0
+Key75=65478:0
+Key76=65479:0
+Key77=65407:0
+Key78=65300:0
+Key79=65429:0
+Key80=65431:0
+Key81=65434:0
+Key82=65453:45
+Key83=65430:0
+Key84=65437:0
+Key85=65432:0
+Key86=65451:43
+Key87=65436:0
+Key88=65433:0
+Key89=65435:0
+Key90=65438:0
+Key91=65439:0
+Key92=0:0
+Key93=65406:0
+Key94=60:60
+Key95=65480:0
+Key96=65481:0
+Key97=65360:0
+Key98=65362:0
+Key99=65365:0
+Key100=65361:0
+Key101=0:0
+Key102=65363:0
+Key103=65367:0
+Key104=65364:0
+Key105=65366:0
+Key106=65379:0
+Key107=65535:127
+Key108=65421:13
+Key109=65508:0
+Key110=65299:0
+Key111=65377:0
+Key112=65455:47
+Key113=65027:0
+Key114=0:0
+Key115=0:0
+Key116=0:0
+Key117=0:0
+Key118=0:0
+Key119=0:0
+Key120=0:0
+Key121=0:0
+Key122=0:0
+Key123=0:0
+Key124=65027:0
+Key125=0:0
+Key126=65469:61
+Key127=0:0
+Key128=0:0
+Key129=0:0
+Key130=0:0
+Key131=0:0
+Key132=0:0
+Key133=0:0
+Key134=0:0
+Key135=0:0
+Key136=0:0
+Key137=0:0
+
+[shiftcapslock]
+Key8=0:0
+Key9=65307:27
+Key10=43:43
+Key11=34:34
+Key12=42:42
+Key13=199:199
+Key14=37:37
+Key15=38:38
+Key16=47:47
+Key17=40:40
+Key18=41:41
+Key19=61:61
+Key20=63:63
+Key21=65104:96
+Key22=65288:8
+Key23=65056:0
+Key24=113:113
+Key25=119:119
+Key26=101:101
+Key27=114:114
+Key28=116:116
+Key29=122:122
+Key30=117:117
+Key31=105:105
+Key32=111:111
+Key33=112:112
+Key34=220:220
+Key35=33:33
+Key36=65293:13
+Key37=65507:0
+Key38=97:97
+Key39=115:115
+Key40=100:100
+Key41=102:102
+Key42=103:103
+Key43=104:104
+Key44=106:106
+Key45=107:107
+Key46=108:108
+Key47=214:214
+Key48=196:196
+Key49=176:176
+Key50=65505:0
+Key51=163:163
+Key52=121:121
+Key53=120:120
+Key54=99:99
+Key55=118:118
+Key56=98:98
+Key57=110:110
+Key58=109:109
+Key59=59:59
+Key60=58:58
+Key61=95:95
+Key62=65506:0
+Key63=65450:42
+Key64=65511:0
+Key65=32:32
+Key66=65509:0
+Key67=65470:0
+Key68=65471:0
+Key69=65472:0
+Key70=65473:0
+Key71=65474:0
+Key72=65475:0
+Key73=65476:0
+Key74=65477:0
+Key75=65478:0
+Key76=65479:0
+Key77=65273:0
+Key78=65300:0
+Key79=65463:55
+Key80=65464:56
+Key81=65465:57
+Key82=65453:45
+Key83=65460:52
+Key84=65461:53
+Key85=65462:54
+Key86=65451:43
+Key87=65457:49
+Key88=65458:50
+Key89=65459:51
+Key90=65456:48
+Key91=65454:46
+Key92=0:0
+Key93=65406:0
+Key94=62:62
+Key95=65480:0
+Key96=65481:0
+Key97=65360:0
+Key98=65362:0
+Key99=65365:0
+Key100=65361:0
+Key101=0:0
+Key102=65363:0
+Key103=65367:0
+Key104=65364:0
+Key105=65366:0
+Key106=65379:0
+Key107=65535:127
+Key108=65421:13
+Key109=65508:0
+Key110=65299:0
+Key111=65377:0
+Key112=65455:47
+Key113=65312:0
+Key114=0:0
+Key115=0:0
+Key116=0:0
+Key117=0:0
+Key118=0:0
+Key119=0:0
+Key120=0:0
+Key121=0:0
+Key122=0:0
+Key123=0:0
+Key124=65027:0
+Key125=65513:0
+Key126=65469:61
+Key127=65515:0
+Key128=65517:0
+Key129=0:0
+Key130=0:0
+Key131=0:0
+Key132=0:0
+Key133=0:0
+Key134=0:0
+Key135=0:0
+Key136=0:0
+Key137=0:0
diff --git a/instfiles/km-e0010411.ini b/instfiles/km-e0010411.ini
index 50ba669f..e860e6fd 100644
--- a/instfiles/km-e0010411.ini
+++ b/instfiles/km-e0010411.ini
@@ -120,9 +120,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -252,9 +252,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -384,9 +384,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -516,9 +516,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -648,9 +648,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -780,9 +780,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -912,9 +912,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -1044,9 +1044,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
diff --git a/instfiles/km-e0200411.ini b/instfiles/km-e0200411.ini
index 50ba669f..e860e6fd 100644
--- a/instfiles/km-e0200411.ini
+++ b/instfiles/km-e0200411.ini
@@ -120,9 +120,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -252,9 +252,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -384,9 +384,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -516,9 +516,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -648,9 +648,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -780,9 +780,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -912,9 +912,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -1044,9 +1044,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
diff --git a/instfiles/km-e0210411.ini b/instfiles/km-e0210411.ini
index 50ba669f..e860e6fd 100644
--- a/instfiles/km-e0210411.ini
+++ b/instfiles/km-e0210411.ini
@@ -120,9 +120,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -252,9 +252,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -384,9 +384,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -516,9 +516,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -648,9 +648,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -780,9 +780,9 @@ Key125=0:0
Key126=65469:61
Key127=0:0
Key128=0:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=165:165
Key134=0:0
@@ -912,9 +912,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
@@ -1044,9 +1044,9 @@ Key125=65513:0
Key126=65469:61
Key127=65515:0
Key128=65517:0
-Key129=0:0
+Key129=65315:0
Key130=0:0
-Key131=0:0
+Key131=65314:0
Key132=0:0
Key133=124:124
Key134=0:0
diff --git a/instfiles/rc.d/xrdp b/instfiles/rc.d/xrdp
index 24d4aabe..d20f8108 100644
--- a/instfiles/rc.d/xrdp
+++ b/instfiles/rc.d/xrdp
@@ -1,5 +1,28 @@
#!/bin/sh
#
+# Copyright (c) 1992-2015 The FreeBSD Project. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
# $FreeBSD$
#
# REQUIRE: DAEMON
diff --git a/instfiles/xrdp-sesman.service b/instfiles/xrdp-sesman.service
index 69882783..0ce9a4e5 100644
--- a/instfiles/xrdp-sesman.service
+++ b/instfiles/xrdp-sesman.service
@@ -7,7 +7,8 @@ BindTo=xrdp.service
[Service]
Type=forking
PIDFile=/var/run/xrdp-sesman.pid
-EnvironmentFile=/etc/sysconfig/xrdp
+EnvironmentFile=-/etc/sysconfig/xrdp
+EnvironmentFile=-/etc/default/xrdp
ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
ExecStop=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS --kill
diff --git a/instfiles/xrdp.service b/instfiles/xrdp.service
index 843500d6..fca4bd66 100644
--- a/instfiles/xrdp.service
+++ b/instfiles/xrdp.service
@@ -6,8 +6,9 @@ After=syslog.target network.target xrdp-sesman.service
[Service]
Type=forking
PIDFile=/var/run/xrdp.pid
-EnvironmentFile=/etc/sysconfig/xrdp
-ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS --nodaemon
+EnvironmentFile=-/etc/sysconfig/xrdp
+EnvironmentFile=-/etc/default/xrdp
+ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS
ExecStop=/usr/sbin/xrdp $XRDP_OPTIONS --kill
[Install]
diff --git a/keygen/Makefile.am b/keygen/Makefile.am
index c28c063d..353f74df 100644
--- a/keygen/Makefile.am
+++ b/keygen/Makefile.am
@@ -1,11 +1,9 @@
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
bin_PROGRAMS = \
diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am
index ec92f8be..5b89b0c3 100644
--- a/libxrdp/Makefile.am
+++ b/libxrdp/Makefile.am
@@ -28,19 +28,12 @@ EXTRA_LIBS += -ljpeg
endif
endif
-if GOT_PREFIX
-EXTRA_INCLUDES += -I$(prefix)/include
-EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib
-endif
-
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+ $(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(EXTRA_INCLUDES)
diff --git a/libxrdp/libxrdp.c b/libxrdp/libxrdp.c
index acc41444..834e6ae3 100644
--- a/libxrdp/libxrdp.c
+++ b/libxrdp/libxrdp.c
@@ -105,7 +105,7 @@ libxrdp_get_pdu_bytes(const char *aheader)
}
/******************************************************************************/
-/* only used durring connection */
+/* only used during connection */
struct stream * APP_CC
libxrdp_force_read(struct trans* trans)
{
@@ -1074,7 +1074,7 @@ libxrdp_query_channel(struct xrdp_session *session, int index,
}
/*****************************************************************************/
-/* returns a zero based index of the channel, -1 if error or it dosen't
+/* returns a zero based index of the channel, -1 if error or it doesn't
exist */
int EXPORT_CC
libxrdp_get_channel_id(struct xrdp_session *session, char *name)
diff --git a/libxrdp/libxrdp.h b/libxrdp/libxrdp.h
index 5f60183d..6058c9ac 100644
--- a/libxrdp/libxrdp.h
+++ b/libxrdp/libxrdp.h
@@ -281,7 +281,7 @@ struct xrdp_mppc_enc
char *outputBuffer; /* contains compressed data */
char *outputBufferPlus;
int historyOffset; /* next free slot in historyBuffer */
- int buf_len; /* length of historyBuffer, protocol dependant */
+ int buf_len; /* length of historyBuffer, protocol dependent */
int bytes_in_opb; /* compressed bytes available in outputBuffer */
int flags; /* PACKET_COMPRESSED, PACKET_AT_FRONT, PACKET_FLUSHED etc */
int flagsHold;
diff --git a/libxrdp/xrdp_channel.c b/libxrdp/xrdp_channel.c
index 7d3909d5..2da0ecdb 100644
--- a/libxrdp/xrdp_channel.c
+++ b/libxrdp/xrdp_channel.c
@@ -173,7 +173,7 @@ xrdp_channel_call_callback(struct xrdp_channel *self, struct stream *s,
/*****************************************************************************/
/* returns error */
-/* This is called from the secure layer to process an incomming non global
+/* This is called from the secure layer to process an incoming non global
channel packet.
'chanid' passed in here is the mcs channel id so it MCS_GLOBAL_CHANNEL
plus something. */
diff --git a/libxrdp/xrdp_jpeg_compress.c b/libxrdp/xrdp_jpeg_compress.c
index e4ce64fe..27c31639 100644
--- a/libxrdp/xrdp_jpeg_compress.c
+++ b/libxrdp/xrdp_jpeg_compress.c
@@ -220,7 +220,7 @@ struct mydata_comp
};
/*****************************************************************************/
-/* called at begining */
+/* called at beginning */
static void DEFAULT_CC
my_init_destination(j_compress_ptr cinfo)
{
diff --git a/libxrdp/xrdp_mcs.c b/libxrdp/xrdp_mcs.c
index 0ff57b0c..03e6bca7 100644
--- a/libxrdp/xrdp_mcs.c
+++ b/libxrdp/xrdp_mcs.c
@@ -183,7 +183,7 @@ xrdp_mcs_recv(struct xrdp_mcs *self, struct stream *s, int *chan)
}
else
{
- log_message(LOG_LEVEL_DEBUG,"Recieved an unhandled appid:%d",appid);
+ log_message(LOG_LEVEL_DEBUG,"Received an unhandled appid:%d",appid);
}
break;
diff --git a/libxrdp/xrdp_orders.c b/libxrdp/xrdp_orders.c
index 7d969514..b2f1e582 100644
--- a/libxrdp/xrdp_orders.c
+++ b/libxrdp/xrdp_orders.c
@@ -286,7 +286,7 @@ xrdp_orders_last_bounds(struct xrdp_orders *self, struct xrdp_rect *rect)
}
/*****************************************************************************/
-/* check if all coords are withing 256 bytes */
+/* check if all coords are within 256 bytes */
/* returns boolean */
static int APP_CC
xrdp_orders_send_delta(struct xrdp_orders *self, int *vals, int count)
@@ -2719,7 +2719,7 @@ xrdp_orders_out_v3(struct xrdp_orders *self, int cache_id, int cache_idx,
out_uint8(self->out_s, RDP_ORDER_BMPCACHE3); /* type */
/* cache index */
out_uint16_le(self->out_s, cache_idx);
- /* persistant cache key 1/2 */
+ /* persistent cache key 1/2 */
out_uint32_le(self->out_s, 0);
out_uint32_le(self->out_s, 0);
/* bitmap data */
diff --git a/libxrdp/xrdp_orders_rail.c b/libxrdp/xrdp_orders_rail.c
index 91d4b607..3c5d5b63 100644
--- a/libxrdp/xrdp_orders_rail.c
+++ b/libxrdp/xrdp_orders_rail.c
@@ -333,6 +333,12 @@ xrdp_orders_send_window_new_update(struct xrdp_orders *self, int window_id,
order_size += 8 * window_state->num_visibility_rects;
}
+ if (order_size < 12)
+ {
+ /* no flags set */
+ return 0;
+ }
+
if (xrdp_orders_check(self, order_size) != 0)
{
return 1;
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 00000000..0f4126cd
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1 @@
+*.m4
diff --git a/mc/Makefile.am b/mc/Makefile.am
index eb000085..f56dac5f 100644
--- a/mc/Makefile.am
+++ b/mc/Makefile.am
@@ -1,12 +1,10 @@
EXTRA_DIST = mc.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
lib_LTLIBRARIES = \
diff --git a/mc/mc.h b/mc/mc.h
index ac31334c..4af932f0 100644
--- a/mc/mc.h
+++ b/mc/mc.h
@@ -67,7 +67,7 @@ struct mod
int (*server_set_pen)(struct mod* v, int style,
int width);
int (*server_draw_line)(struct mod* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct mod* v, int font, int charactor,
+ int (*server_add_char)(struct mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct mod* v, int font,
diff --git a/neutrinordp/Makefile.am b/neutrinordp/Makefile.am
index 93e1196a..58fe9bc2 100644
--- a/neutrinordp/Makefile.am
+++ b/neutrinordp/Makefile.am
@@ -7,14 +7,12 @@ else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+ $(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(FREERDP_CFLAGS)
diff --git a/neutrinordp/xrdp-neutrinordp.h b/neutrinordp/xrdp-neutrinordp.h
index 68eae750..8606efe2 100644
--- a/neutrinordp/xrdp-neutrinordp.h
+++ b/neutrinordp/xrdp-neutrinordp.h
@@ -101,7 +101,7 @@ struct mod
int (*server_set_pen)(struct mod* v, int style,
int width);
int (*server_draw_line)(struct mod* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct mod* v, int font, int charactor,
+ int (*server_add_char)(struct mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct mod* v, int font,
diff --git a/prog_std.txt b/prog_std.txt
index c358a470..671172f2 100644
--- a/prog_std.txt
+++ b/prog_std.txt
@@ -1,5 +1,5 @@
-This is an atempt to explain my odd programming standard used for this project.
+This is an attempt to explain my odd programming standard used for this project.
Not to defend any of these but its my default standard and make it easy
for me to read.
Some files break these rules, they will be updated eventually.
diff --git a/rdp/Makefile.am b/rdp/Makefile.am
index 9b519d7c..6d23b287 100644
--- a/rdp/Makefile.am
+++ b/rdp/Makefile.am
@@ -7,14 +7,12 @@ else
EXTRA_DEFINES += -DXRDP_NODEBUG
endif
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+ $(EXTRA_DEFINES) \
-I$(top_srcdir)/common
lib_LTLIBRARIES = \
diff --git a/rdp/rdp.h b/rdp/rdp.h
index 9a755a38..36a20f57 100644
--- a/rdp/rdp.h
+++ b/rdp/rdp.h
@@ -292,7 +292,7 @@ struct mod
int (*server_set_pen)(struct mod* v, int style,
int width);
int (*server_draw_line)(struct mod* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct mod* v, int font, int charactor,
+ int (*server_add_char)(struct mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct mod* v, int font,
diff --git a/rdp/rdp_mcs.c b/rdp/rdp_mcs.c
index 18c33ac4..536ba7d1 100644
--- a/rdp/rdp_mcs.c
+++ b/rdp/rdp_mcs.c
@@ -19,7 +19,7 @@
*/
#include "rdp.h"
-#include "common/log.h"
+#include "log.h"
/*****************************************************************************/
struct rdp_mcs *APP_CC
diff --git a/rdp/rdp_orders.c b/rdp/rdp_orders.c
index 0e4d42ad..3372a815 100644
--- a/rdp/rdp_orders.c
+++ b/rdp/rdp_orders.c
@@ -1435,7 +1435,7 @@ rdp_orders_process_orders(struct rdp_orders *self, struct stream *s,
}
/*****************************************************************************/
-/* returns pointer, it might return bmpdata if the data dosen't need to
+/* returns pointer, it might return bmpdata if the data doesn't need to
be converted, else it mallocs it. The calling function must free
it if needed */
char *APP_CC
diff --git a/rdp/rdp_tcp.c b/rdp/rdp_tcp.c
index f0a76d7d..0200e777 100644
--- a/rdp/rdp_tcp.c
+++ b/rdp/rdp_tcp.c
@@ -74,7 +74,7 @@ rdp_tcp_recv(struct rdp_tcp *self, struct stream *s, int len)
{
if (g_tcp_last_error_would_block(self->sck))
{
- g_tcp_can_recv(self->sck, 10);
+ g_sck_can_recv(self->sck, 10);
}
else
{
diff --git a/readme.txt b/readme.txt
index aa2b2742..b051ef02 100644
--- a/readme.txt
+++ b/readme.txt
@@ -9,8 +9,8 @@ Credits
Mark from up 19.9 was the first to work with rdp server code.
Tested with linux on i386, x64, sparc, and ppc.
-I've got it compiling and working in windows with borland free tools.
-Non of the sesman or Xserver stuff works in windows of course.
+I've got it compiling and working in windows with Borland free tools.
+None of the sesman or Xserver stuff works in windows of course.
xrdp directory is the main server code
vnc directory is a simple vnc client module for xrdp
@@ -19,11 +19,11 @@ libxrdp directory is a static library needed by xrdp
rdp is an rdp client module for connecting to another rdp server
xup is a module used to connect to an rdp specific X11 server
Xserver is the files needed to build an rdp specific X11 server
-COPYING is the licence file
-design.txt is an attempt to expain the project design
-prog_std.txt is an attemp to explain the programming standard used
+COPYING is the license file
+design.txt is an attempt to explain the project design
+prog_std.txt is an attempt to explain the programming standard used
-since version 0.5.0 we switch to autotool to build xrdp
+since version 0.5.0 we switch to autotools to build xrdp
to build and install
diff --git a/sesman/Makefile.am b/sesman/Makefile.am
index 516639f4..979f72d9 100644
--- a/sesman/Makefile.am
+++ b/sesman/Makefile.am
@@ -1,12 +1,12 @@
-EXTRA_DIST = sesman.ini startwm.sh sesman.h access.h auth.h config.h env.h lock.h scp.h scp_v0.h scp_v1.h scp_v1_mng.h session.h sig.h thread.h
-AM_CFLAGS = \
+EXTRA_DIST = sesman.ini startwm.sh sesman.h access.h auth.h config.h env.h \
+scp.h scp_v0.h scp_v1.h scp_v1_mng.h session.h sig.h
+
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common \
-I$(top_srcdir)/sesman/libscp
@@ -44,8 +44,6 @@ xrdp_sesman_SOURCES = \
sesman.c \
session.c \
sig.c \
- thread.c \
- lock.c \
access.c \
config.c \
env.c \
diff --git a/sesman/access.c b/sesman/access.c
index 1ba22df4..269b9e77 100644
--- a/sesman/access.c
+++ b/sesman/access.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am
index 755de786..45397b73 100644
--- a/sesman/chansrv/Makefile.am
+++ b/sesman/chansrv/Makefile.am
@@ -31,17 +31,17 @@ EXTRA_DEFINES += -DXRDP_OPUS
EXTRA_LIBS += -lopus
endif
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+ $(EXTRA_DEFINES) \
-I$(top_srcdir)/common \
$(EXTRA_INCLUDES)
+AM_CFLAGS = $(X_CFLAGS)
+
sbin_PROGRAMS = \
xrdp-chansrv
@@ -62,10 +62,10 @@ xrdp_chansrv_SOURCES = \
chansrv_common.c
xrdp_chansrv_LDFLAGS = \
+ $(X_LIBS) \
$(EXTRA_FLAGS)
xrdp_chansrv_LDADD = \
- -L/usr/X11R6/lib \
$(top_builddir)/common/libcommon.la \
- -lX11 -lXfixes -lXrandr \
+ $(X_PRE_LIBS) -lXfixes -lXrandr -lX11 $(X_EXTRA_LIBS) \
$(EXTRA_LIBS)
diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c
index b3499ad6..ed180454 100644
--- a/sesman/chansrv/chansrv_fuse.c
+++ b/sesman/chansrv/chansrv_fuse.c
@@ -62,8 +62,8 @@ char g_fuse_clipboard_path[256] = ""; /* for clipboard use */
#include "chansrv_fuse.h"
/* dummy calls when XRDP_FUSE is not defined */
-int xfuse_init() { return 0; }
-int xfuse_deinit() { return 0; }
+int xfuse_init(void) { return 0; }
+int xfuse_deinit(void) { return 0; }
int xfuse_check_wait_objs(void) { return 0; }
int xfuse_get_wait_objs(tbus *objs, int *count, int *timeout) { return 0; }
int xfuse_clear_clip_dir(void) { return 0; }
@@ -74,7 +74,7 @@ int xfuse_create_share(tui32 device_id, char *dirname) { r
void xfuse_devredir_cb_open_file(void *vp, tui32 IoStatus, tui32 DeviceId, tui32 FileId) {}
void xfuse_devredir_cb_write_file(void *vp, char *buf, size_t length) {}
void xfuse_devredir_cb_read_file(void *vp, char *buf, size_t length) {}
-int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) {}
+int xfuse_devredir_cb_enum_dir(void *vp, struct xrdp_inode *xinode) { return 0; }
void xfuse_devredir_cb_enum_dir_done(void *vp, tui32 IoStatus) {}
void xfuse_devredir_cb_rmdir_or_file(void *vp, tui32 IoStatus) {}
void xfuse_devredir_cb_rename_file(void *vp, tui32 IoStatus) {}
@@ -253,8 +253,8 @@ static int g_fd = 0;
static tintptr g_bufsize = 0;
/* forward declarations for internal access */
-static int xfuse_init_xrdp_fs();
-static int xfuse_deinit_xrdp_fs();
+static int xfuse_init_xrdp_fs(void);
+static int xfuse_deinit_xrdp_fs(void);
static int xfuse_init_lib(struct fuse_args *args);
static int xfuse_is_inode_valid(int ino);
@@ -264,7 +264,7 @@ static void xfuse_create_file(fuse_req_t req, fuse_ino_t parent,
const char *name, mode_t mode, int type);
#endif
-static void xfuse_dump_fs();
+static void xfuse_dump_fs(void);
static void xfuse_dump_xrdp_inode(struct xrdp_inode *xino);
static tui32 xfuse_get_device_id_for_inode(tui32 ino, char *full_path);
static void fuse_reverse_pathname(char *full_path, char *reverse_path);
@@ -281,7 +281,7 @@ static int xfuse_delete_file(int parent, char *name);
static int xfuse_delete_file_with_xinode(XRDP_INODE *xinode);
static int xfuse_delete_dir_with_xinode(XRDP_INODE *xinode);
static int xfuse_recursive_delete_dir_with_xinode(XRDP_INODE *xinode);
-static void xfuse_update_xrdpfs_size();
+static void xfuse_update_xrdpfs_size(void);
static void xfuse_enum_dir(fuse_req_t req, fuse_ino_t ino, size_t size,
off_t off, struct fuse_file_info *fi);
@@ -693,6 +693,11 @@ int xfuse_clear_clip_dir(void)
log_debug("entered");
+ if (g_xrdp_fs.inode_table == NULL)
+ {
+ return 0;
+ }
+
/* xinode for .clipboard */
xip = g_xrdp_fs.inode_table[2];
diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c
index 310e2093..11c37a16 100644
--- a/sesman/chansrv/clipboard.c
+++ b/sesman/chansrv/clipboard.c
@@ -176,6 +176,8 @@ x-special/gnome-copied-files
#define LOG_ERROR 0
#define LOG_INFO 1
#define LOG_DEBUG 2
+
+#undef LOG_LEVEL
#define LOG_LEVEL LOG_ERROR
#define log_error(_params...) \
@@ -271,7 +273,7 @@ static int g_cliprdr_flags = CB_USE_LONG_FORMAT_NAMES |
CB_FILECLIP_NO_FILE_PATHS;
/* from client to server */
-/* last recieved CLIPRDR_FORMAT_LIST(CLIPRDR_FORMAT_ANNOUNCE) */
+/* last received CLIPRDR_FORMAT_LIST(CLIPRDR_FORMAT_ANNOUNCE) */
static int g_formatIds[16];
static int g_num_formatIds = 0;
@@ -1547,7 +1549,7 @@ clipboard_data_in(struct stream *s, int chan_id, int chan_flags, int length,
{
log_error("aborting clipboard_data_in - clipboard has not "
"been initialized");
- /* we return 0 here to indicate no protocol problem occured */
+ /* we return 0 here to indicate no protocol problem occurred */
return 0;
}
@@ -1887,7 +1889,7 @@ clipboard_event_selection_notify(XEvent *xevent)
XDeleteProperty(g_display, lxevent->requestor, lxevent->property);
if (type == g_incr_atom)
{
- /* nothing more to do here, the data is comming in through
+ /* nothing more to do here, the data is coming in through
PropertyNotify */
log_debug("clipboard_event_selection_notify: type is INCR "
"data_size %d property name %s type %s", data_size,
diff --git a/sesman/chansrv/clipboard_file.c b/sesman/chansrv/clipboard_file.c
index c1fb0909..4f3f1ade 100644
--- a/sesman/chansrv/clipboard_file.c
+++ b/sesman/chansrv/clipboard_file.c
@@ -22,6 +22,7 @@
* CLIPRDR_FILEDESCRIPTOR
* http://msdn.microsoft.com/en-us/library/ff362447%28prot.20%29.aspx */
+#include <sys/time.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xfixes.h>
@@ -553,7 +554,7 @@ clipboard_process_file_request(struct stream *s, int clip_msg_status,
}
/*****************************************************************************/
-/* server requested info about the file and this is the responce
+/* server requested info about the file and this is the response
it's either the file size or file data */
int APP_CC
clipboard_process_file_response(struct stream *s, int clip_msg_status,
diff --git a/sesman/chansrv/pulse/module-xrdp-sink.c b/sesman/chansrv/pulse/module-xrdp-sink.c
index 8606f412..5d6256d4 100644
--- a/sesman/chansrv/pulse/module-xrdp-sink.c
+++ b/sesman/chansrv/pulse/module-xrdp-sink.c
@@ -309,7 +309,7 @@ static int data_send(struct userdata *u, pa_memchunk *chunk) {
s.sun_family = AF_UNIX;
bytes = sizeof(s.sun_path) - 1;
snprintf(s.sun_path, bytes, CHANSRV_PORT_STR, u->display_num);
- pa_log_debug("trying to conenct to %s", s.sun_path);
+ pa_log_debug("trying to connect to %s", s.sun_path);
if (connect(fd, (struct sockaddr *)&s,
sizeof(struct sockaddr_un)) != 0) {
u->failed_connect_time = pa_rtclock_now();
diff --git a/sesman/chansrv/pulse/module-xrdp-source.c b/sesman/chansrv/pulse/module-xrdp-source.c
index 37c0bb4e..52409606 100644
--- a/sesman/chansrv/pulse/module-xrdp-source.c
+++ b/sesman/chansrv/pulse/module-xrdp-source.c
@@ -313,7 +313,7 @@ static void thread_func(void *userdata) {
} else {
if (u->want_src_data)
{
- /* we dont want source data anymore */
+ /* we don't want source data anymore */
char buf[12];
buf[0] = 0;
diff --git a/sesman/chansrv/rail.c b/sesman/chansrv/rail.c
index f3777970..f12d8e3f 100644
--- a/sesman/chansrv/rail.c
+++ b/sesman/chansrv/rail.c
@@ -1775,7 +1775,7 @@ rail_configure_window(XConfigureEvent *config)
/*****************************************************************************/
static int
-rail_desktop_resize(lxevent)
+rail_desktop_resize(XEvent *lxevent)
{
LOG(0, ("rail_desktop_resize:"));
return 0;
diff --git a/sesman/env.c b/sesman/env.c
index 863ada8f..b2f06160 100644
--- a/sesman/env.c
+++ b/sesman/env.c
@@ -34,25 +34,44 @@ extern struct config_sesman *g_cfg; /* in sesman.c */
/******************************************************************************/
int DEFAULT_CC
-env_check_password_file(char *filename, char *password)
+env_check_password_file(char *filename, char *passwd)
{
char encryptedPasswd[16];
char key[24];
+ char passwd_hash[20];
+ char passwd_hash_text[40];
int fd;
- void* des;
+ int passwd_bytes;
+ void *des;
+ void *sha1;
+ /* create password hash from passowrd */
+ passwd_bytes = g_strlen(passwd);
+ sha1 = ssl_sha1_info_create();
+ ssl_sha1_transform(sha1, "xrdp_vnc", 8);
+ ssl_sha1_transform(sha1, passwd, passwd_bytes);
+ ssl_sha1_transform(sha1, passwd, passwd_bytes);
+ ssl_sha1_complete(sha1, passwd_hash);
+ ssl_sha1_info_delete(sha1);
+ g_snprintf(passwd_hash_text, 39, "%2.2x%2.2x%2.2x%2.2x",
+ (tui8)passwd_hash[0], (tui8)passwd_hash[1],
+ (tui8)passwd_hash[2], (tui8)passwd_hash[3]);
+ passwd_hash_text[39] = 0;
+ passwd = passwd_hash_text;
+
+ /* create file from password */
g_memset(encryptedPasswd, 0, sizeof(encryptedPasswd));
- g_strncpy(encryptedPasswd, password, 8);
+ g_strncpy(encryptedPasswd, passwd, 8);
g_memset(key, 0, sizeof(key));
g_mirror_memcpy(key, g_fixedkey, 8);
des = ssl_des3_encrypt_info_create(key, 0);
ssl_des3_encrypt(des, 8, encryptedPasswd, encryptedPasswd);
ssl_des3_info_delete(des);
- fd = g_file_open(filename);
+ fd = g_file_open_ex(filename, 0, 1, 1, 1);
if (fd == -1)
{
log_message(LOG_LEVEL_WARNING,
- "can't read vnc password file - %s",
+ "can't write vnc password hash file - %s",
filename);
return 1;
}
@@ -111,7 +130,6 @@ env_set_user(char *username, char *passwd_file, int display,
g_set_current_dir(pw_dir);
g_sprintf(text, ":%d.0", display);
g_setenv("DISPLAY", text, 1);
- g_setenv("LANG", "en_US.UTF-8", 1);
g_setenv("XRDP_SESSION", "1", 1);
if ((env_names != 0) && (env_values != 0) &&
(env_names->count == env_values->count))
diff --git a/sesman/libscp/Makefile.am b/sesman/libscp/Makefile.am
index eaf518a8..3172f2cb 100644
--- a/sesman/libscp/Makefile.am
+++ b/sesman/libscp/Makefile.am
@@ -1,13 +1,11 @@
EXTRA_DIST = libscp_connection.h libscp_commands.h libscp.h libscp_session.h libscp_types_mng.h libscp_v1c_mng.h libscp_vX.h libscp_commands_mng.h libscp_init.h libscp_tcp.h libscp_v0.h libscp_v1s.h libscp_lock.h \
libscp_types.h libscp_v1c.h libscp_v1s_mng.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
lib_LTLIBRARIES = \
diff --git a/sesman/libscp/libscp_lock.c b/sesman/libscp/libscp_lock.c
index 4db05422..d35e3c9c 100644
--- a/sesman/libscp/libscp_lock.c
+++ b/sesman/libscp/libscp_lock.c
@@ -57,7 +57,7 @@ scp_lock_fork_request(void)
if (lock_fork_blockers_count == 0)
{
- /* if noone is blocking fork(), then we're allowed to fork */
+ /* if no one is blocking fork(), then we're allowed to fork */
sem_post(&lock_fork_req);
}
diff --git a/sesman/libscp/libscp_lock.h b/sesman/libscp/libscp_lock.h
index b4e93c52..ae2c361b 100644
--- a/sesman/libscp/libscp_lock.h
+++ b/sesman/libscp/libscp_lock.h
@@ -52,8 +52,8 @@ scp_lock_fork_release(void);
*
* @brief starts a section that is critical for forking
*
- * starts a section that is critical for forking, that is noone can fork()
- * while i'm in a critical section. But if someone wanted to fork we have
+ * starts a section that is critical for forking, that is no one can fork()
+ * while I'm in a critical section. But if someone wanted to fork we have
* to wait until he finishes with lock_fork_release()
*
* @return
diff --git a/sesman/libscp/libscp_v1s.c b/sesman/libscp/libscp_v1s.c
index 69997ab2..fb137433 100644
--- a/sesman/libscp/libscp_v1s.c
+++ b/sesman/libscp/libscp_v1s.c
@@ -435,8 +435,11 @@ scp_v1s_list_sessions(struct SCP_CONNECTION *c, int sescnt, struct SCP_DISCONNEC
}
/* then we wait for client ack */
-#warning maybe this message could say if the session should be resized on
-#warning server side or client side
+
+ /*
+ * Maybe this message could say if the session should be resized on
+ * server side or client side.
+ */
init_stream(c->in_s, c->in_s->size);
if (0 != scp_tcp_force_recv(c->in_sck, c->in_s->data, 8))
diff --git a/sesman/lock.c b/sesman/lock.c
deleted file mode 100644
index 6337a541..00000000
--- a/sesman/lock.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * xrdp: A Remote Desktop Protocol server.
- *
- * Copyright (C) Jay Sorg 2004-2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * session manager
- * linux only
- */
-
-#include "sesman.h"
-
-extern struct config_sesman *g_cfg; /* in sesman.c */
-
-static tbus g_sync_mutex = 0;
-static tbus g_lock_chain = 0;
-static tbus g_sync_sem = 0;
-static tbus g_lock_socket = 0;
-
-/******************************************************************************/
-void APP_CC
-lock_init(void)
-{
- g_sync_mutex = tc_mutex_create();
- g_lock_chain = tc_mutex_create();
- g_sync_sem = tc_sem_create(0);
- g_lock_socket = tc_sem_create(1);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_deinit(void)
-{
- tc_mutex_delete(g_sync_mutex);
- tc_mutex_delete(g_lock_chain);
- tc_sem_delete(g_sync_sem);
- tc_sem_delete(g_lock_socket);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_chain_acquire(void)
-{
- /* lock the chain */
- LOG_DBG("lock_chain_acquire()");
- tc_mutex_lock(g_lock_chain);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_chain_release(void)
-{
- /* unlock the chain */
- LOG_DBG("lock_chain_release()");
- tc_mutex_unlock(g_lock_chain);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_socket_acquire(void)
-{
- /* lock socket variable */
- LOG_DBG("lock_socket_acquire()");
- tc_sem_dec(g_lock_socket);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_socket_release(void)
-{
- /* unlock socket variable */
- LOG_DBG("lock_socket_release()");
- tc_sem_inc(g_lock_socket);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_sync_acquire(void)
-{
- /* lock sync variable */
- LOG_DBG("lock_sync_acquire()");
- tc_mutex_lock(g_sync_mutex);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_sync_release(void)
-{
- /* unlock socket variable */
- LOG_DBG("lock_sync_release()");
- tc_mutex_unlock(g_sync_mutex);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_sync_sem_acquire(void)
-{
- /* dec sem */
- LOG_DBG("lock_sync_sem_acquire()");
- tc_sem_dec(g_sync_sem);
-}
-
-/******************************************************************************/
-void APP_CC
-lock_sync_sem_release(void)
-{
- /* inc sem */
- LOG_DBG("lock_sync_sem_release()");
- tc_sem_inc(g_sync_sem);
-}
diff --git a/sesman/lock.h b/sesman/lock.h
deleted file mode 100644
index 1fd968ef..00000000
--- a/sesman/lock.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/**
- * xrdp: A Remote Desktop Protocol server.
- *
- * Copyright (C) Jay Sorg 2004-2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef LOCK_H
-#define LOCK_H
-
-#include "sesman.h"
-
-/**
- *
- * @brief initializes all the locks
- *
- */
-void APP_CC
-lock_init(void);
-
-/**
- *
- * @brief cleanup all the locks
- *
- */
-void APP_CC
-lock_deinit(void);
-
-/**
- *
- * @brief acquires the lock for the session chain
- *
- */
-void APP_CC
-lock_chain_acquire(void);
-
-/**
- *
- * @brief releases the session chain lock
- *
- */
-void APP_CC
-lock_chain_release(void);
-
-/**
- *
- * @brief request the socket lock
- *
- */
-void APP_CC
-lock_socket_acquire(void);
-
-/**
- *
- * @brief releases the socket lock
- *
- */
-void APP_CC
-lock_socket_release(void);
-
-/**
- *
- * @brief request the main sync lock
- *
- */
-void APP_CC
-lock_sync_acquire(void);
-
-/**
- *
- * @brief releases the main sync lock
- *
- */
-void APP_CC
-lock_sync_release(void);
-
-/**
- *
- * @brief request the sync sem lock
- *
- */
-void APP_CC
-lock_sync_sem_acquire(void);
-
-/**
- *
- * @brief releases the sync sem lock
- *
- */
-void APP_CC
-lock_sync_sem_release(void);
-
-#endif
diff --git a/sesman/scp.c b/sesman/scp.c
index 076d57b2..fdb81a04 100644
--- a/sesman/scp.c
+++ b/sesman/scp.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,7 +29,6 @@
#include "sesman.h"
-extern int g_thread_sck; /* in thread.c */
extern struct config_sesman *g_cfg; /* in sesman.c */
/******************************************************************************/
@@ -39,14 +38,9 @@ scp_process_start(void *sck)
struct SCP_CONNECTION scon;
struct SCP_SESSION *sdata;
- /* making a local copy of the socket (it's on the stack) */
- /* probably this is just paranoia */
- scon.in_sck = g_thread_sck;
+ scon.in_sck = (int)(tintptr)sck;
LOG_DBG("started scp thread on socket %d", scon.in_sck);
- /* unlocking g_thread_sck */
- lock_socket_release();
-
make_stream(scon.in_s);
make_stream(scon.out_s);
diff --git a/sesman/scp_v0.c b/sesman/scp_v0.c
index ce528d46..efa9080c 100644
--- a/sesman/scp_v0.c
+++ b/sesman/scp_v0.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,9 +35,9 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
int display = 0;
tbus data;
struct session_item *s_item;
- int errorcode = 0 ;
+ int errorcode = 0;
- data = auth_userpass(s->username, s->password,&errorcode);
+ data = auth_userpass(s->username, s->password, &errorcode);
if (s->type == SCP_GW_AUTHENTICATION)
{
@@ -55,7 +55,7 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
}
else
{
- scp_v0s_replyauthentication(c, 32+3); /* all first 32 are reserved for PAM errors */
+ scp_v0s_replyauthentication(c, 32 + 3); /* all first 32 are reserved for PAM errors */
log_message(LOG_LEVEL_INFO, "Username okey but group problem for "
"user: %s", s->username);
/* g_writeln("user password ok, but group problem"); */
@@ -128,11 +128,11 @@ scp_v0_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
display = session_start(s->width, s->height, s->bpp, s->username,
s->password, data, SESMAN_SESSION_TYPE_XRDP,
s->domain, s->program, s->directory,
- s->client_ip);
- }
+ s->client_ip);
+ }
else if (SCP_SESSION_TYPE_XORG == s->type)
{
- /* type is SCP_SESSION_TYPE_XORG */
+ /* type is SCP_SESSION_TYPE_XORG */
log_message(LOG_LEVEL_INFO, "starting Xorg session...");
display = session_start(s->width, s->height, s->bpp, s->username,
s->password, data, SESMAN_SESSION_TYPE_XORG,
diff --git a/sesman/scp_v1.c b/sesman/scp_v1.c
index 2324b750..a0fff6d9 100644
--- a/sesman/scp_v1.c
+++ b/sesman/scp_v1.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
diff --git a/sesman/sesman.c b/sesman/sesman.c
index 9a3e915e..924a7ae8 100644
--- a/sesman/sesman.c
+++ b/sesman/sesman.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,10 +31,7 @@ int g_pid;
unsigned char g_fixedkey[8] = { 23, 82, 107, 6, 35, 78, 88, 7 };
struct config_sesman *g_cfg; /* defined in config.h */
-tbus g_term_event = 0;
-tbus g_sync_event = 0;
-
-extern int g_thread_sck; /* in thread.c */
+tintptr g_term_event = 0;
/******************************************************************************/
/**
@@ -49,6 +46,7 @@ sesman_main_loop(void)
int error;
int robjs_count;
int cont;
+ int pid;
tbus sck_obj;
tbus robjs[8];
@@ -80,7 +78,6 @@ sesman_main_loop(void)
robjs_count = 0;
robjs[robjs_count++] = sck_obj;
robjs[robjs_count++] = g_term_event;
- robjs[robjs_count++] = g_sync_event;
/* wait */
if (g_obj_wait(robjs, robjs_count, 0, 0, -1) != 0)
@@ -94,12 +91,6 @@ sesman_main_loop(void)
break;
}
- if (g_is_wait_obj_set(g_sync_event)) /* sync */
- {
- g_reset_wait_obj(g_sync_event);
- session_sync_start();
- }
-
if (g_is_wait_obj_set(sck_obj)) /* incoming connection */
{
in_sck = g_tcp_accept(g_sck);
@@ -118,8 +109,8 @@ sesman_main_loop(void)
{
/* we've got a connection, so we pass it to scp code */
LOG_DBG("new connection");
- thread_scp_start(in_sck);
- /* todo, do we have to wait here ? */
+ scp_process_start((void*)(tintptr)in_sck);
+ g_sck_close(in_sck);
}
}
}
@@ -138,9 +129,7 @@ sesman_main_loop(void)
"port '%s': %d (%s)", g_cfg->listen_port,
g_get_errno(), g_get_strerror());
}
-
- if (g_sck != -1)
- g_tcp_close(g_sck);
+ g_tcp_close(g_sck);
}
/******************************************************************************/
@@ -292,6 +281,9 @@ main(int argc, char **argv)
g_writeln("error opening log file [%s]. quitting.",
getLogFile(text, 255));
break;
+ default:
+ g_writeln("error");
+ break;
}
g_deinit();
@@ -329,9 +321,6 @@ main(int argc, char **argv)
}
}
- /* initializing locks */
- lock_init();
-
/* signal handling */
g_pid = g_getpid();
/* old style signal handling is now managed synchronously by a
@@ -387,8 +376,6 @@ main(int argc, char **argv)
g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_term", g_pid);
g_term_event = g_create_wait_obj(text);
- g_snprintf(text, 255, "xrdp_sesman_%8.8x_main_sync", g_pid);
- g_sync_event = g_create_wait_obj(text);
sesman_main_loop();
@@ -399,7 +386,6 @@ main(int argc, char **argv)
}
g_delete_wait_obj(g_term_event);
- g_delete_wait_obj(g_sync_event);
if (!daemon)
{
diff --git a/sesman/sesman.h b/sesman/sesman.h
index e80f85d1..09b781bc 100644
--- a/sesman/sesman.h
+++ b/sesman/sesman.h
@@ -42,9 +42,6 @@
#include "session.h"
#include "access.h"
#include "scp.h"
-#include "thread.h"
-#include "lock.h"
-#include "thread_calls.h"
#include "libscp.h"
diff --git a/sesman/session.c b/sesman/session.c
index 5185d738..8c3ccc17 100644
--- a/sesman/session.c
+++ b/sesman/session.c
@@ -1,7 +1,7 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
- * Copyright (C) Jay Sorg 2004-2013
+ * Copyright (C) Jay Sorg 2004-2015
*
* BSD process grouping by:
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland.
@@ -32,30 +32,13 @@
#include "sesman.h"
#include "libscp_types.h"
-#include <errno.h>
-//#include <time.h>
-
-extern tbus g_sync_event;
extern unsigned char g_fixedkey[8];
extern struct config_sesman *g_cfg; /* in sesman.c */
extern int g_sck; /* in sesman.c */
-extern int g_thread_sck; /* in thread.c */
struct session_chain *g_sessions;
int g_session_count;
-static int g_sync_width;
-static int g_sync_height;
-static int g_sync_bpp;
-static char *g_sync_username;
-static char *g_sync_password;
-static char *g_sync_domain;
-static char *g_sync_program;
-static char *g_sync_directory;
-static char *g_sync_client_ip;
-static tbus g_sync_data;
-static tui8 g_sync_type;
-static int g_sync_result;
-static int g_sync_cmd;
+extern tbus g_term_event; /* in sesman.c */
/**
* Creates a string consisting of all parameters that is hosted in the param list
@@ -68,7 +51,6 @@ char *APP_CC
dumpItemsToString(struct list *self, char *outstr, int len)
{
int index;
- tbus item;
int totalLen = 0;
g_memset(outstr, 0, len);
@@ -100,9 +82,6 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
struct session_chain *tmp;
enum SESMAN_CFG_SESS_POLICY policy = g_cfg->sess.policy;
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
tmp = g_sessions;
/* convert from SCP_SESSION_TYPE namespace to SESMAN_SESSION_TYPE namespace */
@@ -119,7 +98,6 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
type = SESMAN_SESSION_TYPE_XORG;
break;
default:
- lock_chain_release();
return 0;
}
@@ -141,27 +119,9 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
tmp->item->client_ip);
#endif
- if (type == SESMAN_SESSION_TYPE_XRDP)
- {
- /* only name and bpp need to match for X11rdp, it can resize */
- if (g_strncmp(name, tmp->item->name, 255) == 0 &&
- (!(policy & SESMAN_CFG_SESS_POLICY_D) ||
- (tmp->item->width == width && tmp->item->height == height)) &&
- (!(policy & SESMAN_CFG_SESS_POLICY_I) ||
- (g_strncmp_d(client_ip, tmp->item->client_ip, ':', 255) == 0)) &&
- (!(policy & SESMAN_CFG_SESS_POLICY_C) ||
- (g_strncmp(client_ip, tmp->item->client_ip, 255) == 0)) &&
- tmp->item->bpp == bpp &&
- tmp->item->type == type)
- {
- /*THREAD-FIX release chain lock */
- lock_chain_release();
- return tmp->item;
- }
- }
-
if (g_strncmp(name, tmp->item->name, 255) == 0 &&
- (tmp->item->width == width && tmp->item->height == height) &&
+ (!(policy & SESMAN_CFG_SESS_POLICY_D) ||
+ (tmp->item->width == width && tmp->item->height == height)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_I) ||
(g_strncmp_d(client_ip, tmp->item->client_ip, ':', 255) == 0)) &&
(!(policy & SESMAN_CFG_SESS_POLICY_C) ||
@@ -169,16 +129,12 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c
tmp->item->bpp == bpp &&
tmp->item->type == type)
{
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return tmp->item;
}
tmp = tmp->next;
}
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return 0;
}
@@ -282,7 +238,6 @@ x_server_running(int display)
{
char text[256];
int x_running;
- int sck;
g_sprintf(text, "/tmp/.X11-unix/X%d", display);
x_running = g_file_exist(text);
@@ -324,9 +279,9 @@ session_start_sessvc(int xpid, int wmpid, long data, char *username, int display
/* building parameters */
g_snprintf(exe_path, 261, "%s/xrdp-sessvc", XRDP_SBIN_PATH);
- list_add_item(sessvc_params, (long)g_strdup(exe_path));
- list_add_item(sessvc_params, (long)g_strdup(xpid_str));
- list_add_item(sessvc_params, (long)g_strdup(wmpid_str));
+ list_add_item(sessvc_params, (tintptr)g_strdup(exe_path));
+ list_add_item(sessvc_params, (tintptr)g_strdup(xpid_str));
+ list_add_item(sessvc_params, (tintptr)g_strdup(wmpid_str));
list_add_item(sessvc_params, 0); /* mandatory */
env_set_user(username, 0, display,
@@ -344,7 +299,7 @@ session_start_sessvc(int xpid, int wmpid, long data, char *username, int display
/* no problem calling strerror for thread safety: other threads
are blocked */
log_message(LOG_LEVEL_DEBUG, "errno: %d, description: %s",
- errno, g_get_strerror());
+ g_get_errno(), g_get_strerror());
log_message(LOG_LEVEL_DEBUG, "execve parameter list:");
for (i = 0; i < (sessvc_params->count); i++)
@@ -398,7 +353,6 @@ session_get_aval_display_from_chain(void)
int display;
display = g_cfg->sess.x11_display_offset;
- lock_chain_acquire();
while ((display - g_cfg->sess.x11_display_offset) <= g_cfg->sess.max_sessions)
{
@@ -406,7 +360,6 @@ session_get_aval_display_from_chain(void)
{
if (!x_server_running_check_ports(display))
{
- lock_chain_release();
return display;
}
}
@@ -414,7 +367,6 @@ session_get_aval_display_from_chain(void)
display++;
}
- lock_chain_release();
log_message(LOG_LEVEL_ERROR, "X server -- no display in range is available");
return 0;
}
@@ -518,15 +470,16 @@ session_start_fork(int width, int height, int bpp, char *username,
return 0;
}
- pid = g_fork();
+ pid = g_fork(); /* parent is fork from tcp accpet,
+ child forks X and wm, then becomes scp */
if (pid == -1)
{
}
- else if (pid == 0) /* child sesman */
+ else if (pid == 0)
{
+ g_tcp_close(g_term_event);
g_tcp_close(g_sck);
- g_tcp_close(g_thread_sck);
g_sprintf(geometry, "%dx%d", width, height);
g_sprintf(depth, "%d", bpp);
g_sprintf(screen, ":%d", display);
@@ -566,19 +519,21 @@ session_start_fork(int width, int height, int bpp, char *username,
g_waitpid(bsdsespid);
#endif
- wmpid = g_fork();
+ wmpid = g_fork(); /* parent becomes X,
+ child forks wm, and waits, todo */
if (wmpid == -1)
{
}
- else if (wmpid == 0) /* child (child sesman) xserver */
+ else if (wmpid == 0)
{
wait_for_xserver(display);
auth_start_session(data, display);
- pampid = g_fork();
+ pampid = g_fork(); /* parent waits, todo
+ child becomes wm */
if (pampid == -1)
{
}
- else if (pampid == 0) /* child: X11/client */
+ else if (pampid == 0)
{
env_set_user(username, 0, display,
g_cfg->session_variables1,
@@ -614,7 +569,7 @@ session_start_fork(int width, int height, int bpp, char *username,
"wm for user %s - pid %d", username, g_getpid());
/* logging parameters */
log_message(LOG_LEVEL_DEBUG, "errno: %d, "
- "description: %s", errno, g_get_strerror());
+ "description: %s", g_get_errno(), g_get_strerror());
log_message(LOG_LEVEL_DEBUG, "execlp3 parameter "
"list:");
log_message(LOG_LEVEL_DEBUG, " argv[0] = %s",
@@ -632,7 +587,7 @@ session_start_fork(int width, int height, int bpp, char *username,
"wm for user %s - pid %d", username, g_getpid());
/* logging parameters */
log_message(LOG_LEVEL_DEBUG, "errno: %d, description: "
- "%s", errno, g_get_strerror());
+ "%s", g_get_errno(), g_get_strerror());
log_message(LOG_LEVEL_DEBUG, "execlp3 parameter list:");
log_message(LOG_LEVEL_DEBUG, " argv[0] = %s",
text);
@@ -647,7 +602,7 @@ session_start_fork(int width, int height, int bpp, char *username,
"for user %s - pid %d", username, g_getpid());
/* logging parameters */
log_message(LOG_LEVEL_DEBUG, "errno: %d, description: "
- "%s", errno, g_get_strerror());
+ "%s", g_get_errno(), g_get_strerror());
}
else
{
@@ -666,10 +621,10 @@ session_start_fork(int width, int height, int bpp, char *username,
g_exit(0);
}
}
- else /* parent (child sesman) */
+ else
{
- xpid = g_fork();
-
+ xpid = g_fork(); /* parent becomes scp,
+ child becomes X */
if (xpid == -1)
{
}
@@ -697,8 +652,8 @@ session_start_fork(int width, int height, int bpp, char *username,
xserver_params->auto_free = 1;
/* these are the must have parameters */
- list_add_item(xserver_params, (long) g_strdup("Xorg"));
- list_add_item(xserver_params, (long) g_strdup(screen));
+ list_add_item(xserver_params, (tintptr) g_strdup("Xorg"));
+ list_add_item(xserver_params, (tintptr) g_strdup(screen));
/* additional parameters from sesman.ini file */
list_append_list_strdup(g_cfg->xorg_params, xserver_params, 0);
@@ -727,14 +682,14 @@ session_start_fork(int width, int height, int bpp, char *username,
xserver_params->auto_free = 1;
/* these are the must have parameters */
- list_add_item(xserver_params, (long)g_strdup("Xvnc"));
- list_add_item(xserver_params, (long)g_strdup(screen));
- list_add_item(xserver_params, (long)g_strdup("-geometry"));
- list_add_item(xserver_params, (long)g_strdup(geometry));
- list_add_item(xserver_params, (long)g_strdup("-depth"));
- list_add_item(xserver_params, (long)g_strdup(depth));
- list_add_item(xserver_params, (long)g_strdup("-rfbauth"));
- list_add_item(xserver_params, (long)g_strdup(passwd_file));
+ list_add_item(xserver_params, (tintptr)g_strdup("Xvnc"));
+ list_add_item(xserver_params, (tintptr)g_strdup(screen));
+ list_add_item(xserver_params, (tintptr)g_strdup("-geometry"));
+ list_add_item(xserver_params, (tintptr)g_strdup(geometry));
+ list_add_item(xserver_params, (tintptr)g_strdup("-depth"));
+ list_add_item(xserver_params, (tintptr)g_strdup(depth));
+ list_add_item(xserver_params, (tintptr)g_strdup("-rfbauth"));
+ list_add_item(xserver_params, (tintptr)g_strdup(passwd_file));
/* additional parameters from sesman.ini file */
//config_read_xserver_params(SESMAN_SESSION_TYPE_XVNC,
@@ -753,12 +708,12 @@ session_start_fork(int width, int height, int bpp, char *username,
xserver_params->auto_free = 1;
/* these are the must have parameters */
- list_add_item(xserver_params, (long)g_strdup("X11rdp"));
- list_add_item(xserver_params, (long)g_strdup(screen));
- list_add_item(xserver_params, (long)g_strdup("-geometry"));
- list_add_item(xserver_params, (long)g_strdup(geometry));
- list_add_item(xserver_params, (long)g_strdup("-depth"));
- list_add_item(xserver_params, (long)g_strdup(depth));
+ list_add_item(xserver_params, (tintptr)g_strdup("X11rdp"));
+ list_add_item(xserver_params, (tintptr)g_strdup(screen));
+ list_add_item(xserver_params, (tintptr)g_strdup("-geometry"));
+ list_add_item(xserver_params, (tintptr)g_strdup(geometry));
+ list_add_item(xserver_params, (tintptr)g_strdup("-depth"));
+ list_add_item(xserver_params, (tintptr)g_strdup(depth));
/* additional parameters from sesman.ini file */
//config_read_xserver_params(SESMAN_SESSION_TYPE_XRDP,
@@ -784,7 +739,7 @@ session_start_fork(int width, int height, int bpp, char *username,
/* logging parameters */
log_message(LOG_LEVEL_DEBUG, "errno: %d, description: "
- "%s", errno, g_get_strerror());
+ "%s", g_get_errno(), g_get_strerror());
log_message(LOG_LEVEL_DEBUG, "execve parameter list size: "
"%d", (xserver_params)->count);
@@ -797,7 +752,7 @@ session_start_fork(int width, int height, int bpp, char *username,
list_delete(xserver_params);
g_exit(1);
}
- else /* parent (child sesman)*/
+ else
{
wait_for_xserver(display);
g_snprintf(text, 255, "%d", display);
@@ -809,7 +764,7 @@ session_start_fork(int width, int height, int bpp, char *username,
}
}
}
- else /* parent sesman process */
+ else
{
temp->item->pid = pid;
temp->item->display = display;
@@ -833,16 +788,10 @@ session_start_fork(int width, int height, int bpp, char *username,
temp->item->type = type;
temp->item->status = SESMAN_SESSION_STATUS_ACTIVE;
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
temp->next = g_sessions;
g_sessions = temp;
g_session_count++;
- /*THREAD-FIX release chain lock */
- lock_chain_release();
-
return display;
}
@@ -889,32 +838,9 @@ session_start(int width, int height, int bpp, char *username, char *password,
long data, tui8 type, char *domain, char *program,
char *directory, char *client_ip)
{
- int display;
-
- /* lock mutex */
- lock_sync_acquire();
- /* set shared vars */
- g_sync_cmd = 0;
- g_sync_width = width;
- g_sync_height = height;
- g_sync_bpp = bpp;
- g_sync_username = username;
- g_sync_password = password;
- g_sync_domain = domain;
- g_sync_program = program;
- g_sync_directory = directory;
- g_sync_client_ip = client_ip;
- g_sync_data = data;
- g_sync_type = type;
- /* set event for main thread to see */
- g_set_wait_obj(g_sync_event);
- /* wait for main thread to get done */
- lock_sync_sem_acquire();
- /* read result(display) from shared var */
- display = g_sync_result;
- /* unlock mutex */
- lock_sync_release();
- return display;
+ return session_start_fork(width, height, bpp, username,
+ password, data, type, domain,
+ program, directory, client_ip);
}
/******************************************************************************/
@@ -923,42 +849,7 @@ session_start(int width, int height, int bpp, char *username, char *password,
int DEFAULT_CC
session_reconnect(int display, char *username)
{
- /* lock mutex */
- lock_sync_acquire();
- /* set shared vars */
- g_sync_cmd = 1;
- g_sync_width = display;
- g_sync_username = username;
- /* set event for main thread to see */
- g_set_wait_obj(g_sync_event);
- /* wait for main thread to get done */
- lock_sync_sem_acquire();
- /* unlock mutex */
- lock_sync_release();
- return 0;
-}
-
-/******************************************************************************/
-/* called with the main thread */
-int APP_CC
-session_sync_start(void)
-{
- if (g_sync_cmd == 0)
- {
- g_sync_result = session_start_fork(g_sync_width, g_sync_height, g_sync_bpp,
- g_sync_username, g_sync_password,
- g_sync_data, g_sync_type, g_sync_domain,
- g_sync_program, g_sync_directory,
- g_sync_client_ip);
- }
- else
- {
- /* g_sync_width is really display */
- g_sync_result = session_reconnect_fork(g_sync_width, g_sync_username);
- }
-
- lock_sync_sem_release();
- return 0;
+ return session_reconnect_fork(display, username);
}
/******************************************************************************/
@@ -968,9 +859,6 @@ session_kill(int pid)
struct session_chain *tmp;
struct session_chain *prev;
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
tmp = g_sessions;
prev = 0;
@@ -992,8 +880,6 @@ session_kill(int pid)
prev->next = tmp->next;
}
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return SESMAN_SESSION_KILL_NULLITEM;
}
@@ -1016,8 +902,6 @@ session_kill(int pid)
g_free(tmp);
g_session_count--;
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return SESMAN_SESSION_KILL_OK;
}
@@ -1026,8 +910,6 @@ session_kill(int pid)
tmp = tmp->next;
}
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return SESMAN_SESSION_KILL_NOTFOUND;
}
@@ -1037,9 +919,6 @@ session_sigkill_all()
{
struct session_chain *tmp;
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
tmp = g_sessions;
while (tmp != 0)
@@ -1057,9 +936,6 @@ session_sigkill_all()
/* go on */
tmp = tmp->next;
}
-
- /*THREAD-FIX release chain lock */
- lock_chain_release();
}
/******************************************************************************/
@@ -1077,9 +953,6 @@ session_get_bypid(int pid)
return 0;
}
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
tmp = g_sessions;
while (tmp != 0)
@@ -1088,18 +961,13 @@ session_get_bypid(int pid)
{
log_message(LOG_LEVEL_ERROR, "session descriptor for "
"pid %d is null!", pid);
- /*THREAD-FIX release chain lock */
- lock_chain_release();
g_free(dummy);
return 0;
}
if (tmp->item->pid == pid)
{
- /*THREAD-FIX release chain lock */
g_memcpy(dummy, tmp->item, sizeof(struct session_item));
- lock_chain_release();
- /*return tmp->item;*/
return dummy;
}
@@ -1107,8 +975,6 @@ session_get_bypid(int pid)
tmp = tmp->next;
}
- /*THREAD-FIX release chain lock */
- lock_chain_release();
g_free(dummy);
return 0;
}
@@ -1124,9 +990,6 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
count = 0;
- /*THREAD-FIX require chain lock */
- lock_chain_acquire();
-
tmp = g_sessions;
while (tmp != 0)
@@ -1152,8 +1015,6 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
if (count == 0)
{
(*cnt) = 0;
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return 0;
}
@@ -1163,8 +1024,6 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
if (sess == 0)
{
(*cnt) = 0;
- /*THREAD-FIX release chain lock */
- lock_chain_release();
return 0;
}
@@ -1173,7 +1032,7 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
while (tmp != 0)
{
-#warning FIXME: we should get only disconnected sessions!
+/* #warning FIXME: we should get only disconnected sessions! */
if ((NULL == user) || (!g_strncasecmp(user, tmp->item->name, 256)))
{
if ((tmp->item->status) & flags)
@@ -1183,7 +1042,7 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
(sess[index]).height = tmp->item->height;
(sess[index]).width = tmp->item->width;
(sess[index]).bpp = tmp->item->bpp;
-#warning FIXME: setting idle times and such
+/* #warning FIXME: setting idle times and such */
/*(sess[index]).connect_time.year = tmp->item->connect_time.year;
(sess[index]).connect_time.month = tmp->item->connect_time.month;
(sess[index]).connect_time.day = tmp->item->connect_time.day;
@@ -1216,8 +1075,6 @@ session_get_byuser(char *user, int *cnt, unsigned char flags)
tmp = tmp->next;
}
- /*THREAD-FIX release chain lock */
- lock_chain_release();
(*cnt) = count;
return sess;
}
diff --git a/sesman/session.h b/sesman/session.h
index 05e3b3a9..7bd8c8f8 100644
--- a/sesman/session.h
+++ b/sesman/session.h
@@ -112,15 +112,6 @@ session_reconnect(int display, char* username);
/**
*
- * @brief starts a session
- * @return error
- *
- */
-int APP_CC
-session_sync_start(void);
-
-/**
- *
* @brief kills a session
* @param pid the pid of the session to be killed
* @return
diff --git a/sesman/sessvc/Makefile.am b/sesman/sessvc/Makefile.am
index 8ba24abd..c2714b94 100644
--- a/sesman/sessvc/Makefile.am
+++ b/sesman/sessvc/Makefile.am
@@ -1,11 +1,9 @@
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
sbin_PROGRAMS = \
diff --git a/sesman/sessvc/sessvc.c b/sesman/sessvc/sessvc.c
index b3e42178..ce62cb47 100644
--- a/sesman/sessvc/sessvc.c
+++ b/sesman/sessvc/sessvc.c
@@ -101,7 +101,7 @@ main(int argc, char **argv)
wm_pid = g_atoi(argv[2]);
g_writeln("xrdp-sessvc: waiting for X (pid %d) and WM (pid %d)",
x_pid, wm_pid);
- /* run xrdp-chansrv as a seperate process */
+ /* run xrdp-chansrv as a separate process */
chansrv_pid = g_fork();
if (chansrv_pid == -1)
diff --git a/sesman/thread.c b/sesman/thread.c
deleted file mode 100644
index 0ed1182a..00000000
--- a/sesman/thread.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/**
- * xrdp: A Remote Desktop Protocol server.
- *
- * Copyright (C) Jay Sorg 2004-2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- *
- * @file thread.c
- * @brief thread stuff...
- * @author Simone Fedele
- *
- */
-
-#include "sesman.h"
-
-#include <errno.h>
-#include <signal.h>
-#include <pthread.h>
-
-extern struct config_sesman *g_cfg; /* in sesman.c */
-
-static pthread_t g_thread_sighandler;
-//static pthread_t g_thread_updater;
-
-/* a variable to pass the socket of s connection to a thread */
-int g_thread_sck;
-
-/******************************************************************************/
-int DEFAULT_CC
-thread_sighandler_start(void)
-{
- int ret;
- sigset_t sigmask;
- sigset_t oldmask;
- sigset_t waitmask;
-
- /* mask signals to be able to wait for them... */
- sigfillset(&sigmask);
- pthread_sigmask(SIG_BLOCK, &sigmask, &oldmask);
-
- /* unblock some signals... */
- sigemptyset(&waitmask);
-
- /* it is a good idea not to block SIGILL SIGSEGV */
- /* SIGFPE -- see sigaction(2) NOTES */
- sigaddset(&waitmask, SIGILL);
- sigaddset(&waitmask, SIGSEGV);
- sigaddset(&waitmask, SIGFPE);
- pthread_sigmask(SIG_UNBLOCK, &waitmask, NULL);
-
- log_message(LOG_LEVEL_INFO, "starting signal handling thread...");
-
- ret = pthread_create(&g_thread_sighandler, NULL, sig_handler_thread, "");
- pthread_detach(g_thread_sighandler);
-
- if (ret == 0)
- {
- log_message(LOG_LEVEL_INFO, "signal handler thread started successfully");
- return 0;
- }
-
- /* if something happened while starting a new thread... */
- switch (ret)
- {
- case EINVAL:
- log_message(LOG_LEVEL_ERROR, "invalid attributes for signal handling thread (creation returned EINVAL)");
- break;
- case EAGAIN:
- log_message(LOG_LEVEL_ERROR, "not enough resources to start signal handling thread (creation returned EAGAIN)");
- break;
- case EPERM:
- log_message(LOG_LEVEL_ERROR, "invalid permissions for signal handling thread (creation returned EPERM)");
- break;
- default:
- log_message(LOG_LEVEL_ERROR, "unknown error starting signal handling thread");
- }
-
- return 1;
-}
-
-#ifdef JUST_TO_AVOID_COMPILER_ERRORS
-/******************************************************************************/
-int DEFAULT_CC
-thread_session_update_start(void)
-{
- int ret;
- //starts the session update thread
- //that checks for idle time, destroys sessions, ecc...
-
-#warning this thread should always request lock_fork before read or write
-#warning (so we can Fork() In Peace)
- ret = pthread_create(&g_thread_updater, NULL, , "");
- pthread_detach(g_thread_updater);
-
- if (ret == 0)
- {
- log_message(&(g_cfg->log), LOG_LEVEL_INFO, "session update thread started successfully");
- return 0;
- }
-
- /* if something happened while starting a new thread... */
- switch (ret)
- {
- case EINVAL:
- log_message(LOG_LEVEL_ERROR, "invalid attributes for session update thread (creation returned EINVAL)");
- break;
- case EAGAIN:
- log_message(LOG_LEVEL_ERROR, "not enough resources to start session update thread (creation returned EAGAIN)");
- break;
- case EPERM:
- log_message(LOG_LEVEL_ERROR, "invalid permissions for session update thread (creation returned EPERM)");
- break;
- default:
- log_message(LOG_LEVEL_ERROR, "unknown error starting session update thread");
- }
-
- return 1;
-}
-#endif
-
-/******************************************************************************/
-int DEFAULT_CC
-thread_scp_start(int skt)
-{
- int ret;
- pthread_t th;
-
- /* blocking the use of thread_skt */
- lock_socket_acquire();
- g_thread_sck = skt;
-
- /* start a thread that processes a connection */
- ret = pthread_create(&th, NULL, scp_process_start, "");
- //ret = pthread_create(&th, NULL, scp_process_start, (void*) (&g_thread_sck));
- pthread_detach(th);
-
- if (ret == 0)
- {
- log_message(LOG_LEVEL_INFO, "scp thread on sck %d started successfully", skt);
- return 0;
- }
-
- /* if something happened while starting a new thread... */
- switch (ret)
- {
- case EINVAL:
- log_message(LOG_LEVEL_ERROR, "invalid attributes for scp thread on sck %d (creation returned EINVAL)", skt);
- break;
- case EAGAIN:
- log_message(LOG_LEVEL_ERROR, "not enough resources to start scp thread on sck %d (creation returned EAGAIN)", skt);
- break;
- case EPERM:
- log_message(LOG_LEVEL_ERROR, "invalid permissions for scp thread on sck %d (creation returned EPERM)", skt);
- break;
- default:
- log_message(LOG_LEVEL_ERROR, "unknown error starting scp thread on sck %d");
- }
-
- return 1;
-}
diff --git a/sesman/thread.h b/sesman/thread.h
deleted file mode 100644
index 83a4b63d..00000000
--- a/sesman/thread.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * xrdp: A Remote Desktop Protocol server.
- *
- * Copyright (C) Jay Sorg 2004-2013
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- *
- * @file thread.h
- * @brief thread stuff...
- * @author Simone Fedele
- *
- */
-
-#ifndef THREAD_H
-#define THREAD_H
-
-/**
- *
- * @brief Starts the signal handling thread
- * @retval 0 on success
- * @retval 1 on error
- *
- */
-int DEFAULT_CC
-thread_sighandler_start(void);
-
-/**
- *
- * @brief Starts the session update thread
- *
- */
-int DEFAULT_CC
-thread_session_update_start(void);
-
-/**
- *
- * @brief Starts a thread to handle an incoming connection
- *
- */
-int DEFAULT_CC
-thread_scp_start(int skt);
-
-#endif
diff --git a/sesman/tools/Makefile.am b/sesman/tools/Makefile.am
index 140c6820..066039b0 100644
--- a/sesman/tools/Makefile.am
+++ b/sesman/tools/Makefile.am
@@ -1,16 +1,16 @@
EXTRA_DIST = tcp.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common \
-I$(top_srcdir)/sesman/libscp \
-I$(top_srcdir)/sesman
+AM_CFLAGS = $(X_CFLAGS)
+
bin_PROGRAMS = \
xrdp-sesrun \
xrdp-sesadmin \
@@ -48,6 +48,8 @@ xrdp_sesadmin_LDADD = \
$(top_builddir)/common/libcommon.la \
$(top_builddir)/sesman/libscp/libscp.la
+xrdp_xcon_LDFLAGS = \
+ $(X_LIBS)
+
xrdp_xcon_LDADD = \
- -L/usr/X11R6/lib \
- -lX11
+ $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS)
diff --git a/sesman/tools/config.c b/sesman/tools/config.c
new file mode 100644
index 00000000..0f1399cc
--- /dev/null
+++ b/sesman/tools/config.c
@@ -0,0 +1 @@
+#include "../config.c"
diff --git a/sesman/tools/sesadmin.c b/sesman/tools/sesadmin.c
index 32789c6d..203bc023 100644
--- a/sesman/tools/sesadmin.c
+++ b/sesman/tools/sesadmin.c
@@ -2,6 +2,19 @@
* sesadmin.c - an sesman administration tool
* (c) 2008 Simone Fedele
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "arch.h"
diff --git a/sesman/tools/sestest.c b/sesman/tools/sestest.c
index d42b31de..cf28f803 100644
--- a/sesman/tools/sestest.c
+++ b/sesman/tools/sestest.c
@@ -2,6 +2,19 @@
* sestest.c - an scp_v1 testing tool
* (c) 2008 Simone Fedele
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "arch.h"
diff --git a/sesman/tools/xcon.c b/sesman/tools/xcon.c
index 80832276..4150d6af 100644
--- a/sesman/tools/xcon.c
+++ b/sesman/tools/xcon.c
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/types.h>
#include <X11/Xlib.h>
Display *g_display = 0;
diff --git a/tcutils/README.txt b/tcutils/README.txt
index de75f1b2..31ebb1f8 100644
--- a/tcutils/README.txt
+++ b/tcutils/README.txt
@@ -1,4 +1,4 @@
-A QT based utility program for thinclients using xrdp and NeutrinoRDP
+A QT based utility program for thin clients using xrdp and NeutrinoRDP
This program sends commands to NeutrinoRDP to do something
useful on the client end (such as unmounting a USB drive,
diff --git a/tests/gtcp_proxy/gtcp-proxy.c b/tests/gtcp_proxy/gtcp-proxy.c
index 39555c76..7b6312b0 100644
--- a/tests/gtcp_proxy/gtcp-proxy.c
+++ b/tests/gtcp_proxy/gtcp-proxy.c
@@ -611,7 +611,7 @@ static gboolean on_delete_event(GtkWidget *widget, GdkEvent *ev, gpointer data)
static void on_destroy(GtkWidget *widget, gpointer data)
{
- /* this will destory all windows and return control to gtk_main() */
+ /* this will destroy all windows and return control to gtk_main() */
gtk_main_quit();
}
@@ -673,6 +673,6 @@ static void on_clear_clicked(GtkWidget *widget, gpointer data)
static void on_quit_clicked(GtkWidget *widget, gpointer data)
{
- /* this will destory all windows and return control to gtk_main() */
+ /* this will destroy all windows and return control to gtk_main() */
gtk_main_quit();
}
diff --git a/tests/tcp_proxy/main.c b/tests/tcp_proxy/main.c
index 2d283ed9..aa276c44 100644
--- a/tests/tcp_proxy/main.c
+++ b/tests/tcp_proxy/main.c
@@ -454,7 +454,7 @@ main_loop(char *local_port, char *remote_ip, char *remote_port, int hexdump)
g_writeln("bind failed");
}
- /* listen for an incomming connection */
+ /* listen for an incoming connection */
if (error == 0)
{
error = g_tcp_listen(lis_sck);
@@ -465,7 +465,7 @@ main_loop(char *local_port, char *remote_ip, char *remote_port, int hexdump)
}
}
- /* accept an incomming connection */
+ /* accept an incoming connection */
if (error == 0)
{
while ((!g_terminated) && (error == 0))
diff --git a/vnc/Makefile.am b/vnc/Makefile.am
index 24835011..a9a3aa14 100644
--- a/vnc/Makefile.am
+++ b/vnc/Makefile.am
@@ -1,12 +1,10 @@
EXTRA_DIST = vnc.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
lib_LTLIBRARIES = \
diff --git a/vnc/vnc.c b/vnc/vnc.c
index 66e70225..2e16ed21 100644
--- a/vnc/vnc.c
+++ b/vnc/vnc.c
@@ -53,11 +53,31 @@ void DEFAULT_CC
rfbEncryptBytes(char *bytes, char *passwd)
{
char key[24];
+ char passwd_hash[20];
+ char passwd_hash_text[40];
void *des;
+ void *sha1;
+ int len;
+ int passwd_bytes;
+
+ /* create password hash from passowrd */
+ passwd_bytes = g_strlen(passwd);
+ sha1 = ssl_sha1_info_create();
+ ssl_sha1_transform(sha1, "xrdp_vnc", 8);
+ ssl_sha1_transform(sha1, passwd, passwd_bytes);
+ ssl_sha1_transform(sha1, passwd, passwd_bytes);
+ ssl_sha1_complete(sha1, passwd_hash);
+ ssl_sha1_info_delete(sha1);
+ g_snprintf(passwd_hash_text, 39, "%2.2x%2.2x%2.2x%2.2x",
+ (tui8)passwd_hash[0], (tui8)passwd_hash[1],
+ (tui8)passwd_hash[2], (tui8)passwd_hash[3]);
+ passwd_hash_text[39] = 0;
+ passwd = passwd_hash_text;
/* key is simply password padded with nulls */
g_memset(key, 0, sizeof(key));
- g_mirror_memcpy(key, passwd, g_strlen(passwd));
+ len = MIN(g_strlen(passwd), 8);
+ g_mirror_memcpy(key, passwd, len);
des = ssl_des3_encrypt_info_create(key, 0);
ssl_des3_encrypt(des, 8, bytes, bytes);
ssl_des3_info_delete(des);
@@ -671,7 +691,7 @@ lib_framebuffer_update(struct vnc *v)
}
}
- /* keep these in 32x32, vnc cursor can be alot bigger */
+ /* keep these in 32x32, vnc cursor can be a lot bigger */
if (x > 31)
{
x = 31;
@@ -1021,7 +1041,7 @@ lib_mod_connect(struct vnc *v)
if (error == 0)
{
v->server_msg(v, "VNC tcp connected", 0);
- /* protocal version */
+ /* protocol version */
init_stream(s, 8192);
error = trans_force_read_s(v->trans, s, 12);
if (error == 0)
@@ -1079,7 +1099,8 @@ lib_mod_connect(struct vnc *v)
if (error != 0)
{
- log_message(LOG_LEVEL_DEBUG, "VNC Error after security negotiation");
+ log_message(LOG_LEVEL_DEBUG, "VNC error %d after security negotiation",
+ error);
}
if (error == 0 && check_sec_result)
diff --git a/vnc/vnc.h b/vnc/vnc.h
index d7249f3d..af5e86e6 100644
--- a/vnc/vnc.h
+++ b/vnc/vnc.h
@@ -67,7 +67,7 @@ struct vnc
int (*server_set_pen)(struct vnc* v, int style,
int width);
int (*server_draw_line)(struct vnc* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct vnc* v, int font, int charactor,
+ int (*server_add_char)(struct vnc* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct vnc* v, int font,
diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h
index 1d06509d..901e292b 100644
--- a/xorg/X11R7.6/rdp/rdp.h
+++ b/xorg/X11R7.6/rdp/rdp.h
@@ -582,10 +582,10 @@ rdpup_check_alpha_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv);
int
rdpup_check_dirty_screen(rdpPixmapRec* pDirtyPriv);
int
-rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy,
+rdpup_add_char(int font, int character, short x, short y, int cx, int cy,
char* bmpdata, int bmpdata_bytes);
int
-rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy,
+rdpup_add_char_alpha(int font, int character, short x, short y, int cx, int cy,
char* bmpdata, int bmpdata_bytes);
int
rdpup_draw_text(int font, int flags, int mixmode,
diff --git a/xorg/X11R7.6/rdp/rdpPolyFillRect.c b/xorg/X11R7.6/rdp/rdpPolyFillRect.c
index 7db4be69..6d37f587 100644
--- a/xorg/X11R7.6/rdp/rdpPolyFillRect.c
+++ b/xorg/X11R7.6/rdp/rdpPolyFillRect.c
@@ -188,7 +188,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
- pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
+ pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */
{
draw_item_add_fill_region(pDirtyPriv, fill_reg, pGC->fgPixel,
pGC->alu);
@@ -210,7 +210,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
- pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
+ pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */
{
rdpup_set_fgcolor(pGC->fgPixel);
rdpup_set_opcode(pGC->alu);
@@ -253,7 +253,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
- pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
+ pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */
{
LLOGLN(10, ("rdpPolyFillRect: 3"));
draw_item_add_fill_region(pDirtyPriv, &clip_reg,
@@ -280,7 +280,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill,
pGC->alu == GXnoop ||
pGC->alu == GXand ||
pGC->alu == GXcopy /*||
- pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */
+ pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */
{
rdpup_set_fgcolor(pGC->fgPixel);
rdpup_set_opcode(pGC->alu);
diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c
index 90788449..4801b79c 100644
--- a/xorg/X11R7.6/rdp/rdpinput.c
+++ b/xorg/X11R7.6/rdp/rdpinput.c
@@ -182,7 +182,7 @@ rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
if (ctrls->enabled_ctrls & XkbRepeatKeysMask)
{
LLOGLN(10, ("rdpChangeKeyboardControl: autoRepeat on"));
- /* schedual to turn off the autorepeat after 100 ms so any app
+ /* schedule to turn off the autorepeat after 100 ms so any app
* polling it will be happy it's on */
g_kbtimer = TimerSet(g_kbtimer, 0, 100,
rdpInDeferredUpdateCallback, 0);
diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c
index cce4e951..f173de57 100644
--- a/xorg/X11R7.6/rdp/rdpmain.c
+++ b/xorg/X11R7.6/rdp/rdpmain.c
@@ -590,7 +590,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
/******************************************************************************/
/* this is the first function called, it can be called many times
returns the number or parameters processed
- if it dosen't apply to the rdp part, return 0 */
+ if it doesn't apply to the rdp part, return 0 */
int
ddxProcessArgument(int argc, char **argv, int i)
{
diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c
index b72848d2..230c1538 100644
--- a/xorg/X11R7.6/rdp/rdpup.c
+++ b/xorg/X11R7.6/rdp/rdpup.c
@@ -1319,7 +1319,7 @@ rdpup_init(void)
g_disconnect_timeout_s = 60;
}
- rdpLog("kill disconencted [%d] timeout [%d] sec\n", g_do_kill_disconnected,
+ rdpLog("kill disconnected [%d] timeout [%d] sec\n", g_do_kill_disconnected,
g_disconnect_timeout_s);
return 1;
@@ -2823,7 +2823,7 @@ rdpup_check_alpha_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv)
/******************************************************************************/
int
-rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy,
+rdpup_add_char(int font, int character, short x, short y, int cx, int cy,
char* bmpdata, int bmpdata_bytes)
{
if (g_connected)
@@ -2834,7 +2834,7 @@ rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy,
out_uint16_le(g_out_s, 18 + bmpdata_bytes); /* size */
g_count++;
out_uint16_le(g_out_s, font);
- out_uint16_le(g_out_s, charactor);
+ out_uint16_le(g_out_s, character);
out_uint16_le(g_out_s, x);
out_uint16_le(g_out_s, y);
out_uint16_le(g_out_s, cx);
@@ -2847,7 +2847,7 @@ rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy,
/******************************************************************************/
int
-rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy,
+rdpup_add_char_alpha(int font, int character, short x, short y, int cx, int cy,
char* bmpdata, int bmpdata_bytes)
{
if (g_connected)
@@ -2858,7 +2858,7 @@ rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy,
out_uint16_le(g_out_s, 18 + bmpdata_bytes); /* size */
g_count++;
out_uint16_le(g_out_s, font);
- out_uint16_le(g_out_s, charactor);
+ out_uint16_le(g_out_s, character);
out_uint16_le(g_out_s, x);
out_uint16_le(g_out_s, y);
out_uint16_le(g_out_s, cx);
diff --git a/xorg/X11R7.6/x11_file_list.txt b/xorg/X11R7.6/x11_file_list.txt
index 254ac7a6..f868bb64 100644
--- a/xorg/X11R7.6/x11_file_list.txt
+++ b/xorg/X11R7.6/x11_file_list.txt
@@ -12,7 +12,7 @@ libxml2-sources-2.7.8.tar.gz : libxml2-2.7.8
libpng-1.2.46.tar.gz : libpng-1.2.46 :
pixman-0.30.0.tar.bz2 : pixman-0.30.0 : --disable-gtk
freetype-2.4.6.tar.bz2 : freetype-2.4.6 :
-fontconfig-2.8.0.tar.gz : fontconfig-2.8.0 :
+fontconfig-2.8.0.tar.gz : fontconfig-2.8.0 : --disable-docs
cairo-1.8.8.tar.gz : cairo-1.8.8 :
expat-2.0.1.tar.gz : expat-2.0.1 :
xextproto-7.1.2.tar.bz2 : xextproto-7.1.2 :
diff --git a/xorg/tests/randr/trandr.c b/xorg/tests/randr/trandr.c
index 4f7be527..6c51a000 100644
--- a/xorg/tests/randr/trandr.c
+++ b/xorg/tests/randr/trandr.c
@@ -143,4 +143,4 @@ main(int argc, char **argv)
}
return 0;
-} \ No newline at end of file
+}
diff --git a/xorg/tests/xdemo/yosemite.bmp b/xorg/tests/xdemo/yosemite.bmp
index c64aba75..da2e8eed 100644
--- a/xorg/tests/xdemo/yosemite.bmp
+++ b/xorg/tests/xdemo/yosemite.bmp
Binary files differ
diff --git a/xorgxrdp b/xorgxrdp
-Subproject f72dda9984ca68217f2ed228f83571be48b5021
+Subproject 3379d2c483599b00b1af34a2f6ae5bbc358299a
diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am
index 8a8b36eb..308f01a4 100644
--- a/xrdp/Makefile.am
+++ b/xrdp/Makefile.am
@@ -11,26 +11,19 @@ else
EXTRA_DEFINES = -DXRDP_NODEBUG
endif
-if GOT_PREFIX
-EXTRA_INCLUDES += -I$(prefix)/include
-EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib
-endif
-
if XRDP_RFXCODEC
EXTRA_DEFINES += -DXRDP_RFXCODEC
EXTRA_INCLUDES += -I$(top_srcdir)/librfxcodec/include
EXTRA_LIBS += $(top_srcdir)/librfxcodec/src/librfxencode.a
endif
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_LIB_PATH=\"${libdir}\" \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+ $(EXTRA_DEFINES) \
-I$(top_builddir) \
-I$(top_srcdir)/common \
-I$(top_srcdir)/libxrdp \
diff --git a/xrdp/ad256.bmp b/xrdp/ad256.bmp
index 5e1946c0..5e1946c0 100755..100644
--- a/xrdp/ad256.bmp
+++ b/xrdp/ad256.bmp
Binary files differ
diff --git a/xrdp/lang.c b/xrdp/lang.c
index de81c681..fa284112 100644
--- a/xrdp/lang.c
+++ b/xrdp/lang.c
@@ -263,7 +263,7 @@ get_keymaps(int keylayout, struct xrdp_keymap *keymap)
if (g_memcmp(lkeymap, keymap, sizeof(struct xrdp_keymap)) != 0)
{
log_message(LOG_LEVEL_WARNING,
- "local keymap file for 0x%4.4x found and dosen't match "
+ "local keymap file for 0x%4.4x found and doesn't match "
"built in keymap, using local keymap file", keylayout);
}
diff --git a/xrdp/rdp-scan-codes.txt b/xrdp/rdp-scan-codes.txt
index 938ce4c5..5fe06e53 100644
--- a/xrdp/rdp-scan-codes.txt
+++ b/xrdp/rdp-scan-codes.txt
@@ -3,7 +3,7 @@ complete rdp key code listing
en-us
-4000s in the down flags columm is from repeating keys(holding a key down)
+4000s in the down flags column is from repeating keys(holding a key down)
When holding a key down, the down flags repeat but the up flags only
come once at the end.
Rdesktop does not do this as of yet. It always sends down and up
diff --git a/xrdp/sans-10.fv1 b/xrdp/sans-10.fv1
index 047870fa..047870fa 100755..100644
--- a/xrdp/sans-10.fv1
+++ b/xrdp/sans-10.fv1
Binary files differ
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c
index 24953c2d..690508cb 100644
--- a/xrdp/xrdp.c
+++ b/xrdp/xrdp.c
@@ -401,39 +401,6 @@ main(int argc, char **argv)
g_exit(0);
}
- /* starting logging subsystem */
- error = log_start(cfg_file, "XRDP");
-
- if (error != LOG_STARTUP_OK)
- {
- switch (error)
- {
- case LOG_ERROR_MALLOC:
- g_writeln("error on malloc. cannot start logging. quitting.");
- break;
- case LOG_ERROR_FILE_OPEN:
- g_writeln("error opening log file [%s]. quitting.",
- getLogFile(text, 255));
- break;
- default:
- g_writeln("log_start error");
- break;
- }
-
- g_deinit();
- g_exit(1);
- }
-
-
-
- if (g_file_exist(pid_file)) /* xrdp.pid */
- {
- g_writeln("It looks like xrdp is allready running,");
- g_writeln("if not delete the xrdp.pid file and try again");
- g_deinit();
- g_exit(0);
- }
-
if (startup_params->kill)
{
g_writeln("stopping xrdp");
@@ -469,6 +436,39 @@ main(int argc, char **argv)
g_exit(0);
}
+ /* starting logging subsystem */
+ error = log_start(cfg_file, "XRDP");
+
+ if (error != LOG_STARTUP_OK)
+ {
+ switch (error)
+ {
+ case LOG_ERROR_MALLOC:
+ g_writeln("error on malloc. cannot start logging. quitting.");
+ break;
+ case LOG_ERROR_FILE_OPEN:
+ g_writeln("error opening log file [%s]. quitting.",
+ getLogFile(text, 255));
+ break;
+ default:
+ g_writeln("log_start error");
+ break;
+ }
+
+ g_deinit();
+ g_exit(1);
+ }
+
+
+
+ if (g_file_exist(pid_file)) /* xrdp.pid */
+ {
+ g_writeln("It looks like xrdp is already running,");
+ g_writeln("if not delete the xrdp.pid file and try again");
+ g_deinit();
+ g_exit(0);
+ }
+
if (startup_params->no_daemon)
{
no_daemon = 1;
diff --git a/xrdp/xrdp.h b/xrdp/xrdp.h
index b23cdaf0..1199d01a 100644
--- a/xrdp/xrdp.h
+++ b/xrdp/xrdp.h
@@ -381,6 +381,8 @@ int APP_CC
xrdp_mm_check_chan(struct xrdp_mm *self);
int APP_CC
xrdp_mm_check_wait_objs(struct xrdp_mm* self);
+int APP_CC
+xrdp_mm_frame_ack(struct xrdp_mm *self, int frame_id);
int DEFAULT_CC
server_begin_update(struct xrdp_mod* mod);
int DEFAULT_CC
@@ -444,7 +446,7 @@ server_set_pen(struct xrdp_mod* mod, int style, int width);
int DEFAULT_CC
server_draw_line(struct xrdp_mod* mod, int x1, int y1, int x2, int y2);
int DEFAULT_CC
-server_add_char(struct xrdp_mod* mod, int font, int charactor,
+server_add_char(struct xrdp_mod* mod, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int DEFAULT_CC
@@ -509,6 +511,6 @@ server_monitored_desktop(struct xrdp_mod* mod,
struct rail_monitored_desktop_order* mdo,
int flags);
int DEFAULT_CC
-server_add_char_alpha(struct xrdp_mod* mod, int font, int charactor,
+server_add_char_alpha(struct xrdp_mod* mod, int font, int character,
int offset, int baseline,
int width, int height, char* data);
diff --git a/xrdp/xrdp256.bmp b/xrdp/xrdp256.bmp
index 6191514e..6191514e 100755..100644
--- a/xrdp/xrdp256.bmp
+++ b/xrdp/xrdp256.bmp
Binary files differ
diff --git a/xrdp/xrdp_bitmap.c b/xrdp/xrdp_bitmap.c
index aafc19f2..3fd0fbb7 100644
--- a/xrdp/xrdp_bitmap.c
+++ b/xrdp/xrdp_bitmap.c
@@ -165,7 +165,7 @@ xrdp_bitmap_create_with_data(int width, int height,
if (((bpp >= 24) && (data_as_int & 3)) ||
(((bpp == 15) || (bpp == 16)) && (data_as_int & 1)))
{
- /* got to copy data here, it's not alligned
+ /* got to copy data here, it's not aligned
other calls in this file assume alignment */
Bpp = 4;
switch (bpp)
diff --git a/xrdp/xrdp_mm.c b/xrdp/xrdp_mm.c
index 2af2e86d..26e5c028 100644
--- a/xrdp/xrdp_mm.c
+++ b/xrdp/xrdp_mm.c
@@ -578,6 +578,10 @@ xrdp_mm_setup_mod2(struct xrdp_mm *self)
else
{
xrdp_wm_show_log(self->wm);
+ if (self->wm->hide_log_window)
+ {
+ rv = 1;
+ }
}
}
@@ -1231,6 +1235,10 @@ xrdp_mm_process_login_response(struct xrdp_mm *self, struct stream *s)
log_message(LOG_LEVEL_INFO,"xrdp_mm_process_login_response: "
"login failed");
xrdp_wm_show_log(self->wm);
+ if (self->wm->hide_log_window)
+ {
+ rv = 1;
+ }
}
cleanup_sesman_connection(self);
@@ -1450,7 +1458,7 @@ access_control(char *username, char *password, char *srv)
if (reply > 0)
{
/* We wait in 5 sec for a reply from sesman*/
- if (g_tcp_can_recv(socket, 5000))
+ if (g_sck_can_recv(socket, 5000))
{
reply = g_tcp_recv(socket, in_s->end, 500, 0);
@@ -1975,7 +1983,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
if (xrdp_mm_setup_mod2(self) == 0)
{
xrdp_wm_set_login_mode(self->wm, 10);
- rv = 0; /*sucess*/
+ rv = 0; /*success*/
}
else
{
@@ -2006,7 +2014,7 @@ xrdp_mm_connect(struct xrdp_mm *self)
xrdp_mm_connect_chansrv(self, "", chansrvport);
}
- log_message(LOG_LEVEL_DEBUG,"returnvalue from xrdp_mm_connect %d", rv);
+ log_message(LOG_LEVEL_DEBUG,"return value from xrdp_mm_connect %d", rv);
return rv;
}
@@ -2155,6 +2163,11 @@ xrdp_mm_check_wait_objs(struct xrdp_mm *self)
if (trans_check_wait_objs(self->sesman_trans) != 0)
{
self->delete_sesman_trans = 1;
+ if (self->wm->hide_log_window)
+ {
+ /* if hide_log_window, this is fatal */
+ rv = 1;
+ }
}
}
@@ -2820,7 +2833,7 @@ server_draw_line(struct xrdp_mod *mod, int x1, int y1, int x2, int y2)
/*****************************************************************************/
int DEFAULT_CC
-server_add_char(struct xrdp_mod *mod, int font, int charactor,
+server_add_char(struct xrdp_mod *mod, int font, int character,
int offset, int baseline,
int width, int height, char *data)
{
@@ -2834,7 +2847,7 @@ server_add_char(struct xrdp_mod *mod, int font, int charactor,
fi.data = data;
fi.bpp = 1;
return libxrdp_orders_send_font(((struct xrdp_wm *)mod->wm)->session,
- &fi, font, charactor);
+ &fi, font, character);
}
/*****************************************************************************/
@@ -3457,7 +3470,7 @@ server_monitored_desktop(struct xrdp_mod *mod,
/*****************************************************************************/
int DEFAULT_CC
-server_add_char_alpha(struct xrdp_mod* mod, int font, int charactor,
+server_add_char_alpha(struct xrdp_mod* mod, int font, int character,
int offset, int baseline,
int width, int height, char* data)
{
@@ -3471,5 +3484,5 @@ server_add_char_alpha(struct xrdp_mod* mod, int font, int charactor,
fi.data = data;
fi.bpp = 8;
return libxrdp_orders_send_font(((struct xrdp_wm*)mod->wm)->session,
- &fi, font, charactor);
+ &fi, font, character);
}
diff --git a/xrdp/xrdp_types.h b/xrdp/xrdp_types.h
index 5551e58d..a2a4d5fd 100644
--- a/xrdp/xrdp_types.h
+++ b/xrdp/xrdp_types.h
@@ -75,7 +75,7 @@ struct xrdp_mod
int (*server_set_pen)(struct xrdp_mod* v, int style,
int width);
int (*server_draw_line)(struct xrdp_mod* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct xrdp_mod* v, int font, int charactor,
+ int (*server_add_char)(struct xrdp_mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct xrdp_mod* v, int font,
@@ -125,7 +125,7 @@ struct xrdp_mod
int flags);
int (*server_set_pointer_ex)(struct xrdp_mod* v, int x, int y, char* data,
char* mask, int bpp);
- int (*server_add_char_alpha)(struct xrdp_mod* mod, int font, int charactor,
+ int (*server_add_char_alpha)(struct xrdp_mod* mod, int font, int character,
int offset, int baseline,
int width, int height, char* data);
diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c
index e3af0f05..806a2532 100644
--- a/xrdp/xrdp_wm.c
+++ b/xrdp/xrdp_wm.c
@@ -560,7 +560,7 @@ xrdp_wm_init(struct xrdp_wm *self)
xrdp_wm_load_static_pointers(self);
self->screen->bg_color = self->xrdp_config->cfg_globals.ls_top_window_bg_color;
- if (self->session->client_info->rdp_autologin)
+ if (self->session->client_info->rdp_autologin || self->hide_log_window)
{
/*
* NOTE: this should eventually be accessed from self->xrdp_config
@@ -576,7 +576,8 @@ xrdp_wm_init(struct xrdp_wm *self)
values->auto_free = 1;
/* look for module name to be loaded */
- if (autorun_name[0] != 0) {
+ if (autorun_name[0] != 0)
+ {
/* if autorun is configured in xrdp.ini, we enforce that module to be loaded */
g_strncpy(section_name, autorun_name, 255);
}
@@ -1687,7 +1688,7 @@ xrdp_wm_process_channel_data(struct xrdp_wm *self,
}
/******************************************************************************/
-/* this is the callbacks comming from libxrdp.so */
+/* this is the callbacks coming from libxrdp.so */
int DEFAULT_CC
callback(long id, int msg, long param1, long param2, long param3, long param4)
{
@@ -1759,7 +1760,7 @@ xrdp_wm_login_mode_changed(struct xrdp_wm *self)
if (self->login_mode == 0)
{
- /* this is the inital state of the login window */
+ /* this is the initial state of the login window */
xrdp_wm_set_login_mode(self, 1); /* put the wm in login mode */
list_clear(self->log);
xrdp_wm_delete_all_childs(self);
diff --git a/xrdp/xrdpwin.c b/xrdp/xrdpwin.c
index ee78273b..f3ef1074 100644
--- a/xrdp/xrdpwin.c
+++ b/xrdp/xrdpwin.c
@@ -369,7 +369,7 @@ main(int argc, char **argv)
g_exit(0);
}
- /* check if service is allready installed */
+ /* check if service is already installed */
sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS);
if (sc_ser == 0)
@@ -383,7 +383,7 @@ main(int argc, char **argv)
}
else
{
- g_writeln("error service is allready installed");
+ g_writeln("error service is already installed");
CloseServiceHandle(sc_ser);
CloseServiceHandle(sc_man);
g_exit(0);
@@ -405,7 +405,7 @@ main(int argc, char **argv)
g_exit(0);
}
- /* check if service is allready installed */
+ /* check if service is already installed */
sc_ser = OpenService(sc_man, "xrdp", SERVICE_ALL_ACCESS);
if (sc_ser == 0)
@@ -540,7 +540,7 @@ main(int argc, char **argv)
if (g_file_exist(pid_file)) /* xrdp.pid */
{
- g_writeln("It looks like xrdp is allready running,");
+ g_writeln("It looks like xrdp is already running,");
g_writeln("if not delete the xrdp.pid file and try again");
g_exit(0);
}
diff --git a/xrdpapi/Makefile.am b/xrdpapi/Makefile.am
index 88ef100e..8107ffeb 100644
--- a/xrdpapi/Makefile.am
+++ b/xrdpapi/Makefile.am
@@ -5,10 +5,8 @@ EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =
-AM_CFLAGS = \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+AM_CPPFLAGS = \
+ $(EXTRA_DEFINES) \
$(EXTRA_INCLUDES)
lib_LTLIBRARIES = \
diff --git a/xrdpapi/xrdpapi.c b/xrdpapi/xrdpapi.c
index 7e9eaa0c..974a094c 100644
--- a/xrdpapi/xrdpapi.c
+++ b/xrdpapi/xrdpapi.c
@@ -126,7 +126,7 @@ WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName,
/* we use unix domain socket to communicate with chansrv */
if ((wts->fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
{
- g_free(wts);
+ free(wts);
return NULL;
}
@@ -162,6 +162,14 @@ WTSVirtualChannelOpenEx(unsigned int SessionId, const char *pVirtualName,
return wts;
}
+/*
+ * Prevent receiving SIGPIPE on disconnect using either MSG_NOSIGNAL (Linux)
+ * or SO_NOSIGPIPE (Mac OS X)
+ */
+#if !defined(MSG_NOSIGNAL)
+#define MSG_NOSIGNAL 0
+#endif
+
/*****************************************************************************/
static int
mysend(int sck, const void* adata, int bytes)
@@ -170,6 +178,11 @@ mysend(int sck, const void* adata, int bytes)
int error;
const char* data;
+#if defined(SO_NOSIGPIPE)
+ const int on = 1;
+ setsockopt(sck, SOL_SOCKET, SO_NOSIGPIPE, &on, sizeof(on));
+#endif
+
data = (const char*)adata;
sent = 0;
while (sent < bytes)
diff --git a/xrdpvr/Makefile.am b/xrdpvr/Makefile.am
index 158baa90..f232ce41 100644
--- a/xrdpvr/Makefile.am
+++ b/xrdpvr/Makefile.am
@@ -5,10 +5,8 @@ EXTRA_INCLUDES =
EXTRA_LIBS =
EXTRA_FLAGS =
-AM_CFLAGS = \
- $(EXTRA_DEFINES)
-
-INCLUDES = \
+AM_CPPFLAGS = \
+ $(EXTRA_DEFINES) \
$(EXTRA_INCLUDES)
lib_LTLIBRARIES = \
diff --git a/xup/Makefile.am b/xup/Makefile.am
index 544c957a..d7017b42 100644
--- a/xup/Makefile.am
+++ b/xup/Makefile.am
@@ -1,12 +1,10 @@
EXTRA_DIST = xup.h
-AM_CFLAGS = \
+AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
- -DXRDP_PID_PATH=\"${localstatedir}/run\"
-
-INCLUDES = \
+ -DXRDP_PID_PATH=\"${localstatedir}/run\" \
-I$(top_srcdir)/common
lib_LTLIBRARIES = \
diff --git a/xup/xup.c b/xup/xup.c
index 77081fea..21fdedd5 100644
--- a/xup/xup.c
+++ b/xup/xup.c
@@ -86,6 +86,7 @@ lib_data_in(struct trans *trans)
struct stream *s;
int len;
+ LLOGLN(10, ("lib_data_in:"));
if (trans == 0)
{
return 1;
@@ -210,6 +211,8 @@ lib_mod_connect(struct mod *mod)
error = -1;
if (trans_connect(mod->trans, mod->ip, con_port, 3000) == 0)
{
+ LLOGLN(0, ("lib_mod_connect: connected to Xserver"
+ "(Xorg or X11rdp) sck %d", mod->trans->sck));
error = 0;
}
@@ -794,7 +797,7 @@ process_server_add_char(struct mod *mod, struct stream *s)
{
int rv;
int font;
- int charactor;
+ int character;
int x;
int y;
int cx;
@@ -803,14 +806,14 @@ process_server_add_char(struct mod *mod, struct stream *s)
char *bmpdata;
in_uint16_le(s, font);
- in_uint16_le(s, charactor);
+ in_uint16_le(s, character);
in_sint16_le(s, x);
in_sint16_le(s, y);
in_uint16_le(s, cx);
in_uint16_le(s, cy);
in_uint16_le(s, len_bmpdata);
in_uint8p(s, bmpdata, len_bmpdata);
- rv = mod->server_add_char(mod, font, charactor, x, y, cx, cy, bmpdata);
+ rv = mod->server_add_char(mod, font, character, x, y, cx, cy, bmpdata);
return rv;
}
@@ -822,7 +825,7 @@ process_server_add_char_alpha(struct mod *mod, struct stream *s)
{
int rv;
int font;
- int charactor;
+ int character;
int x;
int y;
int cx;
@@ -831,14 +834,14 @@ process_server_add_char_alpha(struct mod *mod, struct stream *s)
char *bmpdata;
in_uint16_le(s, font);
- in_uint16_le(s, charactor);
+ in_uint16_le(s, character);
in_sint16_le(s, x);
in_sint16_le(s, y);
in_uint16_le(s, cx);
in_uint16_le(s, cy);
in_uint16_le(s, len_bmpdata);
in_uint8p(s, bmpdata, len_bmpdata);
- rv = mod->server_add_char_alpha(mod, font, charactor, x, y, cx, cy,
+ rv = mod->server_add_char_alpha(mod, font, character, x, y, cx, cy,
bmpdata);
return rv;
}
@@ -1247,6 +1250,7 @@ lib_mod_process_orders(struct mod *mod, int type, struct stream *s)
{
int rv;
+ LLOGLN(10, ("lib_mod_process_orders: type %d", type));
rv = 0;
switch (type)
{
@@ -1384,12 +1388,14 @@ lib_mod_process_message(struct mod *mod, struct stream *s)
int type;
char *phold;
+ LLOGLN(10, ("lib_mod_process_message:"));
rv = 0;
if (rv == 0)
{
in_uint16_le(s, type);
in_uint16_le(s, num_orders);
in_uint32_le(s, len);
+ LLOGLN(10, ("lib_mod_process_message: type %d", type));
if (type == 1) /* original order list */
{
diff --git a/xup/xup.h b/xup/xup.h
index 520cc038..70cdcf27 100644
--- a/xup/xup.h
+++ b/xup/xup.h
@@ -71,7 +71,7 @@ struct mod
int (*server_set_pen)(struct mod* v, int style,
int width);
int (*server_draw_line)(struct mod* v, int x1, int y1, int x2, int y2);
- int (*server_add_char)(struct mod* v, int font, int charactor,
+ int (*server_add_char)(struct mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_draw_text)(struct mod* v, int font,
@@ -121,7 +121,7 @@ struct mod
int flags);
int (*server_set_cursor_ex)(struct mod* v, int x, int y, char* data,
char* mask, int bpp);
- int (*server_add_char_alpha)(struct mod* v, int font, int charactor,
+ int (*server_add_char_alpha)(struct mod* v, int font, int character,
int offset, int baseline,
int width, int height, char* data);
int (*server_create_os_surface_bpp)(struct mod* v, int rdpindex,