Browse Source

New upstream version 0.9.4

tags/upstream/0.9.4^0
Dominik George 3 years ago
parent
commit
c2b60bf394
100 changed files with 5486 additions and 3460 deletions
  1. +3
    -3
      Makefile.am
  2. +43
    -24
      Makefile.in
  3. +86
    -0
      NEWS.md
  4. +44
    -26
      README.md
  5. +29
    -26
      aclocal.m4
  6. +8
    -11
      astyle_config.as
  7. +10
    -0
      bootstrap
  8. +10
    -3
      common/Makefile.am
  9. +44
    -23
      common/Makefile.in
  10. +42
    -36
      common/arch.h
  11. +80
    -0
      common/base64.c
  12. +31
    -0
      common/base64.h
  13. +9
    -5
      common/fifo.c
  14. +5
    -5
      common/fifo.h
  15. +15
    -11
      common/file.c
  16. +4
    -4
      common/file.h
  17. +0
    -68
      common/file_loc.h
  18. +15
    -11
      common/list.c
  19. +10
    -10
      common/list.h
  20. +14
    -10
      common/list16.c
  21. +10
    -10
      common/list16.h
  22. +20
    -16
      common/log.c
  23. +11
    -11
      common/log.h
  24. +469
    -295
      common/os_calls.c
  25. +136
    -140
      common/os_calls.h
  26. +5
    -1
      common/pixman-region.c
  27. +176
    -137
      common/ssl_calls.c
  28. +43
    -37
      common/ssl_calls.h
  29. +16
    -12
      common/thread_calls.c
  30. +11
    -11
      common/thread_calls.h
  31. +31
    -27
      common/trans.c
  32. +28
    -28
      common/trans.h
  33. +7
    -3
      common/xrdp_client_info.h
  34. +19
    -5
      common/xrdp_constants.h
  35. +40
    -0
      common/xrdp_sockets.h
  36. +5
    -4
      compile
  37. +30
    -17
      config.guess
  38. +23
    -18
      config.sub
  39. +1
    -2
      config_ac-h.in
  40. +1497
    -907
      configure
  41. +70
    -26
      configure.ac
  42. +3
    -3
      depcomp
  43. +23
    -5
      docs/Makefile.in
  44. +19
    -6
      docs/man/Makefile.am
  45. +53
    -24
      docs/man/Makefile.in
  46. +2
    -8
      docs/man/sesman.ini.5.in
  47. +5
    -5
      docs/man/xrdp-chansrv.8.in
  48. +2
    -2
      docs/man/xrdp-dis.1.in
  49. +2
    -2
      docs/man/xrdp-genkeymap.8.in
  50. +4
    -4
      docs/man/xrdp-keygen.8.in
  51. +1
    -1
      docs/man/xrdp-sesadmin.8.in
  52. +6
    -6
      docs/man/xrdp-sesman.8.in
  53. +3
    -3
      docs/man/xrdp-sesrun.8.in
  54. +0
    -26
      docs/man/xrdp-sessvc.8
  55. +0
    -14
      docs/man/xrdp-xcon.8
  56. +25
    -16
      docs/man/xrdp.8.in
  57. +33
    -19
      docs/man/xrdp.ini.5.in
  58. +0
    -1
      file-loc.txt
  59. +23
    -6
      genkeymap/Makefile.in
  60. +4
    -0
      genkeymap/genkeymap.c
  61. +171
    -197
      install-sh
  62. +25
    -4
      instfiles/Makefile.am
  63. +65
    -29
      instfiles/Makefile.in
  64. +24
    -6
      instfiles/default/Makefile.in
  65. +24
    -6
      instfiles/init.d/Makefile.in
  66. +2
    -2
      instfiles/init.d/xrdp
  67. +10
    -15
      instfiles/pam.d/Makefile.am
  68. +33
    -21
      instfiles/pam.d/Makefile.in
  69. +46
    -0
      instfiles/pam.d/mkpamrules
  70. +1
    -0
      instfiles/pam.d/xrdp-sesman.debian
  71. +5
    -0
      instfiles/pam.d/xrdp-sesman.freebsd
  72. +0
    -5
      instfiles/pam.d/xrdp-sesman.other
  73. +0
    -4
      instfiles/pam.d/xrdp-sesman.password-auth
  74. +5
    -0
      instfiles/pam.d/xrdp-sesman.redhat
  75. +5
    -0
      instfiles/pam.d/xrdp-sesman.suse
  76. +5
    -0
      instfiles/pam.d/xrdp-sesman.unix
  77. +24
    -6
      instfiles/pulse/Makefile.in
  78. +24
    -6
      instfiles/rc.d/Makefile.in
  79. +0
    -16
      instfiles/xrdp-sesman.service
  80. +17
    -0
      instfiles/xrdp-sesman.service.in
  81. +0
    -15
      instfiles/xrdp.service
  82. +16
    -0
      instfiles/xrdp.service.in
  83. +1
    -1
      keygen/Makefile.am
  84. +24
    -7
      keygen/Makefile.in
  85. +17
    -13
      keygen/keygen.c
  86. +32
    -0
      keygen/openssl.conf
  87. +0
    -0
      libpainter/AUTHORS
  88. +0
    -0
      libpainter/ChangeLog
  89. +1
    -1
      libpainter/Makefile.am
  90. +43
    -25
      libpainter/Makefile.in
  91. +0
    -0
      libpainter/NEWS
  92. +0
    -0
      libpainter/README
  93. +34
    -26
      libpainter/aclocal.m4
  94. +5
    -4
      libpainter/compile
  95. +30
    -17
      libpainter/config.guess
  96. +23
    -18
      libpainter/config.sub
  97. +1
    -2
      libpainter/config_ac-h.in
  98. +1409
    -871
      libpainter/configure
  99. +3
    -6
      libpainter/configure.ac
  100. +3
    -3
      libpainter/depcomp

+ 3
- 3
Makefile.am View File

@@ -1,5 +1,7 @@
ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --without-systemdsystemunitdir
AM_DISTCHECK_CONFIGURE_FLAGS = \
--without-systemdsystemunitdir \
--enable-strict-locations

EXTRA_DIST = \
COPYING \
@@ -17,7 +19,6 @@ EXTRA_DIST = \
install.txt \
m4 \
postinstall-pak \
readme.txt \
tcutils \
tests \
vrplayer \
@@ -50,7 +51,6 @@ endif
SUBDIRS = \
common \
vnc \
rdp \
xup \
mc \
$(NEUTRINORDPDIR) \


+ 43
- 24
Makefile.in View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@

@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -78,10 +88,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
$(srcdir)/config_ac-h.in COPYING compile config.guess \
config.sub depcomp install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -96,6 +102,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
@@ -158,9 +166,12 @@ am__define_uniq_tagged_files = \
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = common vnc rdp xup mc neutrinordp libxrdp libpainter \
DIST_SUBDIRS = common vnc xup mc neutrinordp libxrdp libpainter \
librfxcodec xrdp sesman keygen docs instfiles genkeymap \
xrdpapi pkgconfig xrdpvr
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config_ac-h.in \
COPYING compile config.guess config.sub install-sh ltmain.sh \
missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -228,6 +239,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FDKAAC_CFLAGS = @FDKAAC_CFLAGS@
FDKAAC_LIBS = @FDKAAC_LIBS@
FGREP = @FGREP@
FREERDP_CFLAGS = @FREERDP_CFLAGS@
FREERDP_LIBS = @FREERDP_LIBS@
@@ -247,6 +260,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -254,6 +268,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
@@ -265,6 +280,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PAM_RULES = @PAM_RULES@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
PIXMAN_LIBS = @PIXMAN_LIBS@
@@ -332,6 +348,7 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
socketdir = @socketdir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
@@ -341,7 +358,10 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
AM_DISTCHECK_CONFIGURE_FLAGS = --without-systemdsystemunitdir
AM_DISTCHECK_CONFIGURE_FLAGS = \
--without-systemdsystemunitdir \
--enable-strict-locations

EXTRA_DIST = \
COPYING \
README.md \
@@ -358,7 +378,6 @@ EXTRA_DIST = \
install.txt \
m4 \
postinstall-pak \
readme.txt \
tcutils \
tests \
vrplayer \
@@ -375,7 +394,6 @@ EXTRA_DIST = \
SUBDIRS = \
common \
vnc \
rdp \
xup \
mc \
$(NEUTRINORDPDIR) \
@@ -411,7 +429,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -626,7 +643,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)

dist-bzip2: distdir
@@ -642,17 +659,17 @@ dist-xz: distdir
$(am__post_remove_distdir)

dist-tarZ: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)

dist-shar: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)

dist-zip: distdir
@@ -670,7 +687,7 @@ dist dist-all:
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
@@ -680,23 +697,23 @@ distcheck: dist
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_inst
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=.. --prefix="$$dc_install_base" \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
@@ -873,6 +890,8 @@ uninstall-am:
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am

.PRECIOUS: Makefile


# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.


+ 86
- 0
NEWS.md View File

@@ -1,3 +1,89 @@
# Release notes for xrdp v0.9.4 (2017/09/28)

## New features
* Accept prefill credentials in base64 form #153 #811
* Indroduce AAC encoder to audio redirection (requires Windows 10 client)

## Bugfixes
* Fix ocasional SEGV in drive redirection #838
* Fix client's IP addresses in xrdp-sesman.log are always logged as `0.0.0.0` #878 #882
* Fix `ls_background_image` didn't accept full path #776 #853
* Fix misuse of hidelogwindow #414 #876
* Fix WTSVirtualChannelWrite return code #859
* Fix no longer needed socket files remained in the socket dir #812 #831
* Make creating socket path a bit more robust #823

## Other changes
* Add Belgian keyboard #858
* Add a PAM file for FreeBSD #824
* Several refactorings and cosmetic changes

## Known issues
* Windows 10 (1703) shows black blank screen in RemoteFX mode
* This issue is already fixed at Insider Preview build 16273

# Release notes for xrdp v0.9.3.1 (2017/08/16)

This release fixes a trivial packaging issue #848 occurred in v0.9.3. The issue only affects systemd systems. This release is principally for distro packagers or users who compile & install xrdp from source.

Users who running xrdp on these systems don't need to upgrade from v0.9.3 to v0.9.3.1.

* Linux systems without systemd
* non-Linux systems such as BSD operating systems

# Release notes for xrdp v0.9.3 (2017/07/15)

## New features
* Log user-friendly messages when certificate/privkey is inaccessible

## Bugfixes
* Now sesman sets mandatory LOGNAME environment variable #725
* Now sesman ensures socket directory present #801
* Exit with failure status if port already in use #644
* Eliminate some hard coded paths
* Fix glitches with IPv4 struct initialization #803
* Fix some keyboard layout integration (UK, Spanish)
* Fix handle OS when IPv6 disabled #714
* Fix issues around systemd session #778
* Fix protocol error when 32 bit color and non RemoteFX session #737 #804
* Fix sesadmin shows error when no sessions #797
* Fix TLS spins 100% CPU #728
* Fix Xvnc backend disconnects when some data copied to clipboard #755
* Pick up the first section if given section(domain) doesn't match anything #750

## Other changes
* Change xrdp-chansrv log path to include display number
* Optimize startwm.sh for SUSE
* Several cleanups and optimizations

## Known issues
* Windows 10 (1703) shows black blank screen in RemoteFX mode

-----------------------

# Release notes for xrdp v0.9.2 (2017/03/30)
## New features
* RemoteFX codec support is now enabled by default.
* Bitmap updates support is now enabled by default.
* TLS ciphers suites and version is now logged.
* Connected computer name is now logged.
* Switched to Xorg (xorgxrdp) as the default backend now.
* Miscellaneous RemoteFX codec mode improvements.
* Socket directory is configurable at the compile time.

## Bugfixes
* Parallels client for MacOS / iOS can now connect (audio redirection must be disabled on client or xrdp server though).
* MS RDP client for iOS can now connect using TLS security layer.
* MS RDP client for Android can now connect to xrdp.
* Large resolutions (4K) can be used with RemoteFX graphics.
* Multiple RemoteApps can be opened throguh NeutrinoRDP proxy.
* tls_ciphers in xrdp.ini is not limited to 63 chars anymore, it's variable-length.
* Fixed an issue where tls_ciphers were ignored and rdp security layer could be used instead.
* Kill disconnected sessions feature is working with Xorg (xorgxrdp) backend.
* Miscellaneous code cleanup and memory issues fixes.

-----------------------

# Release notes for xrdp v0.9.1 (2016/12/21)
## New features
* New xorgxrdp backend using existing Xorg with additional modules


+ 44
- 26
README.md View File

@@ -2,7 +2,7 @@
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/neutrinolabs/xrdp)
![Apache-License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)

*Current Version:* 0.9.1
*Current Version:* 0.9.4

# xrdp - an open source RDP server

@@ -46,10 +46,29 @@ apt-get install xrdp
```

### RedHat / CentOS / Fedora

On RedHat and CentOS, make sure to enable EPEL packages first.

```bash
yum install epel-release
```

Install xrdp package.

```bash
yum install xrdp
```

`yum` is being replaced with `dnf`, so you may need to use `dnf` instead
of `yum` in the above commands.

To allow outside access to the service, open port 3389 on the firewall.

```
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
```

## Environment

**xrdp** primarily targets to GNU/Linux. Tested on x86, x86_64, SPARC and
@@ -84,7 +103,7 @@ need **autoconf**, **automake**, **libtool** and **pkgconfig**.
If compiling from the packaged source, unpack the tarball and change to the
resulting directory.

If compiling from a checked out repository, please make sure you've got the submodules
If compiling from a checked out repository, please make sure you've got the submodules
cloned too (use `git clone --recursive https://github.com/neutrinolabs/xrdp`)

Then run following commands to compile and install xrdp:
@@ -99,28 +118,27 @@ sudo make install

```
xrdp
├── common ------ common code
├── docs -------- documentation
├── fontdump ---- font dump for Windows
├── genkeymap --- keymap generator
├── instfiles --- installable data file
├── keygen ------ xrdp RSA key pair generator
├── libpainter -- painter library
├── librfxcodec - RFX codec library
├── libxrdp ----- core RDP protocol implementation
├── m4 ---------- Autoconf macros
├── mc ---------- media center module
├── neutrinordp - RDP client module for proxying RDP connections using NeutrinoRDP
├── pkgconfig --- pkg-config configuration
├── rdp --------- RDP client module for connecting to another RDP server
├── sesman ------ session manager for xrdp
├── tcutils ----- QT based utility program for thin clients
├── tests ------- tests for the code
├── vnc --------- VNC client module for xrdp
├── vrplayer ---- QT player redirecting video/audio to clients over xrdpvr channel
├── xorg -------- X11rdp, an Xorg backend for xrdp
├── xrdp -------- main server code
├── xrdpapi ----- virtual channel API
├── xrdpvr ------ API for playing media over RDP
└── xup --------- X11rdp and xorgxrdp client module
├── common ······ common code
├── docs ········ documentation
├── fontdump ···· font dump for Windows
├── genkeymap ··· keymap generator
├── instfiles ··· installable data file
├── keygen ······ xrdp RSA key pair generator
├── libpainter ·· painter library
├── librfxcodec · RFX codec library
├── libxrdp ····· core RDP protocol implementation
├── m4 ·········· Autoconf macros
├── mc ·········· media center module
├── neutrinordp · RDP client module for proxying RDP connections using NeutrinoRDP
├── pkgconfig ··· pkg-config configuration
├── sesman ······ session manager for xrdp
├── tcutils ····· QT based utility program for thin clients
├── tests ······· tests for the code
├── vnc ········· VNC client module for xrdp
├── vrplayer ···· QT player redirecting video/audio to clients over xrdpvr channel
├── xorg ········ X11rdp, an Xorg backend for xrdp
├── xrdp ········ main server code
├── xrdpapi ····· virtual channel API
├── xrdpvr ······ API for playing media over RDP
└── xup ········· X11rdp and xorgxrdp client module
```

+ 29
- 26
aclocal.m4 View File

@@ -1,6 +1,6 @@
# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.

# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])

# Copyright (C) 2002-2013 Free Software Foundation, Inc.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.14'
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.14.1], [],
m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])

@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.14.1])dnl
[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])

# AM_AUX_DIR_EXPAND -*- Autoconf -*-

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`

# AM_CONDITIONAL -*- Autoconf -*-

# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])

# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl

# Generate code to set up dependency tracking. -*- Autoconf -*-

# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],

# Do all the work for Automake. -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -498,8 +498,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -573,6 +573,9 @@ END
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
fi
fi
dnl The trailing newline in this macro's definition is deliberate, for
dnl backward compatibility and to allow trailing 'dnl'-style comments
dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
])

dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
@@ -602,7 +605,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -613,7 +616,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -623,7 +626,7 @@ if test x"${install_sh}" != xset; then
fi
AC_SUBST([install_sh])])

# Copyright (C) 2003-2013 Free Software Foundation, Inc.
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -644,7 +647,7 @@ AC_SUBST([am__leading_dot])])

# Check to see how 'make' treats includes. -*- Autoconf -*-

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -694,7 +697,7 @@ rm -f confinc confmf

# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-

# Copyright (C) 1997-2013 Free Software Foundation, Inc.
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -733,7 +736,7 @@ fi

# Helper functions for option handling. -*- Autoconf -*-

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -762,7 +765,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])

# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -809,7 +812,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -828,7 +831,7 @@ AC_DEFUN([AM_RUN_LOG],

# Check to make sure that the build environment is sane. -*- Autoconf -*-

# Copyright (C) 1996-2013 Free Software Foundation, Inc.
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -909,7 +912,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])

# Copyright (C) 2009-2013 Free Software Foundation, Inc.
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -969,7 +972,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])

# Copyright (C) 2001-2013 Free Software Foundation, Inc.
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -997,7 +1000,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])

# Copyright (C) 2006-2013 Free Software Foundation, Inc.
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1016,7 +1019,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])

# Check how to create a tarball. -*- Autoconf -*-

# Copyright (C) 2004-2013 Free Software Foundation, Inc.
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,


+ 8
- 11
astyle_config.as View File

@@ -8,15 +8,15 @@
# for C++ files only
--indent-classes

# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
# The entire case block is indented.
--indent-switches

# Add extra indentation to namespace blocks. This option has no effect on Java files.
--indent-namespaces

# Converts tabs into spaces in the non-indentation part of the line.
--convert-tabs
# Converts tabs into spaces in the non-indentation part of the line.
--convert-tabs

# requires --convert-tabs to work properly
--indent-preprocessor
@@ -27,17 +27,14 @@

--max-instatement-indent=40

# Pad empty lines around header blocks (e.g. 'if', 'for', 'while'...).
--break-blocks

# Insert space padding around operators.
# Insert space padding around operators.
--pad-oper

# Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...).
# Insert space padding after paren headers only (e.g. 'if', 'for', 'while'...).
--pad-header


# Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for', 'while'...).
# Add brackets to unbracketed one line conditional statements (e.g. 'if', 'for', 'while'...).
--add-brackets

--align-pointer=name
@@ -46,12 +43,12 @@
--suffix=none

# For each directory in the command line, process all subdirectories recursively.
--recursive
--recursive

# Preserve the original file's date and time modified.
--preserve-date

# Formatted files display mode. Display only the files that have been formatted.
# Formatted files display mode. Display only the files that have been formatted.
# Do not display files that are unchanged.
--formatted



+ 10
- 0
bootstrap View File

@@ -28,4 +28,14 @@ then
exit 1
fi

if ! test -f libpainter/configure.ac
then
git submodule update --init libpainter
fi

if ! test -f librfxcodec/configure.ac
then
git submodule update --init librfxcodec
fi

autoreconf -fvi

+ 10
- 3
common/Makefile.am View File

@@ -9,14 +9,20 @@ EXTRA_DIST = pixman-region.c
include_HEADERS = \
xrdp_client_info.h \
xrdp_constants.h \
xrdp_rail.h
xrdp_rail.h \
xrdp_sockets.h

AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_LOG_PATH=\"${localstatedir}/log\"
-DXRDP_LOG_PATH=\"${localstatedir}/log\" \
-DXRDP_SOCKET_PATH=\"${socketdir}\"

if XRDP_DEBUG
AM_CPPFLAGS += -DXRDP_DEBUG
endif

AM_CFLAGS = $(OPENSSL_CFLAGS)

@@ -25,13 +31,14 @@ module_LTLIBRARIES = \

libcommon_la_SOURCES = \
arch.h \
base64.h \
base64.c \
crc16.h \
defines.h \
fifo.c \
fifo.h \
file.c \
file.h \
file_loc.h \
list.c \
list.h \
list16.c \


+ 44
- 23
common/Makefile.in View File

@@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.14.1 from Makefile.am.
# Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@

# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# Copyright (C) 1994-2017 Free Software Foundation, Inc.

# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -16,7 +16,17 @@


VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -79,9 +89,8 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
@XRDP_DEBUG_TRUE@am__append_1 = -DXRDP_DEBUG
subdir = common
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/depcomp $(include_HEADERS)
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
$(top_srcdir)/m4/ax_append_flag.m4 \
@@ -96,6 +105,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config_ac.h
CONFIG_CLEAN_FILES =
@@ -132,14 +143,14 @@ LTLIBRARIES = $(module_LTLIBRARIES)
am__DEPENDENCIES_1 =
libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
am__libcommon_la_SOURCES_DIST = arch.h crc16.h defines.h fifo.c fifo.h \
file.c file.h file_loc.h list.c list.h list16.c list16.h log.c \
log.h os_calls.c os_calls.h parse.h rail.h ssl_calls.c \
ssl_calls.h thread_calls.c thread_calls.h trans.c trans.h \
pixman-region16.c pixman-region.h
am__libcommon_la_SOURCES_DIST = arch.h base64.h base64.c crc16.h \
defines.h fifo.c fifo.h file.c file.h list.c list.h list16.c \
list16.h log.c log.h os_calls.c os_calls.h parse.h rail.h \
ssl_calls.c ssl_calls.h thread_calls.c thread_calls.h trans.c \
trans.h pixman-region16.c pixman-region.h
@XRDP_PIXMAN_FALSE@am__objects_1 = pixman-region16.lo
am_libcommon_la_OBJECTS = fifo.lo file.lo list.lo list16.lo log.lo \
os_calls.lo ssl_calls.lo thread_calls.lo trans.lo \
am_libcommon_la_OBJECTS = base64.lo fifo.lo file.lo list.lo list16.lo \
log.lo os_calls.lo ssl_calls.lo thread_calls.lo trans.lo \
$(am__objects_1)
libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -207,6 +218,7 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -233,6 +245,8 @@ ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FDKAAC_CFLAGS = @FDKAAC_CFLAGS@
FDKAAC_LIBS = @FDKAAC_LIBS@
FGREP = @FGREP@
FREERDP_CFLAGS = @FREERDP_CFLAGS@
FREERDP_LIBS = @FREERDP_LIBS@
@@ -252,6 +266,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -259,6 +274,7 @@ NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OPENSSL = @OPENSSL@
OPENSSL_CFLAGS = @OPENSSL_CFLAGS@
OPENSSL_LIBS = @OPENSSL_LIBS@
OTOOL = @OTOOL@
@@ -270,6 +286,7 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PAM_RULES = @PAM_RULES@
PATH_SEPARATOR = @PATH_SEPARATOR@
PIXMAN_CFLAGS = @PIXMAN_CFLAGS@
PIXMAN_LIBS = @PIXMAN_LIBS@
@@ -337,6 +354,7 @@ program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
socketdir = @socketdir@
srcdir = @srcdir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
@@ -351,28 +369,29 @@ EXTRA_DIST = pixman-region.c
include_HEADERS = \
xrdp_client_info.h \
xrdp_constants.h \
xrdp_rail.h
AM_CPPFLAGS = \
-DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_LOG_PATH=\"${localstatedir}/log\"
xrdp_rail.h \
xrdp_sockets.h
AM_CPPFLAGS = -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \
-DXRDP_SBIN_PATH=\"${sbindir}\" \
-DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \
-DXRDP_PID_PATH=\"${localstatedir}/run\" \
-DXRDP_LOG_PATH=\"${localstatedir}/log\" \
-DXRDP_SOCKET_PATH=\"${socketdir}\" $(am__append_1)
AM_CFLAGS = $(OPENSSL_CFLAGS)
module_LTLIBRARIES = \
libcommon.la

libcommon_la_SOURCES = \
arch.h \
base64.h \
base64.c \
crc16.h \
defines.h \
fifo.c \
fifo.h \
file.c \
file.h \
file_loc.h \
list.c \
list.h \
list16.c \
@@ -413,7 +432,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign common/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign common/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -476,6 +494,7 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c

@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fifo.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@
@@ -743,6 +762,8 @@ uninstall-am: uninstall-includeHEADERS uninstall-moduleLTLIBRARIES
tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
uninstall-moduleLTLIBRARIES

.PRECIOUS: Makefile


# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.


+ 42
- 36
common/arch.h View File

@@ -19,9 +19,31 @@
#if !defined(ARCH_H)
#define ARCH_H

#if defined(HAVE_CONFIG_H)
#include "config_ac.h"
#include <stdlib.h>

#if defined(HAVE_STDINT_H)
#include <stdint.h>
#else
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
#if defined(_WIN64)
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
typedef signed __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
#else
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
typedef signed long intptr_t;
typedef unsigned long uintptr_t;
#endif
#endif

typedef int bool_t;

/* you can define L_ENDIAN or B_ENDIAN and NEED_ALIGN or NO_NEED_ALIGN
in the makefile to override */
@@ -58,7 +80,7 @@
#define NEED_ALIGN
#elif defined(__x86__) || defined(__x86_64__) || \
defined(__AMD64__) || defined(_M_IX86) || defined (_M_AMD64) || \
defined(__i386__)
defined(__i386__) || defined(__aarch64__)
#define NO_NEED_ALIGN
#else
#warning unknown arch
@@ -74,14 +96,6 @@
#define THREAD_CC
#endif

#if defined(__BORLANDC__) || defined(_WIN32)
#define APP_CC __fastcall
#define DEFAULT_CC __cdecl
#else
#define APP_CC
#define DEFAULT_CC
#endif

#if defined(_WIN32)
#if defined(__BORLANDC__)
#define EXPORT_CC _export __cdecl
@@ -94,37 +108,29 @@

#ifndef DEFINED_Ts
#define DEFINED_Ts
typedef char ti8;
typedef unsigned char tui8;
typedef signed char tsi8;
typedef short ti16;
typedef unsigned short tui16;
typedef signed short tsi16;
typedef int ti32;
typedef unsigned int tui32;
typedef signed int tsi32;
typedef int tbool;
#if defined(_WIN64)
/* Microsoft's VC++ compiler uses the more backwards-compatible LLP64 model.
Most other 64 bit compilers(Solaris, AIX, HP, Linux, Mac OS X) use
the LP64 model.
long is 32 bits in LLP64 model, 64 bits in LP64 model. */
typedef __int64 tbus;
#else
typedef long tbus;
#endif
typedef tbus tintptr;
typedef int8_t ti8;
typedef uint8_t tui8;
typedef int8_t tsi8;
typedef int16_t ti16;
typedef uint16_t tui16;
typedef int16_t tsi16;
typedef int32_t ti32;
typedef uint32_t tui32;
typedef int32_t tsi32;
typedef int64_t ti64;
typedef uint64_t tui64;
typedef int64_t tsi64;
typedef bool_t tbool;
typedef intptr_t tbus;
typedef intptr_t tintptr;

/* wide char, socket */
#if defined(_WIN32)
typedef unsigned short twchar;
typedef unsigned int tsock;
typedef unsigned __int64 tui64;
typedef signed __int64 tsi64;
#else
typedef int twchar;
typedef int tsock;
typedef unsigned long long tui64;
typedef signed long long tsi64;
#endif
#endif /* DEFINED_Ts */

@@ -140,7 +146,7 @@ typedef signed long long tsi64;
#ifdef __cplusplus
extern "C" {
#endif
tintptr mod_init();
tintptr mod_init(void);
int mod_exit(tintptr);
#ifdef __cplusplus
}


+ 80
- 0
common/base64.c View File

@@ -0,0 +1,80 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Koichiro Iwao 2017
*
* 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.
*
* Base64 encoder / decoder
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include "os_calls.h"

#include <openssl/bio.h>
#include <openssl/evp.h>

size_t
base64_decoded_bytes(const char *src)
{
size_t len;
size_t padding;

len = g_strlen(src);
padding = 0;

if (src[len - 1] == '=')
{
padding++;

if (src[len - 2] == '=')
{
padding++;
}
}

return len * 3 / 4 - padding;
}

/*****************************************************************************/
char *
base64_decode(char *dst, const char *src, size_t len)
{
BIO *b64;
BIO *bio;
char *b64str;
size_t estimated_decoded_bytes;
size_t decoded_bytes;

b64str = g_strdup(src);
estimated_decoded_bytes = base64_decoded_bytes(b64str);
dst[estimated_decoded_bytes] = '\0';

b64 = BIO_new(BIO_f_base64());
bio = BIO_new_mem_buf(b64str, len);
bio = BIO_push(b64, bio);
BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
decoded_bytes = BIO_read(bio , dst, len);
BIO_free_all(bio);

/* if input is corrupt, return empty string */
if (estimated_decoded_bytes != decoded_bytes)
{
g_strncpy(dst, "", sizeof(""));
}

return dst;
}

+ 31
- 0
common/base64.h View File

@@ -0,0 +1,31 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Koichiro Iwao 2017
*
* 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.
*
* Base64 encoder / decoder
*/

#if !defined(SSL_CALLS_H)
#define SSL_CALLS_H

#include "arch.h"

size_t
base64_decoded_bytes(const char *src);
char *
base64_decode(char *dst, const char *src, size_t len);

#endif

+ 9
- 5
common/fifo.c View File

@@ -18,6 +18,10 @@
* FIFO implementation to store pointer to data struct
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include "fifo.h"
#include "os_calls.h"

@@ -27,7 +31,7 @@
* @return pointer to new FIFO or NULL if system out of memory
*****************************************************************************/

FIFO * APP_CC
FIFO *
fifo_create(void)
{
return (FIFO *) g_malloc(sizeof(FIFO), 1);
@@ -37,7 +41,7 @@ fifo_create(void)
* Delete specified FIFO
*****************************************************************************/

void APP_CC
void
fifo_delete(FIFO *self)
{
USER_DATA *udp;
@@ -87,7 +91,7 @@ fifo_delete(FIFO *self)
* @return 0 on success, -1 on error
*****************************************************************************/

int APP_CC
int
fifo_add_item(FIFO *self, void *item)
{
USER_DATA *udp;
@@ -124,7 +128,7 @@ fifo_add_item(FIFO *self, void *item)
* @return top item from FIFO or NULL if FIFO is empty
*****************************************************************************/

void * APP_CC
void *
fifo_remove_item(FIFO *self)
{
void *item;
@@ -159,7 +163,7 @@ fifo_remove_item(FIFO *self)
* @return true if FIFO is empty, false otherwise
*****************************************************************************/

int APP_CC
int
fifo_is_empty(FIFO *self)
{
if (!self)


+ 5
- 5
common/fifo.h View File

@@ -38,10 +38,10 @@ typedef struct fifo
int auto_free;
} FIFO;

FIFO * APP_CC fifo_create(void);
void APP_CC fifo_delete(FIFO *self);
int APP_CC fifo_add_item(FIFO *self, void *item);
void * APP_CC fifo_remove_item(FIFO *self);
int APP_CC fifo_is_empty(FIFO *self);
FIFO * fifo_create(void);
void fifo_delete(FIFO *self);
int fifo_add_item(FIFO *self, void *item);
void * fifo_remove_item(FIFO *self);
int fifo_is_empty(FIFO *self);

#endif

+ 15
- 11
common/file.c View File

@@ -18,6 +18,10 @@
* read a config file
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include "arch.h"
#include "os_calls.h"
#include "list.h"
@@ -26,14 +30,14 @@

#define FILE_MAX_LINE_BYTES 2048

static int APP_CC
static int
file_read_ini_line(struct stream *s, char *text, int text_bytes);

/*****************************************************************************/
/* look up for a section name within str (i.e. pattern [section_name])
* if a section name is found, this function return 1 and copy the section
* inplace of str. */
static int APP_CC
static int
line_lookup_for_section_name(char *str, int str_bytes)
{
int name_index_start;
@@ -72,7 +76,7 @@ line_lookup_for_section_name(char *str, int str_bytes)
/* returns error
returns 0 if everything is ok
returns 1 if problem reading file */
static int APP_CC
static int
l_file_read_sections(int fd, int max_file_size, struct list *names)
{
struct stream *s;
@@ -113,7 +117,7 @@ l_file_read_sections(int fd, int max_file_size, struct list *names)
* returns error
* returns 0 if everything is ok
* returns 1 if problem reading file */
static int APP_CC
static int
file_read_ini_line(struct stream *s, char *text, int text_bytes)
{
int i;
@@ -191,7 +195,7 @@ file_read_ini_line(struct stream *s, char *text, int text_bytes)

/*****************************************************************************/
/* returns error */
static int APP_CC
static int
file_split_name_value(char *text, char *name, char *value)
{
int len;
@@ -209,7 +213,7 @@ file_split_name_value(char *text, char *name, char *value)

for (i = 0; i < len; i++)
{
if (text[i] == '=')
if (text[i] == '=' && !on_to)
{
on_to = 1;
}
@@ -234,7 +238,7 @@ file_split_name_value(char *text, char *name, char *value)

/*****************************************************************************/
/* return error */
static int APP_CC
static int
l_file_read_section(int fd, int max_file_size, const char *section,
struct list *names, struct list *values)
{
@@ -320,7 +324,7 @@ l_file_read_section(int fd, int max_file_size, const char *section,
returns 0 if everything is ok
returns 1 if problem reading file */
/* 32 K file size limit */
int APP_CC
int
file_read_sections(int fd, struct list *names)
{
return l_file_read_sections(fd, 32 * 1024, names);
@@ -330,7 +334,7 @@ file_read_sections(int fd, struct list *names)
/* return error */
/* this function should be preferred over file_read_sections because it can
read any file size */
int APP_CC
int
file_by_name_read_sections(const char *file_name, struct list *names)
{
int fd;
@@ -359,7 +363,7 @@ file_by_name_read_sections(const char *file_name, struct list *names)
/*****************************************************************************/
/* return error */
/* 32 K file size limit */
int APP_CC
int
file_read_section(int fd, const char *section,
struct list *names, struct list *values)
{
@@ -370,7 +374,7 @@ file_read_section(int fd, const char *section,
/* return error */
/* this function should be preferred over file_read_section because it can
read any file size */
int APP_CC
int
file_by_name_read_section(const char *file_name, const char *section,
struct list *names, struct list *values)
{


+ 4
- 4
common/file.h View File

@@ -23,14 +23,14 @@

#include "arch.h"

int APP_CC
int
file_read_sections(int fd, struct list* names);
int APP_CC
int
file_by_name_read_sections(const char* file_name, struct list* names);
int APP_CC
int
file_read_section(int fd, const char* section,
struct list* names, struct list* values);
int APP_CC
int
file_by_name_read_section(const char* file_name, const char* section,
struct list* names, struct list* values);



+ 0
- 68
common/file_loc.h View File

@@ -1,68 +0,0 @@
/**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Jay Sorg 2004-2014
*
* 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.
*
* default file locations for log, config, etc
*/

#if !defined(FILE_LOC_H)
#define FILE_LOC_H

#if !defined(XRDP_CFG_PATH)
#define XRDP_CFG_PATH "/etc/xrdp"
#endif

#if !defined(XRDP_PID_PATH)
#define XRDP_PID_PATH "/var/run"
#endif

#if !defined(XRDP_SBIN_PATH)
#define XRDP_SBIN_PATH "/usr/local/sbin"
#endif

#if !defined(XRDP_SHARE_PATH)
#define XRDP_SHARE_PATH "/usr/local/share/xrdp"
#endif

#if !defined(XRDP_MODULE_PATH)
#define XRDP_MODULE_PATH "/usr/local/lib/xrdp"
#endif

#if !defined(XRDP_LOG_PATH)
#define XRDP_LOG_PATH "/var/log"
#endif

#if !defined(XRDP_CHANSRV_STR)
#define XRDP_CHANSRV_STR "/tmp/.xrdp/xrdp_chansrv_socket_%d"
#endif

#if !defined(CHANSRV_PORT_OUT_STR)
#define CHANSRV_PORT_OUT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d"
#endif

#if !defined(CHANSRV_PORT_IN_STR)
#define CHANSRV_PORT_IN_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
#endif

#if !defined(CHANSRV_API_STR)
#define CHANSRV_API_STR "/tmp/.xrdp/xrdpapi_%d"
#endif

#if !defined(XRDP_X11RDP_STR)
#define XRDP_X11RDP_STR "/tmp/.xrdp/xrdp_display_%d"
#endif

#endif

+ 15
- 11
common/list.c View File

@@ -18,12 +18,16 @@
* simple list
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include "arch.h"
#include "os_calls.h"
#include "list.h"

/*****************************************************************************/
struct list *APP_CC
struct list *
list_create(void)
{
struct list *self;
@@ -36,7 +40,7 @@ list_create(void)
}

/*****************************************************************************/
void APP_CC
void
list_delete(struct list *self)
{
int i;
@@ -60,7 +64,7 @@ list_delete(struct list *self)
}

/*****************************************************************************/
void APP_CC
void
list_add_item(struct list *self, tbus item)
{
tbus *p;
@@ -81,7 +85,7 @@ list_add_item(struct list *self, tbus item)
}

/*****************************************************************************/
tbus APP_CC
tbus
list_get_item(const struct list *self, int index)
{
if (index < 0 || index >= self->count)
@@ -93,7 +97,7 @@ list_get_item(const struct list *self, int index)
}

/*****************************************************************************/
void APP_CC
void
list_clear(struct list *self)
{
int i;
@@ -115,7 +119,7 @@ list_clear(struct list *self)
}

/*****************************************************************************/
int APP_CC
int
list_index_of(struct list *self, tbus item)
{
int i;
@@ -132,7 +136,7 @@ list_index_of(struct list *self, tbus item)
}

/*****************************************************************************/
void APP_CC
void
list_remove_item(struct list *self, int index)
{
int i;
@@ -155,7 +159,7 @@ list_remove_item(struct list *self, int index)
}

/*****************************************************************************/
void APP_CC
void
list_insert_item(struct list *self, int index, tbus item)
{
tbus *p;
@@ -193,7 +197,7 @@ list_insert_item(struct list *self, int index, tbus item)
/*****************************************************************************/
/* append one list to another using strdup for each item in the list */
/* begins copy at start_index, a zero based index on the source list */
void APP_CC
void
list_append_list_strdup(struct list *self, struct list *dest, int start_index)
{
int index;
@@ -209,7 +213,7 @@ list_append_list_strdup(struct list *self, struct list *dest, int start_index)
}

/*****************************************************************************/
void APP_CC
void
list_dump_items(struct list *self)
{
int index;
@@ -221,6 +225,6 @@ list_dump_items(struct list *self)

for (index = 0; index < self->count; index++)
{
g_writeln("%d: 0x%lx", index, list_get_item(self, index));
g_writeln("%d: %p", index, (void *) list_get_item(self, index));
}
}

+ 10
- 10
common/list.h View File

@@ -33,25 +33,25 @@ struct list
int auto_free;
};

struct list* APP_CC
struct list*
list_create(void);
void APP_CC
void
list_delete(struct list* self);
void APP_CC
void
list_add_item(struct list* self, tintptr item);
tintptr APP_CC
tintptr
list_get_item(const struct list *self, int index);
void APP_CC
void
list_clear(struct list* self);
int APP_CC
int
list_index_of(struct list* self, tintptr item);
void APP_CC
void
list_remove_item(struct list* self, int index);
void APP_CC
void
list_insert_item(struct list* self, int index, tintptr item);
void APP_CC
void
list_append_list_strdup(struct list* self, struct list* dest, int start_index);
void APP_CC
void
list_dump_items(struct list* self);

#endif

+ 14
- 10
common/list16.c View File

@@ -18,12 +18,16 @@
* simple list
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include "arch.h"
#include "os_calls.h"
#include "list16.h"

/*****************************************************************************/
struct list16 *APP_CC
struct list16 *
list16_create(void)
{
struct list16 *self;
@@ -34,7 +38,7 @@ list16_create(void)
}

/*****************************************************************************/
void APP_CC
void
list16_delete(struct list16 *self)
{
if (self == 0)
@@ -47,7 +51,7 @@ list16_delete(struct list16 *self)
}

/*****************************************************************************/
void APP_CC
void
list16_init(struct list16* self)
{
g_memset(self, 0, sizeof(struct list16));
@@ -56,7 +60,7 @@ list16_init(struct list16* self)
}

/*****************************************************************************/
void APP_CC
void
list16_deinit(struct list16* self)
{
if (self->items != self->mitems)
@@ -66,7 +70,7 @@ list16_deinit(struct list16* self)
}

/*****************************************************************************/
void APP_CC
void
list16_add_item(struct list16 *self, tui16 item)
{
tui16 *p;
@@ -90,7 +94,7 @@ list16_add_item(struct list16 *self, tui16 item)
}

/*****************************************************************************/
tui16 APP_CC
tui16
list16_get_item(struct list16 *self, int index)
{
if (index < 0 || index >= self->count)
@@ -102,7 +106,7 @@ list16_get_item(struct list16 *self, int index)
}

/*****************************************************************************/
void APP_CC
void
list16_clear(struct list16 *self)
{
if (self->items != self->mitems)
@@ -115,7 +119,7 @@ list16_clear(struct list16 *self)
}

/*****************************************************************************/
int APP_CC
int
list16_index_of(struct list16 *self, tui16 item)
{
int i;
@@ -132,7 +136,7 @@ list16_index_of(struct list16 *self, tui16 item)
}

/*****************************************************************************/
void APP_CC
void
list16_remove_item(struct list16 *self, int index)
{
int i;
@@ -149,7 +153,7 @@ list16_remove_item(struct list16 *self, int index)
}

/*****************************************************************************/
void APP_CC
void
list16_insert_item(struct list16 *self, int index, tui16 item)
{
tui16 *p;


+ 10
- 10
common/list16.h View File

@@ -32,25 +32,25 @@ struct list16
tui16 mitems[4];
};

struct list16* APP_CC
struct list16*
list16_create(void);
void APP_CC
void
list16_delete(struct list16* self);
void APP_CC
void
list16_init(struct list16* self);
void APP_CC
void
list16_deinit(struct list16* self);
void APP_CC
void
list16_add_item(struct list16* self, tui16 item);
tui16 APP_CC
tui16
list16_get_item(struct list16* self, int index);
void APP_CC
void
list16_clear(struct list16* self);
int APP_CC
int
list16_index_of(struct list16* self, tui16 item);
void APP_CC
void
list16_remove_item(struct list16* self, int index);
void APP_CC
void
list16_insert_item(struct list16* self, int index, tui16 item);

#endif

+ 20
- 16
common/log.c View File

@@ -16,6 +16,10 @@
* limitations under the License.
*/

#if defined(HAVE_CONFIG_H)
#include <config_ac.h>
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -48,7 +52,7 @@ static struct log_config *g_staticLogConfig = NULL;
* @return see open(2) return values
*
*/
int DEFAULT_CC
int
internal_log_file_open(const char *fname)
{
int ret = -1;
@@ -76,7 +80,7 @@ internal_log_file_open(const char *fname)
* @return syslog equivalent logging level
*
*/
int DEFAULT_CC
int
internal_log_xrdp2syslog(const enum logLevels lvl)
{
switch (lvl)
@@ -104,7 +108,7 @@ internal_log_xrdp2syslog(const enum logLevels lvl)
* @return The log string in str pointer.
*
*/
void DEFAULT_CC
void
internal_log_lvl2str(const enum logLevels lvl, char *str)
{
switch (lvl)
@@ -131,7 +135,7 @@ internal_log_lvl2str(const enum logLevels lvl, char *str)
}

/******************************************************************************/
enum logReturns DEFAULT_CC
enum logReturns
internal_log_start(struct log_config *l_cfg)
{
enum logReturns ret = LOG_GENERAL_ERROR;
@@ -179,7 +183,7 @@ internal_log_start(struct log_config *l_cfg)
}

/******************************************************************************/
enum logReturns DEFAULT_CC
enum logReturns
internal_log_end(struct log_config *l_cfg)
{
enum logReturns ret = LOG_GENERAL_ERROR;
@@ -221,7 +225,7 @@ internal_log_end(struct log_config *l_cfg)
* @param buf
* @return
*/
enum logLevels DEFAULT_CC
enum logLevels
internal_log_text2level(const char *buf)
{
if (0 == g_strcasecmp(buf, "0") ||
@@ -255,7 +259,7 @@ internal_log_text2level(const char *buf)
return LOG_LEVEL_DEBUG;
}

enum logReturns DEFAULT_CC
enum logReturns
internalReadConfiguration(const char *inFilename, const char *applicationName)
{
int fd;
@@ -316,7 +320,7 @@ internalReadConfiguration(const char *inFilename, const char *applicationName)
}

/******************************************************************************/
enum logReturns DEFAULT_CC
enum logReturns
internal_config_read_logging(int file, struct log_config *lc,
struct list *param_n,
struct list *param_v,
@@ -391,7 +395,7 @@ internal_config_read_logging(int file, struct log_config *lc,
return LOG_STARTUP_OK;
}

enum logReturns DEFAULT_CC
enum logReturns