Browse Source

New upstream version 0.9.0~20160920+gitf0c0976

tags/upstream/0.9.0_20160920+gitf0c0976^0
Dominik George 4 years ago
parent
commit
78efbcee6f
100 changed files with 5035 additions and 8254 deletions
  1. +10
    -1
      common/Makefile.am
  2. +22
    -1
      common/arch.h
  3. +3
    -9
      common/log.c
  4. +4
    -4
      common/log.h
  5. +142
    -95
      common/os_calls.c
  6. +13
    -17
      common/os_calls.h
  7. +2549
    -0
      common/pixman-region.c
  8. +76
    -0
      common/pixman-region.h
  9. +77
    -0
      common/pixman-region16.c
  10. +21
    -7
      common/ssl_calls.c
  11. +5
    -4
      common/ssl_calls.h
  12. +7
    -6
      common/trans.c
  13. +4
    -3
      common/trans.h
  14. +2
    -0
      common/xrdp_client_info.h
  15. +19
    -0
      configure.ac
  16. +155
    -136
      docs/man/sesman.ini.5
  17. +1
    -1
      docs/man/xrdp-dis.1
  18. +3
    -3
      docs/man/xrdp.ini.5
  19. +4
    -4
      faq-general.txt
  20. +4
    -0
      genkeymap/dump-keymaps.sh
  21. +4
    -1
      genkeymap/genkeymap.c
  22. +1
    -0
      instfiles/Makefile.am
  23. +1055
    -0
      instfiles/km-0809.ini
  24. +1
    -1
      keygen/keygen.c
  25. +0
    -31
      librfxcodec/.gitignore
  26. +12
    -0
      librfxcodec/Makefile
  27. +0
    -6
      librfxcodec/Makefile.am
  28. +0
    -137
      librfxcodec/acinclude.m4
  29. +0
    -36
      librfxcodec/bootstrap
  30. +0
    -55
      librfxcodec/configure.ac
  31. +0
    -40
      librfxcodec/include/rfxcodec_common.h
  32. +0
    -33
      librfxcodec/include/rfxcodec_decode.h
  33. +23
    -19
      librfxcodec/include/rfxcodec_encode.h
  34. +48
    -0
      librfxcodec/src/Makefile
  35. +0
    -55
      librfxcodec/src/Makefile.am
  36. +3
    -7
      librfxcodec/src/amd64/cpuid_amd64.asm
  37. +5
    -31
      librfxcodec/src/amd64/funcs_amd64.h
  38. +0
    -33
      librfxcodec/src/amd64/rfxcodec_encode_diff_rlgr1_amd64_sse2.asm
  39. +0
    -26
      librfxcodec/src/amd64/rfxcodec_encode_diff_rlgr3_amd64_sse2.asm
  40. +0
    -1499
      librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse2.asm
  41. +0
    -1367
      librfxcodec/src/amd64/rfxcodec_encode_dwt_shift_amd64_sse41.asm
  42. +22
    -0
      librfxcodec/src/amd64/rfxdwt_amd64_sse2.asm
  43. +21
    -0
      librfxcodec/src/amd64/rfxrlgr1_amd64.asm
  44. +21
    -0
      librfxcodec/src/amd64/rfxrlgr3_amd64.asm
  45. +0
    -57
      librfxcodec/src/nasm_lt.sh
  46. +1
    -3
      librfxcodec/src/rfxcommon.h
  47. +58
    -211
      librfxcodec/src/rfxcompose.c
  48. +4
    -4
      librfxcodec/src/rfxcompose.h
  49. +0
    -1
      librfxcodec/src/rfxconstants.h
  50. +19
    -122
      librfxcodec/src/rfxencode.c
  51. +10
    -13
      librfxcodec/src/rfxencode.h
  52. +0
    -279
      librfxcodec/src/rfxencode_alpha.c
  53. +0
    -28
      librfxcodec/src/rfxencode_alpha.h
  54. +7
    -20
      librfxcodec/src/rfxencode_dwt.c
  55. +1
    -1
      librfxcodec/src/rfxencode_dwt.h
  56. +13
    -47
      librfxcodec/src/rfxencode_quantization.c
  57. +1
    -1
      librfxcodec/src/rfxencode_quantization.h
  58. +1
    -3
      librfxcodec/src/rfxencode_rlgr1.c
  59. +1
    -1
      librfxcodec/src/rfxencode_rlgr1.h
  60. +1
    -3
      librfxcodec/src/rfxencode_rlgr3.c
  61. +1
    -1
      librfxcodec/src/rfxencode_rlgr3.h
  62. +65
    -562
      librfxcodec/src/rfxencode_tile.c
  63. +21
    -48
      librfxcodec/src/rfxencode_tile.h
  64. +0
    -4
      librfxcodec/src/x86/cpuid_x86.asm
  65. +5
    -26
      librfxcodec/src/x86/funcs_x86.h
  66. +0
    -0
      librfxcodec/src/x86/readme.txt
  67. +0
    -30
      librfxcodec/src/x86/rfxcodec_encode_diff_rlgr1_x86_sse2.asm
  68. +0
    -30
      librfxcodec/src/x86/rfxcodec_encode_diff_rlgr3_x86_sse2.asm
  69. +0
    -1529
      librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse2.asm
  70. +0
    -1397
      librfxcodec/src/x86/rfxcodec_encode_dwt_shift_x86_sse41.asm
  71. +26
    -0
      librfxcodec/src/x86/rfxdwt_x86_sse2.asm
  72. +25
    -0
      librfxcodec/src/x86/rfxrlgr1_x86.asm
  73. +25
    -0
      librfxcodec/src/x86/rfxrlgr3_x86.asm
  74. +22
    -0
      librfxcodec/tests/Makefile
  75. +0
    -25
      librfxcodec/tests/Makefile.am
  76. +28
    -47
      librfxcodec/tests/rfxcodectest.c
  77. +4
    -4
      libxrdp/libxrdp.c
  78. +1
    -1
      libxrdp/libxrdpinc.h
  79. +1
    -1
      libxrdp/xrdp_mcs.c
  80. +10
    -10
      libxrdp/xrdp_orders.c
  81. +33
    -6
      libxrdp/xrdp_rdp.c
  82. +18
    -5
      libxrdp/xrdp_sec.c
  83. +67
    -0
      m4/ax_append_compile_flags.m4
  84. +74
    -0
      m4/ax_check_compile_flag.m4
  85. +61
    -0
      m4/ax_type_socklen_t.m4
  86. +7
    -5
      mc/mc.c
  87. +2
    -2
      mc/mc.h
  88. +18
    -15
      neutrinordp/xrdp-neutrinordp.c
  89. +2
    -2
      neutrinordp/xrdp-neutrinordp.h
  90. +4
    -3
      prog_std.txt
  91. +7
    -5
      rdp/rdp.c
  92. +2
    -2
      rdp/rdp.h
  93. +8
    -8
      rdp/rdp_rdp.c
  94. +5
    -0
      sesman/chansrv/Makefile.am
  95. +12
    -11
      sesman/chansrv/chansrv.c
  96. +6
    -1
      sesman/chansrv/chansrv_fuse.c
  97. +3
    -2
      sesman/chansrv/clipboard.c
  98. +2
    -1
      sesman/chansrv/clipboard_common.h
  99. +6
    -1
      sesman/chansrv/clipboard_file.c
  100. +10
    -8
      sesman/chansrv/devredir.c

+ 10
- 1
common/Makefile.am View File

@@ -1,3 +1,11 @@
if XRDP_PIXMAN
PIXMAN_SOURCES =
else
PIXMAN_SOURCES = pixman-region16.c pixman-region.h
endif

EXTRA_DIST = pixman-region.c

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
@@ -36,7 +44,8 @@ libcommon_la_SOURCES = \
trans.h \
xrdp_client_info.h \
xrdp_constants.h \
xrdp_rail.h
xrdp_rail.h \
$(PIXMAN_SOURCES)

libcommon_la_LIBADD = \
-lcrypto \


+ 22
- 1
common/arch.h View File

@@ -19,6 +19,10 @@
#if !defined(ARCH_H)
#define ARCH_H

#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif

/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
in the makefile to override */

@@ -109,7 +113,6 @@ typedef __int64 tbus;
#else
typedef long tbus;
#endif
typedef tbus thandle;
typedef tbus tintptr;
/* wide char, socket */
#if defined(_WIN32)
@@ -125,4 +128,22 @@ typedef signed long long tsi64;
#endif
#endif /* DEFINED_Ts */

/* format string verification */
#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT)
#define printflike(arg_format, arg_first_check) \
__attribute__((__format__(__printf__, arg_format, arg_first_check)))
#else
#define printflike(arg_format, arg_first_check)
#endif

/* module interface */
#ifdef __cplusplus
extern "C" {
#endif
tintptr mod_init();
int mod_exit(tintptr);
#ifdef __cplusplus
}
#endif

#endif

+ 3
- 9
common/log.c View File

@@ -212,12 +212,6 @@ internal_log_end(struct log_config *l_cfg)
l_cfg->log_file = 0;
}

if (0 != l_cfg->program_name)
{
g_free(l_cfg->program_name);
l_cfg->program_name = 0;
}

ret = LOG_STARTUP_OK;
return ret;
}
@@ -336,7 +330,7 @@ internal_config_read_logging(int file, struct log_config *lc,
list_clear(param_n);

/* setting defaults */
lc->program_name = g_strdup(applicationName);
lc->program_name = applicationName;
lc->log_file = 0;
lc->fd = 0;
lc->log_level = LOG_LEVEL_DEBUG;
@@ -401,7 +395,7 @@ enum logReturns DEFAULT_CC
internalInitAndAllocStruct(void)
{
enum logReturns ret = LOG_GENERAL_ERROR;
g_staticLogConfig = g_malloc(sizeof(struct log_config), 1);
g_staticLogConfig = g_new0(struct log_config, 1);

if (g_staticLogConfig != NULL)
{
@@ -455,7 +449,7 @@ log_start_from_param(const struct log_config *iniParams)
g_staticLogConfig->log_level = iniParams->log_level;
g_staticLogConfig->log_lock = iniParams->log_lock;
g_staticLogConfig->log_lock_attr = iniParams->log_lock_attr;
g_staticLogConfig->program_name = g_strdup(iniParams->program_name);
g_staticLogConfig->program_name = iniParams->program_name;
g_staticLogConfig->syslog_level = iniParams->syslog_level;
ret = internal_log_start(g_staticLogConfig);



+ 4
- 4
common/log.h View File

@@ -65,12 +65,12 @@ enum logReturns

struct log_config
{
char *program_name;
const char *program_name;
char *log_file;
int fd;
unsigned int log_level;
enum logLevels log_level;
int enable_syslog;
unsigned int syslog_level;
enum logLevels syslog_level;
pthread_mutex_t log_lock;
pthread_mutexattr_t log_lock_attr;
};
@@ -171,7 +171,7 @@ log_end(void);
* @return
*/
enum logReturns DEFAULT_CC
log_message(const enum logLevels lvl, const char *msg, ...);
log_message(const enum logLevels lvl, const char *msg, ...) printflike(2, 3);

/**
*


+ 142
- 95
common/os_calls.c View File

@@ -136,7 +136,21 @@ g_init(const char *app_name)

WSAStartup(2, &wsadata);
#endif
setlocale(LC_CTYPE, "");

/* In order to get g_mbstowcs and g_wcstombs to work properly with
UTF-8 non-ASCII characters, LC_CTYPE cannot be "C" or blank.
To select UTF-8 encoding without specifying any countries/languages,
"C.UTF-8" is used but provided in few systems.

See also: https://sourceware.org/glibc/wiki/Proposals/C.UTF-8 */
char *lc_ctype;
lc_ctype = setlocale(LC_CTYPE, "C.UTF-8");
if (lc_ctype == NULL)
{
/* use en_US.UTF-8 instead if not available */
setlocale(LC_CTYPE, "en_US.UTF-8");
}

g_mk_temp_dir(app_name);
}

@@ -207,14 +221,17 @@ g_sprintf(char *dest, const char *format, ...)
}

/*****************************************************************************/
void DEFAULT_CC
int DEFAULT_CC
g_snprintf(char *dest, int len, const char *format, ...)
{
int err;
va_list ap;

va_start(ap, format);
vsnprintf(dest, len, format, ap);
err = vsnprintf(dest, len, format, ap);
va_end(ap);

return err;
}

/*****************************************************************************/
@@ -315,13 +332,8 @@ int APP_CC
g_tcp_set_no_delay(int sck)
{
int ret = 1; /* error */
#if defined(_WIN32)
int option_value;
int option_len;
#else
int option_value;
unsigned int option_len;
#endif
socklen_t option_len;

option_len = sizeof(option_value);

@@ -359,13 +371,8 @@ int APP_CC
g_tcp_set_keepalive(int sck)
{
int ret = 1; /* error */
#if defined(_WIN32)
int option_value;
int option_len;
#else
int option_value;
unsigned int option_len;
#endif
socklen_t option_len;

option_len = sizeof(option_value);

@@ -399,17 +406,13 @@ g_tcp_set_keepalive(int sck)

/*****************************************************************************/
/* returns a newly created socket or -1 on error */
/* in win32 a socket is an unsigned int, in linux, its an int */
/* in win32 a socket is an unsigned int, in linux, it's an int */
int APP_CC
g_tcp_socket(void)
{
int rv;
int option_value;
#if defined(_WIN32)
int option_len;
#else
unsigned int option_len;
#endif
socklen_t option_len;

#if defined(XRDP_ENABLE_IPV6)
rv = (int)socket(AF_INET6, SOCK_STREAM, 0);
@@ -483,11 +486,7 @@ int APP_CC
g_sck_set_send_buffer_bytes(int sck, int bytes)
{
int option_value;
#if defined(_WIN32)
int option_len;
#else
unsigned int option_len;
#endif
socklen_t option_len;

option_value = bytes;
option_len = sizeof(option_value);
@@ -505,11 +504,7 @@ int APP_CC
g_sck_get_send_buffer_bytes(int sck, int *bytes)
{
int option_value;
#if defined(_WIN32)
int option_len;
#else
unsigned int option_len;
#endif
socklen_t option_len;

option_value = 0;
option_len = sizeof(option_value);
@@ -528,11 +523,7 @@ int APP_CC
g_sck_set_recv_buffer_bytes(int sck, int bytes)
{
int option_value;
#if defined(_WIN32)
int option_len;
#else
unsigned int option_len;
#endif
socklen_t option_len;

option_value = bytes;
option_len = sizeof(option_value);
@@ -550,11 +541,7 @@ int APP_CC
g_sck_get_recv_buffer_bytes(int sck, int *bytes)
{
int option_value;
#if defined(_WIN32)
int option_len;
#else
unsigned int option_len;
#endif
socklen_t option_len;

option_value = 0;
option_len = sizeof(option_value);
@@ -584,11 +571,7 @@ int APP_CC
g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid)
{
#if defined(SO_PEERCRED)
#if defined(_WIN32)
int ucred_length;
#else
unsigned int ucred_length;
#endif
socklen_t ucred_length;
struct myucred
{
pid_t pid;
@@ -645,19 +628,85 @@ g_sck_get_peer_cred(int sck, int *pid, int *uid, int *gid)
void APP_CC
g_sck_close(int sck)
{
char ip[256];

if (sck == 0)
{
return;
}
#if defined(_WIN32)
closesocket(sck);
#else
g_write_ip_address(sck, ip, 255);
log_message(LOG_LEVEL_INFO, "An established connection closed to "
"endpoint: %s", ip);
close(sck);
char sockname[128];
union
{
struct sockaddr sock_addr;
struct sockaddr_in sock_addr_in;
#if defined(XRDP_ENABLE_IPV6)
struct sockaddr_in6 sock_addr_in6;
#endif
} sock_info;
socklen_t sock_len = sizeof(sock_info);

memset(&sock_info, 0, sizeof(sock_info));

if (getsockname(sck, &sock_info.sock_addr, &sock_len) == 0)
{
switch (sock_info.sock_addr.sa_family)
{
case AF_INET:
{
struct sockaddr_in *sock_addr_in = &sock_info.sock_addr_in;

g_snprintf(sockname, sizeof(sockname), "AF_INET %s:%d",
inet_ntoa(sock_addr_in->sin_addr),
ntohs(sock_addr_in->sin_port));
break;
}

#if defined(XRDP_ENABLE_IPV6)

case AF_INET6:
{
char addr[48];
struct sockaddr_in6 *sock_addr_in6 = &sock_info.sock_addr_in6;

g_snprintf(sockname, sizeof(sockname), "AF_INET6 %s:%d",
inet_ntop(sock_addr_in6->sin6_family,
&sock_addr_in6->sin6_addr, addr, sizeof(addr)),
ntohs(sock_addr_in6->sin6_port));
break;
}

#endif

case AF_UNIX:
g_snprintf(sockname, sizeof(sockname), "AF_UNIX");
break;

default:
g_snprintf(sockname, sizeof(sockname), "unknown family %d",
sock_info.sock_addr.sa_family);
break;
}
}
else
{
log_message(LOG_LEVEL_WARNING, "getsockname() failed on socket %d: %s",
sck, strerror(errno));

if (errno == EBADF || errno == ENOTSOCK)
{
return;
}

g_snprintf(sockname, sizeof(sockname), "unknown");
}

if (close(sck) == 0)
{
log_message(LOG_LEVEL_DEBUG, "Closed socket %d (%s)", sck, sockname);
}
else
{
log_message(LOG_LEVEL_WARNING, "Cannot close socket %d (%s): %s", sck,
sockname, strerror(errno));
}

#endif
}

@@ -668,7 +717,6 @@ int APP_CC
g_tcp_connect(int sck, const char *address, const char *port)
{
int res = 0;
char errorMsg[256];
struct addrinfo p;
struct addrinfo *h = (struct addrinfo *)NULL;
struct addrinfo *rp = (struct addrinfo *)NULL;
@@ -696,9 +744,8 @@ g_tcp_connect(int sck, const char *address, const char *port)
}
if (res != 0)
{
snprintf(errorMsg, 255, "g_tcp_connect: getaddrinfo() failed: %s",
gai_strerror(res));
log_message(LOG_LEVEL_ERROR, errorMsg);
log_message(LOG_LEVEL_ERROR, "g_tcp_connect: getaddrinfo() failed: %s",
gai_strerror(res));
}
if (res > -1)
{
@@ -716,6 +763,13 @@ g_tcp_connect(int sck, const char *address, const char *port)
}
}
}

/* Mac OSX connect() returns -1 for already established connections */
if (res == -1 && errno == EISCONN)
{
res = 0;
}

return res;
}
#else
@@ -724,6 +778,7 @@ g_tcp_connect(int sck, const char* address, const char* port)
{
struct sockaddr_in s;
struct hostent* h;
int res;

g_memset(&s, 0, sizeof(struct sockaddr_in));
s.sin_family = AF_INET;
@@ -746,7 +801,15 @@ g_tcp_connect(int sck, const char* address, const char* port)
}
}
}
return connect(sck, (struct sockaddr*)&s, sizeof(struct sockaddr_in));
res = connect(sck, (struct sockaddr*)&s, sizeof(struct sockaddr_in));

/* Mac OSX connect() returns -1 for already established connections */
if (res == -1 && errno == EISCONN)
{
res = 0;
}

return res;
}
#endif

@@ -975,11 +1038,7 @@ g_tcp_accept(int sck)
int ret ;
char ipAddr[256] ;
struct sockaddr_in s;
#if defined(_WIN32)
signed int i;
#else
unsigned int i;
#endif
socklen_t i;

i = sizeof(struct sockaddr_in);
memset(&s, 0, i);
@@ -988,7 +1047,7 @@ g_tcp_accept(int sck)
{
snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port));
log_message(LOG_LEVEL_INFO,ipAddr);
log_message(LOG_LEVEL_INFO, "%s", ipAddr);
}
return ret ;
}
@@ -1000,11 +1059,7 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
int ret;
char ipAddr[256];
struct sockaddr_in s;
#if defined(_WIN32)
signed int i;
#else
unsigned int i;
#endif
socklen_t i;

i = sizeof(struct sockaddr_in);
memset(&s, 0, i);
@@ -1013,7 +1068,7 @@ g_sck_accept(int sck, char *addr, int addr_bytes, char *port, int port_bytes)
{
g_snprintf(ipAddr, 255, "A connection received from: %s port %d",
inet_ntoa(s.sin_addr), ntohs(s.sin_port));
log_message(LOG_LEVEL_INFO,ipAddr);
log_message(LOG_LEVEL_INFO, "%s", ipAddr);
if (s.sin_family == AF_INET)
{
g_snprintf(addr, addr_bytes, "%s", inet_ntoa(s.sin_addr));
@@ -1034,11 +1089,7 @@ g_write_ip_address(int rcv_sck, char *ip_address, int bytes)
{
struct sockaddr_in s;
struct in_addr in;
#if defined(_WIN32)
int len;
#else
unsigned int len;
#endif
socklen_t len;
int ip_port;
int ok;

@@ -1115,13 +1166,8 @@ g_sck_send(int sck, const void *ptr, int len, int flags)
int APP_CC
g_sck_socket_ok(int sck)
{
#if defined(_WIN32)
int opt;
int opt_len;
#else
int opt;
unsigned int opt_len;
#endif
socklen_t opt_len;

opt_len = sizeof(opt);

@@ -1812,7 +1858,7 @@ g_file_read(int fd, char *ptr, int len)
/*****************************************************************************/
/* 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)
g_file_write(int fd, const char *ptr, int len)
{
#if defined(_WIN32)

@@ -1949,7 +1995,7 @@ g_get_current_dir(char *dirname, int maxlen)
/*****************************************************************************/
/* returns error, zero on success and -1 on failure */
int APP_CC
g_set_current_dir(char *dirname)
g_set_current_dir(const char *dirname)
{
#if defined(_WIN32)

@@ -2118,7 +2164,7 @@ g_strlen(const char *text)

/*****************************************************************************/
/* locates char in text */
char* APP_CC
const char *APP_CC
g_strchr(const char* text, int c)
{
if (text == NULL)
@@ -2215,7 +2261,7 @@ g_strdup(const char *in)
char *APP_CC
g_strndup(const char *in, const unsigned int maxlen)
{
int len;
unsigned int len;
char *p;

if (in == 0)
@@ -2397,7 +2443,7 @@ g_htoi(char *str)
int APP_CC
g_pos(const char *str, const char *to_find)
{
char *pp;
const char *pp;

pp = strstr(str, to_find);

@@ -2995,10 +3041,11 @@ g_sigterm(int pid)

/*****************************************************************************/
/* returns 0 if ok */
/* the caller is responsible to free the buffs */
/* does not work in win32 */
int APP_CC
g_getuser_info(const char *username, int *gid, int *uid, char *shell,
char *dir, char *gecos)
g_getuser_info(const char *username, int *gid, int *uid, char **shell,
char **dir, char **gecos)
{
#if defined(_WIN32)
return 1;
@@ -3021,17 +3068,17 @@ g_getuser_info(const char *username, int *gid, int *uid, char *shell,

if (dir != 0)
{
g_strcpy(dir, pwd_1->pw_dir);
*dir = g_strdup(pwd_1->pw_dir);
}

if (shell != 0)
{
g_strcpy(shell, pwd_1->pw_shell);
*shell = g_strdup(pwd_1->pw_shell);
}

if (gecos != 0)
{
g_strcpy(gecos, pwd_1->pw_gecos);
*gecos = g_strdup(pwd_1->pw_gecos);
}

return 0;
@@ -3265,7 +3312,7 @@ g_save_to_bmp(const char* filename, char* data, int stride_bytes,
data -= stride_bytes;
if ((depth == 24) && (bits_per_pixel == 32))
{
line = malloc(file_stride_bytes);
line = (char *) malloc(file_stride_bytes);
memset(line, 0, file_stride_bytes);
for (index = 0; index < height; index++)
{


+ 13
- 17
common/os_calls.h View File

@@ -21,14 +21,11 @@
#if !defined(OS_CALLS_H)
#define OS_CALLS_H

#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif

#ifndef NULL
#define NULL 0
#endif

#include <stdlib.h>
#include "arch.h"

#define g_tcp_can_recv g_sck_can_recv
@@ -45,13 +42,6 @@
#define g_tcp_select g_sck_select
#define g_close_wait_obj g_delete_wait_obj

#if defined(HAVE_FUNC_ATTRIBUTE_FORMAT)
#define printflike(arg_format, arg_first_check) \
__attribute__((__format__(__printf__, arg_format, arg_first_check)))
#else
#define printflike(arg_format, arg_first_check)
#endif

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);
@@ -61,7 +51,7 @@ void APP_CC g_free(void* ptr);
void DEFAULT_CC g_printf(const char *format, ...) printflike(1, 2);
void DEFAULT_CC g_sprintf(char* dest, const char* format, ...) \
printflike(2, 3);
void DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \
int DEFAULT_CC g_snprintf(char* dest, int len, const char* format, ...) \
printflike(3, 4);
void DEFAULT_CC g_writeln(const char* format, ...) printflike(1, 2);
void DEFAULT_CC g_write(const char* format, ...) printflike(1, 2);
@@ -115,14 +105,14 @@ int APP_CC g_file_open_ex(const char *file_name, int aread, int awrite,
int acreate, int atrunc);
int APP_CC g_file_close(int fd);
int APP_CC g_file_read(int fd, char* ptr, int len);
int APP_CC g_file_write(int fd, char* ptr, int len);
int APP_CC g_file_write(int fd, const char *ptr, int len);
int APP_CC g_file_seek(int fd, int offset);
int APP_CC g_file_lock(int fd, int start, int len);
int APP_CC g_chmod_hex(const char* filename, int flags);
int APP_CC g_chown(const char* name, int uid, int gid);
int APP_CC g_mkdir(const char* dirname);
char* APP_CC g_get_current_dir(char* dirname, int maxlen);
int APP_CC g_set_current_dir(char* dirname);
int APP_CC g_set_current_dir(const char *dirname);
int APP_CC g_file_exist(const char* filename);
int APP_CC g_directory_exist(const char* dirname);
int APP_CC g_create_dir(const char* dirname);
@@ -131,7 +121,7 @@ int APP_CC g_remove_dir(const char* dirname);
int APP_CC g_file_delete(const char* filename);
int APP_CC g_file_get_size(const char* filename);
int APP_CC g_strlen(const char* text);
char* APP_CC g_strchr(const char* text, int c);
const char *APP_CC g_strchr(const char *text, int c);
char* APP_CC g_strcpy(char* dest, const char* src);
char* APP_CC g_strncpy(char* dest, const char* src, int len);
char* APP_CC g_strcat(char* dest, const char* src);
@@ -179,8 +169,8 @@ char* APP_CC g_getenv(const char* name);
int APP_CC g_exit(int exit_code);
int APP_CC g_getpid(void);
int APP_CC g_sigterm(int pid);
int APP_CC g_getuser_info(const char* username, int* gid, int* uid, char* shell,
char* dir, char* gecos);
int APP_CC g_getuser_info(const char* username, int* gid, int* uid, char** shell,
char** dir, char** gecos);
int APP_CC g_getgroup_info(const char* groupname, int* gid);
int APP_CC g_check_user_in_group(const char* username, int gid, int* ok);
int APP_CC g_time1(void);
@@ -194,4 +184,10 @@ int APP_CC g_shmdt(const void *shmaddr);
int APP_CC g_gethostname(char *name, int len);
int APP_CC g_mirror_memcpy(void *dst, const void *src, int len);

/* glib-style wrappers */
#define g_new(struct_type, n_structs) \
(struct_type *) malloc(sizeof(struct_type) * (n_structs))
#define g_new0(struct_type, n_structs) \
(struct_type *) calloc((n_structs), sizeof(struct_type))

#endif

+ 2549
- 0
common/pixman-region.c
File diff suppressed because it is too large
View File


+ 76
- 0
common/pixman-region.h View File

@@ -0,0 +1,76 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Jay Sorg 2016
*
* 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.
*
* region, from pixman.h
*/

#if !defined(PIXMAN_PIXMAN_H__)
#define PIXMAN_PIXMAN_H__

typedef int pixman_bool_t;

struct pixman_region16_data
{
long size;
long numRects;
};

struct pixman_box16
{
signed short x1, y1, x2, y2;
};

struct pixman_region16
{
struct pixman_box16 extents;
struct pixman_region16_data *data;
};

enum _pixman_region_overlap_t
{
PIXMAN_REGION_OUT,
PIXMAN_REGION_IN,
PIXMAN_REGION_PART
};

typedef enum _pixman_region_overlap_t pixman_region_overlap_t;

typedef struct pixman_region16_data pixman_region16_data_t;
typedef struct pixman_box16 pixman_box16_t;
typedef struct pixman_region16 pixman_region16_t;

/* creation/destruction */
void pixman_region_init (pixman_region16_t *region);
void pixman_region_init_rect (pixman_region16_t *region,
int x,
int y,
unsigned int width,
unsigned int height);
void pixman_region_fini (pixman_region16_t *region);
pixman_bool_t pixman_region_union (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
pixman_bool_t pixman_region_subtract (pixman_region16_t *reg_d,
pixman_region16_t *reg_m,
pixman_region16_t *reg_s);
pixman_bool_t pixman_region_intersect (pixman_region16_t *new_reg,
pixman_region16_t *reg1,
pixman_region16_t *reg2);
pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region,
int *n_rects);

#endif

+ 77
- 0
common/pixman-region16.c View File

@@ -0,0 +1,77 @@
/*
* Copyright © 2008 Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of
* Red Hat, Inc. not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission. Red Hat, Inc. makes no representations about the
* suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
* SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
* INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
* RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Author: Soren Sandmann <sandmann@redhat.com>
*/

/* taken from pixman 0.34
altered to compile without all of pixman */

#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if defined(HAVE_STDINT_H)
#include <stdint.h>
#endif
#include "pixman-region.h"

#if !defined(UINT32_MAX)
#define UINT32_MAX (4294967295U)
#endif
#if !defined(INT16_MIN)
#define INT16_MIN (-32767-1)
#endif
#if !defined(INT16_MAX)
#define INT16_MAX (32767)
#endif

#define PIXMAN_EXPORT
#define FALSE 0
#define TRUE 1

#define MIN(x1, x2) ((x1) < (x2) ? (x1) : (x2))
#define MAX(x1, x2) ((x1) > (x2) ? (x1) : (x2))

typedef pixman_box16_t box_type_t;
typedef pixman_region16_data_t region_data_type_t;
typedef pixman_region16_t region_type_t;
typedef signed int overflow_int_t;

#define PREFIX(x) pixman_region##x

#define PIXMAN_REGION_MAX INT16_MAX
#define PIXMAN_REGION_MIN INT16_MIN

#define FUNC "func"

#define critical_if_fail(expr)

int _pixman_log_error(const char *func, const char *format, ...)
{
return 0;
}

#include "pixman-region.c"


+ 21
- 7
common/ssl_calls.c View File

@@ -111,7 +111,7 @@ ssl_sha1_clear(void *sha1_info)

/*****************************************************************************/
void APP_CC
ssl_sha1_transform(void *sha1_info, char *data, int len)
ssl_sha1_transform(void *sha1_info, const char *data, int len)
{
SHA1_Update((SHA_CTX *)sha1_info, data, len);
}
@@ -187,7 +187,7 @@ ssl_des3_decrypt_info_create(const char *key, const char* ivec)
const tui8 *lkey;
const tui8 *livec;

des3_ctx = g_malloc(sizeof(EVP_CIPHER_CTX), 1);
des3_ctx = g_new0(EVP_CIPHER_CTX, 1);
EVP_CIPHER_CTX_init(des3_ctx);
lkey = (const tui8 *) key;
livec = (const tui8 *) ivec;
@@ -560,7 +560,7 @@ ssl_tls_create(struct trans *trans, const char *key, const char *cert)

/*****************************************************************************/
int APP_CC
ssl_tls_print_error(char *func, SSL *connection, int value)
ssl_tls_print_error(const char *func, SSL *connection, int value)
{
switch (SSL_get_error(connection, value))
{
@@ -590,18 +590,22 @@ ssl_tls_print_error(char *func, SSL *connection, int value)

/*****************************************************************************/
int APP_CC
ssl_tls_accept(struct ssl_tls *self)
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
const char *tls_ciphers)
{
int connection_status;
long options = 0;

/**
* SSL_OP_NO_SSLv2:
*
* We only want SSLv3 and TLSv1, so disable SSLv2.
* SSL_OP_NO_SSLv2
* SSLv3 is used by, eg. Microsoft RDC for Mac OS X.
* No SSLv3 if disableSSLv3=yes so only tls used
*/
options |= SSL_OP_NO_SSLv2;
if (disableSSLv3)
{
options |= SSL_OP_NO_SSLv3;
}

#if defined(SSL_OP_NO_COMPRESSION)
/**
@@ -638,6 +642,16 @@ ssl_tls_accept(struct ssl_tls *self)
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER |
SSL_MODE_ENABLE_PARTIAL_WRITE);
SSL_CTX_set_options(self->ctx, options);

if (g_strlen(tls_ciphers) > 1)
{
if (SSL_CTX_set_cipher_list(self->ctx, tls_ciphers) == 0)
{
g_writeln("ssl_tls_accept: invalid cipher options");
return 1;
}
}

SSL_CTX_set_read_ahead(self->ctx, 1);

if (self->ctx == NULL)


+ 5
- 4
common/ssl_calls.h View File

@@ -41,7 +41,7 @@ ssl_sha1_info_delete(void* sha1_info);
void APP_CC
ssl_sha1_clear(void* sha1_info);
void APP_CC
ssl_sha1_transform(void* sha1_info, char* data, int len);
ssl_sha1_transform(void* sha1_info, const char *data, int len);
void APP_CC
ssl_sha1_complete(void* sha1_info, char* data);
void* APP_CC
@@ -84,8 +84,8 @@ ssl_gen_key_xrdp1(int key_size_in_bits, char* exp, int exp_len,
/* ssl_tls */
struct ssl_tls
{
void *ssl; /* SSL * */
void *ctx; /* SSL_CTX * */
struct ssl_st *ssl; /* SSL * */
struct ssl_ctx_st *ctx; /* SSL_CTX * */
char *cert;
char *key;
struct trans *trans;
@@ -96,7 +96,8 @@ struct ssl_tls
struct ssl_tls *APP_CC
ssl_tls_create(struct trans *trans, const char *key, const char *cert);
int APP_CC
ssl_tls_accept(struct ssl_tls *self);
ssl_tls_accept(struct ssl_tls *self, int disableSSLv3,
const char *tls_ciphers);
int APP_CC
ssl_tls_disconnect(struct ssl_tls *self);
void APP_CC


+ 7
- 6
common/trans.c View File

@@ -28,7 +28,7 @@

/*****************************************************************************/
int APP_CC
trans_tls_recv(struct trans *self, void *ptr, int len)
trans_tls_recv(struct trans *self, char *ptr, int len)
{
if (self->tls == NULL)
{
@@ -39,7 +39,7 @@ trans_tls_recv(struct trans *self, void *ptr, int len)

/*****************************************************************************/
int APP_CC
trans_tls_send(struct trans *self, const void *data, int len)
trans_tls_send(struct trans *self, const char *data, int len)
{
if (self->tls == NULL)
{
@@ -61,14 +61,14 @@ trans_tls_can_recv(struct trans *self, int sck, int millis)

/*****************************************************************************/
int APP_CC
trans_tcp_recv(struct trans *self, void *ptr, int len)
trans_tcp_recv(struct trans *self, char *ptr, int len)
{
return g_tcp_recv(self->sck, ptr, len, 0);
}

/*****************************************************************************/
int APP_CC
trans_tcp_send(struct trans *self, const void *data, int len)
trans_tcp_send(struct trans *self, const char *data, int len)
{
return g_tcp_send(self->sck, data, len, 0);
}
@@ -881,7 +881,8 @@ trans_get_out_s(struct trans *self, int size)
/*****************************************************************************/
/* returns error */
int APP_CC
trans_set_tls_mode(struct trans *self, const char *key, const char *cert)
trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
int disableSSLv3, const char *tls_ciphers)
{
self->tls = ssl_tls_create(self, key, cert);
if (self->tls == NULL)
@@ -890,7 +891,7 @@ trans_set_tls_mode(struct trans *self, const char *key, const char *cert)
return 1;
}

if (ssl_tls_accept(self->tls) != 0)
if (ssl_tls_accept(self->tls, disableSSLv3, tls_ciphers) != 0)
{
g_writeln("trans_set_tls_mode: ssl_tls_accept failed");
return 1;


+ 4
- 3
common/trans.h View File

@@ -41,8 +41,8 @@ typedef int (DEFAULT_CC *ttrans_data_in)(struct trans* self);
typedef int (DEFAULT_CC *ttrans_conn_in)(struct trans* self,
struct trans* new_self);
typedef int (DEFAULT_CC *tis_term)(void);
typedef int (APP_CC *trans_recv_proc) (struct trans *self, void *ptr, int len);
typedef int (APP_CC *trans_send_proc) (struct trans *self, const void *data, int len);
typedef int (APP_CC *trans_recv_proc) (struct trans *self, char *ptr, int len);
typedef int (APP_CC *trans_send_proc) (struct trans *self, const char *data, int len);
typedef int (APP_CC *trans_can_recv_proc) (struct trans *self, int sck, int millis);

/* optional source info */
@@ -122,7 +122,8 @@ trans_get_in_s(struct trans* self);
struct stream* APP_CC
trans_get_out_s(struct trans* self, int size);
int APP_CC
trans_set_tls_mode(struct trans *self, const char *key, const char *cert);
trans_set_tls_mode(struct trans *self, const char *key, const char *cert,
int disableSSLv3, const char *tls_ciphers);
int APP_CC
trans_shutdown_tls_mode(struct trans *self);
int APP_CC


+ 2
- 0
common/xrdp_client_info.h View File

@@ -143,6 +143,8 @@ struct xrdp_client_info
int use_frame_acks;
int max_unacknowledged_frame_count;

int disableSSLv3; /* 0 = no, 1 = yes */
char tls_ciphers[64];
};

#endif

+ 19
- 0
configure.ac View File

@@ -14,7 +14,9 @@ PKG_PROG_PKG_CONFIG
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AX_CFLAGS_WARN_ALL
AX_APPEND_COMPILE_FLAGS([-Wwrite-strings])
AX_GCC_FUNC_ATTRIBUTE([format])
AX_TYPE_SOCKLEN_T

case $host_os in
*linux*)
@@ -107,6 +109,14 @@ AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus],
[Build opus(audio codec) (default: no)]),
[], [enable_opus=no])
AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes])
AC_ARG_ENABLE(mp3lame, AS_HELP_STRING([--enable-mp3lame],
[Build lame mp3(audio codec) (default: no)]),
[], [enable_mp3lame=no])
AM_CONDITIONAL(XRDP_MP3LAME, [test x$enable_mp3lame = xyes])
AC_ARG_ENABLE(pixman, AS_HELP_STRING([--enable-pixman],
[Use pixman library (default: no)]),
[], [enable_pixman=no])
AM_CONDITIONAL(XRDP_PIXMAN, [test x$enable_pixman = xyes])

# checking for openssl
AC_CHECK_HEADER([openssl/rc4.h], [],
@@ -179,6 +189,15 @@ then
[AC_MSG_ERROR([please install libopus-dev or opus-devel])])
fi

# checking for lame mp3
if test "x$enable_mp3lame" = "xyes"
then
AC_CHECK_HEADER([lame/lame.h], [],
[AC_MSG_ERROR([please install libmp3lame-dev or lamemp3-devel])])
fi

AS_IF( [test "x$enable_pixman" = "xyes"] , [PKG_CHECK_MODULES(XRDP_PIXMAN, pixman-1 >= 0.1.0)] )

# checking for TurboJPEG
if test "x$enable_tjpeg" = "xyes"
then


+ 155
- 136
docs/man/sesman.ini.5 View File

@@ -1,206 +1,225 @@
.\"
.\"
.TH "sesman.ini" "5" "0.1.0" "xrdp team" ""
.SH "NAME"
\fBsesman.ini\fR \- Configuration file for \fBsesman\fR(8)
\fBsesman.ini\fR \- Configuration file for \fBxrdp-sesman\fR(8)

.SH "DESCRIPTION"
This is the man page for \fBsesman.ini\fR, \fBsesman\fR(8) configuration file.
It is composed by a number of sections, each one composed by a section name, enclosed by square brackets, folowed by a list of \fI<parameter>\fR=\fI<value>\fR lines.
\fBsesman.ini\fR consists of several sections. Each section starts with
the section name in square brackets, followed by a list of
\fIparameter\fR=\fIvalue\fR lines. Following sections are recognized:

\fBsesman.ini\fR supports the following sections:
.TP
\fB[Globals]\fR
Global configuration

.TP
\fB[Globals]\fR \- sesman global configuration section,
.TP
\fB[Logging]\fR
Logging subsystem

.TP
\fB[Logging]\fR \- logging subsystem parameters
.TP
\fB[Sessions]\fR
Session management

.TP
\fB[Security]\fR \- Access control parameters
.TP
\fB[Security]\fR
Access control

.TP
\fB[Sessions]\fR \- Session management parameters
.TP
\fB[X11rdp]\fR, \fB[Xvnc]\fR, \fB[Xorg]\fR
X11 server settings for supported servers

.LP
All options and values (except for file names and paths) are case insensitive, and are described in detail below.
.TP
\fB[Chansrv]\fR
Settings for xrdp-chansrv(8)

.LP
For any of the following parameter, if it's specified more than one time the last entry encountered will be used.
.TP
\fB[SessionVariables]\fR
Environment variables for the session

\fBNOTE\fR: if any of these options is specified outside its section, it will be \fIignored\fR.
.LP
All parameters and values (except for file names and paths) are case
insensitive, and are described in detail below. If any parameter is
specified more than once, the last entry will be used. Options specified
outside their proper section will be \fIignored\fR.

.SH "GLOBALS"
The options to be specified in the \fB[globals]\fR section are the following:
Following parameters can be used in the \fB[Globals]\fR section.

.TP
.TP
\fBListenAddress\fR=\fIip address\fR
Specifies sesman listening address. Default is 0.0.0.0 (all interfaces)
xrdp-sesman listening address. Default is 0.0.0.0 (all interfaces).

.TP
.TP
\fBListenPort\fR=\fIport number\fR
Specifies sesman listening port. Default is 3350
xrdp-sesman listening port. Default is 3350.

.TP
.TP
\fBEnableUserWindowManager\fR=\fI[0|1]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables user specific window manager, that is, anyone can define it's own script executed by sesman when starting a new session, specified by \fBUserWindowManager\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables user
specific startup script. That is, xrdp-sesman will execute the script
specified by \fBUserWindowManager\fR if it exists.

.TP
\fBUserWindowManager\fR=\fIstartwm.sh\fR
This option specifies the script run by sesman when starting a session and per\-user window manager is enabled.
.br
The path is relative to user's HOME directory
.TP
\fBUserWindowManager\fR=\fIfilename\fR
Name of the startup script relative to the user's home directory. If
present and enabled by \fBEnableUserWindowManager\fR, that script is
executed instead of \fBDefaultWindowManager\fR.

.TP
\fBDefaultWindowManager\fR=\fI${SESMAN_BIN_DIR}/startwm.sh\fR
This contains full path to the default window manager startup script used by sesman to start a session
.TP
\fBDefaultWindowManager\fR=\fIfilename\fR
Full path to the default startup script used by xrdp-sesman to start a
session if the user script is disabled or missing.

.SH "LOGGING"
The following parameters can be used in the \fB[logging]\fR section:
Following parameters can be used in the \fB[Logging]\fR section.

.TP
\fBLogFile\fR=\fI${SESMAN_LOG_DIR}/sesman.log\fR
This options contains the path to logfile. It can be either absolute or relative, and the default is \fI${SESMAN_LOG_DIR}/sesman.log\fR
.TP
\fBLogFile\fR=\fIfilename\fR
Log file path. It can be either absolute or relative. The default is
\fI./sesman.log\fR

.TP
.TP
\fBLogLevel\fR=\fIlevel\fR
This option can have one of the following values:

\fBCORE\fR or \fB0\fR \- Log only core messages. these messages are _always_ logged, regardless the logging level selected.
\fBCORE\fR or \fB0\fR \- Log only core messages. Those messages are
logged \fIregardless\fR of the selected logging level.

\fBERROR\fR or \fB1\fR \- Log only error messages
\fBERROR\fR or \fB1\fR \- Log only error messages.

\fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages
\fBWARNING\fR, \fBWARN\fR or \fB2\fR \- Logs warnings and error messages.

\fBINFO\fR or \fB3\fR \- Logs errors, warnings and informational messages
\fBINFO\fR or \fB3\fR \- Log errors, warnings and informational messages.

\fBDEBUG\fR or \fB4\fR \- Log everything. If \fBsesman\fR is compiled in debug mode, this options will output many more low\-level message, useful for developers
\fBDEBUG\fR or \fB4\fR \- Log everything. If xrdp-sesman is compiled in
debug mode, this options will output many more low\-level messages.

.TP
.TP
\fBEnableSyslog\fR=\fI[0|1]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR this option enables logging to syslog. Otherwise syslog is disabled.
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, this option enables logging to
syslog.

.TP
.TP
\fBSyslogLevel\fR=\fIlevel\fR
This option sets the logging level for syslog. It can have the same values of \fBLogLevel\fR. If \fBSyslogLevel\fR is greater than \fBLogLevel\fR, its value is lowered to that of \fBLogLevel\fR.
Logging level for syslog. It can have the same values as \fBLogLevel\fR.
If \fBSyslogLevel\fR and \fBLogLevel\fR differ, the least verbose setting
takes effect for syslog.

.SH "SESSIONS"
The following parameters can be used in the \fB[Sessions]\fR section:
Following parameters can be used in the \fB[Sessions]\fR section.

.TP
\fBX11DisplayOffset\fR=\fI<number>\fR
Specifies the first X display number available for \fBsesman\fP(8). This prevents sesman from interfering with real X11 servers. The default is 10.
.TP
\fBX11DisplayOffset\fR=\fInumber\fR
The first X display number available for xrdp-sesman. This prevents
xrdp-sesman from interfering with real X11 servers. The default is 10.

.TP
\fBMaxSessions\fR=\fI<number>\fR
Sets the maximum number of simultaneous session on terminal server.
.br
If unset or set to \fI0\fR, unlimited session are allowed.
\fBMaxSessions\fR=\fInumber\fR
Sets the maximum number of simultaneous sessions. If not set or set to
\fI0\fR, unlimited session are allowed.

.TP
.TP
\fBKillDisconnected\fR=\fI[0|1]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed within 60 seconds when the user disconnects.
.br

.TP
\fBIdleTimeLimit\fR=\fI<number>\fR
Sets the the time limit before an idle session is disconnected.
.br
If set to \fI0\fR, automatic disconnection is disabled.
.br
\fI\-this option is currently ignored!\-\fR

.TP
\fBDisconnectedTimeLimit\fR=\fI<number>\fR
Sets the time(in seconds) limit before a disconnected session is killed.
.br
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, every session will be killed
within 60 seconds after the user disconnects.

.TP
\fBIdleTimeLimit\fR=\fInumber\fR
\fI\This option is currently ignored!\fR Time limit before an idle
session is disconnected. If set to \fI0\fR, automatic disconnection is
disabled.

.TP
\fBDisconnectedTimeLimit\fR=\fInumber\fR
Sets the time limit (in seconds) before a disconnected session is killed.
If set to \fI0\fR, automatic killing is disabled.
.br

.TP
.TP
\fBPolicy\fR=\fI[Default|UBD|UBI|UBC|UBDI|UBDC]\fR
Session allocation policy. By Default, a new session is created
for the combination <User,BitPerPixel> when using Xrdp, and
Session allocation policy. By default, a new session is created
for the combination <User,BitPerPixel> when using Xrdp, and
for the combination <User,BitPerPixel,DisplaySize> when using Xvnc.
This behaviour can be changed by setting session policy to:
This behavior can be changed by setting session policy to:
.br

.br
.br
\fBUBD\fR - session per <User,BitPerPixel,DisplaySize>
.br
.br
\fBUBI\fR - session per <User,BitPerPixel,IPAddr>
.br
.br
\fBUBC\fR - session per <User,BitPerPixel,Connection>
.br
.br
\fBUBDI\fR - session per <User,BitPerPixel,DisplaySize,IPAddr>
.br
.br
\fBUBDC\fR - session per <User,BitPerPixel,DisplaySize,Connection>
.br

.br
Note that the criteria <User,BitPerPixel> can not be turned off
and <DisplaySize> will always be checkt when for Xvnc connections.
Note that the \fBUser\fR and \fBBitPerPixel\fR criteria cannot be turned
off. For Xvnc connections, \fBDisplaySize\fR is always enabled as well.
.br

.SH "SECURITY"
The following parameters can be used in the \fB[Sessions]\fR section:
Following parameters can be used in the \fB[Security]\fR section.

.TP
.TP
\fBAllowRootLogin\fR=\fI[0|1]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR enables root login on the terminal server

.TP
\fBMaxLoginRetry\fR=\fI[0|1]\fR
The number of login attempts that are allowed on terminal server. If set to \fI0\fR, unlimited attempts are allowed. The default value for this field is \fI3\fR.

.TP
\fBTerminalServerUsers\fR=\fItsusers\fR
Only the users belonging to the group \fItsusers\fR are allowed to login on terminal server.
.br
If unset or set to an invalid or non\-existent group, login for all users is enabled.

.TP
\fBTerminalServerAdmins\fR=\fItsadmins\fR
Sets the group which a user shall belong to have session management rights.
.br
\fI\-this option is currently ignored!\-\fR

.SH "EXAMPLES"
This is an example \fBsesman.ini\fR:

.nf
[Globals]
ListenAddress=127.0.0.1
ListenPort=3350
EnableUserWindowManager=1
UserWindowManager=startwm.sh
DefaultWindowManager=startwm.sh

[Logging]
LogFile=/usr/local/xrdp/sesman.log
LogLevel=DEBUG
EnableSyslog=0
SyslogLevel=DEBUG

[Sessions]
MaxSessions=10
KillDisconnected=0
IdleTimeLimit=0
DisconnectedTimeLimit=0

[Security]
AllowRootLogin=1
MaxLoginRetry=3
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
.fi
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, enables root login on the
terminal server.

.TP
\fBMaxLoginRetry\fR=\fInumber\fR
The number of login attempts that are allowed on terminal server. If set
to \fI0\fR, unlimited attempts are allowed. The default value for this
field is \fI3\fR.

.TP
\fBTerminalServerUsers\fR=\fIgroup\fR
Only the users belonging to the specified group are allowed to login on
terminal server. If unset or set to an invalid or non\-existent group,
login for all users is enabled.

.TP
\fBTerminalServerAdmins\fR=\fIgroup\fR
\fIThis option is currently ignored!\fR Only members of this group can
have session management rights.

.TP
\fBAlwaysGroupCheck\fR=\fI[0|1]\fR
If set to \fB1\fR, \fBtrue\fR or \fByes\fR, require group membership even
if the group specified in \fBTerminalServerUsers\fR doesn't exist.

.SH "X11 SERVER"
Following parameters can be used in the \fB[X11rdp]\fR, \fB[Xvnc]\fR and
\fB[Xorg]\fR sections.

.TP
\fBparam0\fR=\fIfilename\fR
Path to the X11 server executable

.TP
\fBparam\fR\fIN\fR=\fIstring\fR
Nth command line argument

.SH "CHANSRV"
Following parameters can be used in the \fB[Chansrv]\fR section.

.TP
\fBFuseMountName\fR=\fIstring\fR
Directory for drive redirection, relative to the user home directory.
Created if it doesn't exist. Defaults to \fIxrdp_client\fR

.SH "SESSIONS VARIABLES"
All entries it the \fB[SessionVariables]\fR section are set as
environment variables in the user's session.

.SH "FILES"
${SESMAN_CFG_DIR}/sesman.ini
/etc/xrdp/sesman.ini

.SH "SEE ALSO"
.BR sesman (8),
.BR sesrun (8),
.BR xrdp-sesman (8),
.BR xrdp-sesrun (8),
.BR xrdp (8),
.BR xrdp.ini (5)

for more info on \fBxrdp\fR see http://xrdp.sf.net
For more info on \fBxrdp\fR see http://xrdp.sf.net

+ 1
- 1
docs/man/xrdp-dis.1 View File

@@ -7,7 +7,7 @@ xrdp\-dis \- xrdp disconnect utility

.SH DESCRIPTION
.PP
\fBxrdp\-dix\fP is run with no parameters to disconnect your xrdp session.
\fBxrdp\-dis\fP is run with no parameters to disconnect your xrdp session.

.SH ENVIRONMENT
.TP


+ 3
- 3
docs/man/xrdp.ini.5 View File

@@ -158,13 +158,13 @@ This option sets the logging level for syslog. It can have the same values of \f
.SH "CHANNELS"
The Remote Desktop Protocol supports several channels, which are used to transfer additional data like sound, clipboard data and others.
Channel names not listed here will be blocked by \fBxrdp\fP.
Not all channels are supported in all cases, so setting a value to \fItrue\fP is a pre-requisite, but does not force it's use.
Not all channels are supported in all cases, so setting a value to \fItrue\fP is a prerequisite, but does not force its use.
.br
Channels can also be enabled or disabled on a per connection basis by prefixing each setting with \fBchannel.\fP in the channel section.

.TP
\fBrdpdr\fP=\fI[0|1]\fP
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for device re-direction is allowed.
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for device redirection is allowed.

.TP
\fBrdpsnd\fP=\fI[0|1]\fP
@@ -176,7 +176,7 @@ If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel to initiate add

.TP
\fBcliprdr\fP=\fI[0|1]\fP
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for clipboard re-direction is allowed.
If set to \fB1\fR, \fBtrue\fR or \fByes\fR using the RDP channel for clipboard redirection is allowed.

.TP
\fBrail\fP=\fI[0|1]\fP


+ 4
- 4
faq-general.txt View File

@@ -2,17 +2,17 @@ General FAQ

Q. What is RDP?

A. RDP stands for Remote Desktop Protocol. Its the protocol used by Windows
A. RDP stands for Remote Desktop Protocol. It's the protocol used by Windows
terminal servers to talk to the terminal server clients.


Q. What is xrdp?

A. xrdp, usually spell lower case, is as open source implementation of the RDP
protocol.
A. xrdp, usually spelled in lower case, is as open source implementation of the
RDP protocol.


Q. I can't get it to compile in Ubuntu. What can I do?
Q. I can't get xrdp to compile in Ubuntu. What can I do?

A. See faq-compile.txt.



+ 4
- 0
genkeymap/dump-keymaps.sh View File

@@ -11,6 +11,10 @@ fi
setxkbmap -model pc104 -layout us
./xrdp-genkeymap ../instfiles/km-0409.ini

# English - UK 'en-GB' 0x0809
setxkbmap -model pc105 -layout gb
./xrdp-genkeymap ../instfiles/km-0809.ini

# German 'de' 0x0407
setxkbmap -model pc104 -layout de
./xrdp-genkeymap ../instfiles/km-0407.ini


+ 4
- 1
genkeymap/genkeymap.c View File

@@ -48,7 +48,10 @@ int main(int argc, char **argv)
char text[256];
char *displayname = NULL;
char *outfname;
char *sections[8] = {"noshift", "shift", "altgr", "shiftaltgr", "capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"};
const char *sections[8] = {
"noshift", "shift", "altgr", "shiftaltgr",
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr"
};
int states[8] = {0, 1, 0x80, 0x81, 2, 0x82, 3, 0x83};
int i;
int idx;


+ 1
- 0
instfiles/Makefile.am View File

@@ -20,6 +20,7 @@ dist_startscript_DATA = \
km-0419.ini \
km-041d.ini \
km-0807.ini \
km-0809.ini \
km-080c.ini \
km-0813.ini \
km-0816.ini \


+ 1055
- 0
instfiles/km-0809.ini
File diff suppressed because it is too large
View File


+ 1
- 1
keygen/keygen.c View File

@@ -282,7 +282,7 @@ sign_key(char *e_data, int e_len, char *n_data, int n_len,

/*****************************************************************************/
static int APP_CC
write_out_line(int fd, char *name, char *data, int len)
write_out_line(int fd, const char *name, char *data, int len)
{
int max;
int error;


+ 0
- 31
librfxcodec/.gitignore View File

@@ -1,31 +0,0 @@
*~
aclocal.m4
AUTHORS
autom4te.cache/
ChangeLog
config_ac.h
config_ac-h.in
config.c
config.guess
config.log
config.status
config.sub
configure
compile
depcomp
.deps/
install-sh
*.la
.libs
libtool
*.lo
ltmain.sh
Makefile
Makefile.in
missing
NEWS
*.o
README
stamp-h1
rfxcodectest
.dirstamp

+ 12
- 0
librfxcodec/Makefile View File

@@ -0,0 +1,12 @@

all: allmake

allmake:
cd src; $(MAKE) $(MFLAGS)
cd tests; $(MAKE) $(MFLAGS)

clean: allclean

allclean:
cd src; $(MAKE) clean
cd tests; $(MAKE) clean

+ 0
- 6
librfxcodec/Makefile.am View File

@@ -1,6 +0,0 @@
EXTRA_DIST = bootstrap readme.txt

SUBDIRS = \
src \
tests


+ 0
- 137
librfxcodec/acinclude.m4 View File

@@ -1,137 +0,0 @@
# AC_PROG_NASM
# --------------------------
# Check that NASM exists and determine flags
AC_DEFUN([AC_PROG_NASM],[

AC_CHECK_PROGS(NASM, [nasm nasmw yasm])
test -z "$NASM" && AC_MSG_ERROR([no nasm (Netwide Assembler) found])

AC_MSG_CHECKING([for object file format of host system])
case "$host_os" in
cygwin* | mingw* | pw32* | interix*)
case "$host_cpu" in
x86_64)
objfmt='Win64-COFF'
;;
*)
objfmt='Win32-COFF'
;;
esac
;;
msdosdjgpp* | go32*)
objfmt='COFF'
;;
os2-emx*) # not tested
objfmt='MSOMF' # obj
;;
linux*coff* | linux*oldld*)
objfmt='COFF' # ???
;;
linux*aout*)
objfmt='a.out'
;;
linux*)
case "$host_cpu" in
x86_64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
;;
freebsd* | netbsd* | openbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
objfmt='BSD-a.out'
else
case "$host_cpu" in
x86_64 | amd64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
fi
;;
solaris* | sunos* | sysv* | sco*)
case "$host_cpu" in
x86_64)
objfmt='ELF64'
;;
*)
objfmt='ELF'
;;
esac
;;
darwin* | rhapsody* | nextstep* | openstep* | macos*)
case "$host_cpu" in
x86_64)
objfmt='Mach-O64'
;;
*)
objfmt='Mach-O'
;;
esac
;;
*)
objfmt='ELF ?'
;;
esac

AC_MSG_RESULT([$objfmt])
if test "$objfmt" = 'ELF ?'; then
objfmt='ELF'
AC_MSG_WARN([unexpected host system. assumed that the format is $objfmt.])
fi

AC_MSG_CHECKING([for object file format specifier (NAFLAGS) ])
case "$objfmt" in
MSOMF) NAFLAGS='-fobj -DOBJ32';;
Win32-COFF) NAFLAGS='-fwin32 -DWIN32';;
Win64-COFF) NAFLAGS='-fwin64 -DWIN64 -D__x86_64__';;
COFF) NAFLAGS='-fcoff -DCOFF';;
a.out) NAFLAGS='-faout -DAOUT';;
BSD-a.out) NAFLAGS='-faoutb -DAOUT';;
ELF) NAFLAGS='-felf -DELF';;
ELF64) NAFLAGS='-felf64 -DELF -D__x86_64__';;
RDF) NAFLAGS='-frdf -DRDF';;
Mach-O) NAFLAGS='-fmacho -DMACHO';;
Mach-O64) NAFLAGS='-fmacho64 -DMACHO -D__x86_64__';;
esac
AC_MSG_RESULT([$NAFLAGS])
AC_SUBST([NAFLAGS])

AC_MSG_CHECKING([whether the assembler ($NASM $NAFLAGS) works])
cat > conftest.asm <<EOF
[%line __oline__ "configure"
section .text
global _main,main
_main:
main: xor eax,eax
ret
]EOF
try_nasm='$NASM $NAFLAGS -o conftest.o conftest.asm'
if AC_TRY_EVAL(try_nasm) && test -s conftest.o; then
AC_MSG_RESULT(yes)
else
echo "configure: failed program was:" >&AC_FD_CC
cat conftest.asm >&AC_FD_CC
rm -rf conftest*
AC_MSG_RESULT(no)
AC_MSG_ERROR([installation or configuration problem: assembler cannot create object files.])
fi

AC_MSG_CHECKING([whether the linker accepts assembler output])
try_nasm='${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.o $LIBS 1>&AC_FD_CC'
if AC_TRY_EVAL(try_nasm) && test -s conftest${ac_exeext}; then
rm -rf conftest*
AC_MSG_RESULT(yes)
else
rm -rf conftest*
AC_MSG_RESULT(no)
AC_MSG_ERROR([configuration problem: maybe object file format mismatch.])
fi

])


+ 0
- 36
librfxcodec/bootstrap View File

@@ -1,36 +0,0 @@
#!/bin/sh

which autoconf
if ! test $? -eq 0
then
echo "error, install autoconf"
exit 1
fi

which automake
if ! test $? -eq 0
then
echo "error, install automake"
exit 1
fi

which libtool || which libtoolize
if ! test $? -eq 0
then
echo "error, install libtool"
exit 1
fi

which pkg-config
if ! test $? -eq 0
then
echo "error, install pkg-config"
exit 1
fi

touch configure.ac
touch NEWS
touch AUTHORS
touch README
touch ChangeLog
autoreconf -fvi

+ 0
- 55
librfxcodec/configure.ac View File

@@ -1,55 +0,0 @@
# Process this file with autoconf to produce a configure script

AC_PREREQ(2.59)
AC_INIT([rfxcodec], [0.1.0], [jay.sorg@gmail.com])
AC_CONFIG_HEADERS(config_ac.h:config_ac-h.in)
AM_INIT_AUTOMAKE([1.6 foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_PROG_CC
AC_C_CONST
AC_PROG_LIBTOOL

AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"])

if test "x${prefix}" = "xNONE" ; then
sysconfdir="/etc";
fi

# SIMD is optional
AC_ARG_WITH([simd],
AC_HELP_STRING([--without-simd],[Omit SIMD extensions.]))
if test "x${with_simd}" != "xno"; then
# Check if we're on a supported CPU
AC_MSG_CHECKING([if we have SIMD optimisations for cpu type])
case "$host_cpu" in
x86_64 | amd64)
AC_MSG_RESULT([yes (x86_64)])
AC_PROG_NASM
simd_arch=x86_64
;;
i*86 | x86 | ia32)
AC_MSG_RESULT([yes (i386)])
AC_PROG_NASM
simd_arch=i386
;;
*)
AC_MSG_RESULT([no ("$host_cpu")])
AC_MSG_WARN([SIMD support not available for this CPU. Performance will suffer.])
with_simd=no;
;;
esac
if test "x${with_simd}" != "xno"; then
AC_DEFINE([WITH_SIMD], [1], [Use accelerated SIMD routines.])
fi
fi

AM_CONDITIONAL(WITH_SIMD_AMD64, [test x$simd_arch = xx86_64])
AM_CONDITIONAL(WITH_SIMD_X86, [test x$simd_arch = xi386])

AC_CONFIG_FILES([Makefile
src/Makefile
tests/Makefile
])

AC_OUTPUT


+ 0
- 40
librfxcodec/include/rfxcodec_common.h View File

@@ -1,40 +0,0 @@
/**
* RFX codec
*
* Copyright 2015 Jay Sorg <jay.sorg@gmail.com>
*
* 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 __RFXCODEC_COMMON_H
#define __RFXCODEC_COMMON_H

#define RFX_FORMAT_BGRA 0
#define RFX_FORMAT_RGBA 1
#define RFX_FORMAT_BGR 2
#define RFX_FORMAT_RGB 3
#define RFX_FORMAT_YUV 4 /* YUV444 linear tiled mode */

#define RFX_FLAGS_NONE 0 /* default RFX_FLAGS_RLGR3 and RFX_FLAGS_SAFE */

#define RFX_FLAGS_SAFE 0 /* default */
#define RFX_FLAGS_OPT1 (1 << 3)
#define RFX_FLAGS_OPT2 (1 << 4)
#define RFX_FLAGS_NOACCEL (1 << 6)

#define RFX_FLAGS_RLGR3 0 /* default */
#define RFX_FLAGS_RLGR1 1

#define RFX_FLAGS_ALPHAV1 1 /* used in flags for rfxcodec_encode */

#endif

+ 0
- 33
librfxcodec/include/rfxcodec_decode.h View File

@@ -1,33 +0,0 @@
/**
* RFX codec decoder
*
* Copyright 2014-2015 Jay Sorg <jay.sorg@gmail.com>