Commit Graph

3495 Commits

Author SHA1 Message Date
Ben Cohen
3b5b7a5935 UDS file deleted after first connection
If you run xrdp with a Unix Domain Socket (UDS) for the port specified in
/etc/xrdp/xrdp.ini then the first connection succeeds but subsequent
connections fail.  In fact the UDS is deleted from the filesystem as soon
as the first connection is established.

Test case:

1. Edit /etc/xrdp/xrdp.ini to set "port=/var/run/xrdp-local.socket".

2. Restart xrdp.

3. Run the following.  When rdesktop starts up and the logon dialog is
   displayed, press "Cancel".

   sudo socat TCP-LISTEN:12345 UNIX-CONNECT:/var/run/xrdp-local.socket &
   rdesktop localhost:12345

4. Run the following:

    sudo socat TCP-LISTEN:12346 UNIX-CONNECT:/var/run/xrdp-local.socket &
    rdesktop localhost:12346

Expected behaviour: rdesktop starts up and displays the logon dialog.
Observed behaviour: rdesktop exits with "ERROR: Connection closed" and
                    socat exits with "No such file or directory.

This is because in the child process after forking, xrdp_listen_fork()
calls trans_delete() which deletes the UDS.  Simply commenting out the
g_file_delete() and g_free() fixes this, but that isn't a proper solution
because trans_delete() is called from elsewhere where the UDS might no
longer be wanted.

Fix by adding a function trans_delete_from_child() that frees and clears
listen_filename before calling trans_delete(), and call the new function
from xrdp_listen_fork().

(Workaround: set "fork=false" in /etc/xrdp/xrdp.ini, because
trans_delete() is then not called.)
2018-03-27 09:22:49 +03:00
Fernando Seiti Furusato
9f80fcd74e Corrected endianness detection on ppc64el.
In common/arch.h, the endianness detection considers all powerpc
architectures as big endian. Since that is not true for ppc64el, I
added a verification that checks other preprocessor macros, only for
ppc cases.

Signed-off-by: Fernando Seiti Furusato <ferseiti@gmail.com>
2018-03-27 13:45:58 +09:00
Boris Bopp
31fc125e42 Configure.ac: Add missing macos option for pam config 2018-03-27 12:42:51 +09:00
Boris Bopp
e875cd2af5 instfiles: Add pam.d config for arch linux. 2018-03-27 12:42:51 +09:00
Koichiro IWAO
37d5430123
Update README a little bit 2018-03-26 11:11:51 +09:00
Koichiro IWAO
af57e191df
Bump version to v0.9.6 2018-03-26 11:11:51 +09:00
Koichiro IWAO
5f4130805f
Update NEWS for v0.9.6 2018-03-26 11:11:51 +09:00
Koichiro IWAO
a63c411772
sesman: rename vnc password file, just a cosmetic change 2018-03-23 19:16:10 +09:00
Jay Sorg
e40f0dc7e2 sesman: add hostname to vnc password file 2018-03-23 15:48:25 +09:00
Koichiro IWAO
780ba744f6
Revert "devredir: fix xinode leak"
This reverts commit 5daa09171e.

Causes "double free". Fix #990 was not correct.

```
[1271363627]: DEV_REDIR  dev_redir_proc_device_iocompletion: 738 : entered: IoStatus=0x0 CompletionId=1
[1271363627]: DEV_REDIR  dev_redir_proc_device_iocompletion: 839 : got CID_DIRECTORY_CONTROL
[1271363627]: DEV_REDIR  dev_redir_proc_query_dir_response: 933 : processing FILE_DIRECTORY_INFORMATION structs
[1271363627]: DEV_REDIR  dev_redir_proc_query_dir_response: 968 : FileName:          .
[1271363627]: DEV_REDIR  devredir_fuse_data_peek: 1335 : returning 0x7f2a9c013410
*** Error in `/usr/sbin/xrdp-chansrv': double free or corruption (out): 0x00007f2a9c13a330 ***
```

Closes: #1025
2018-03-23 11:40:52 +09:00
speidy
a432969746 common: ssl_calls: add support for OpenSSL>=1.1.0 API for DH keys
also fixes some memory leak introduced in PR#1024.
and adds a check that DH params generated successfully. write a proper log message if not.
2018-03-22 02:20:47 +02:00
speidy
8effc09ab7 common: ssl_calls: check if SSL object created right after its creation. 2018-03-21 08:16:12 +02:00
Koichiro IWAO
e3d0fd6d46
common: temporarily disable DHE
until make it possible to use generated DH parameters per installation.
2018-03-18 21:14:06 +09:00
Koichiro IWAO
97c21bc972 sesman: default startwm.sh should use bash
as it sources bash_profile. And add comments.
Closes #1009.
2018-03-09 14:24:17 +09:00
fbourqui
3d9e7db849
Update xrdp_keyboard.ini
Add the missing Swiss French rdp_layout_ definitions, ch(fr) in X11
2018-03-05 12:11:31 +01:00
Koichiro IWAO
1690950cc8
common: regenerate dhparam
Generated by: openssl dhparam -C 2236
2018-03-01 13:48:22 +09:00
Koichiro IWAO
578d23477c
common: obey coding style, remove trailing space 2018-03-01 12:11:52 +09:00
Enrico Tagliavini
70b5adb396 add support for DHE ciphers via compiled in dhparam
make it possible to use regular (non EC) EDH ciphers. To make this
possible a Diffie-Hellman parameter must be passed to the openssl
library. There are a few options possible as described in the manuals at
[1] and [2]. Simplest approach is to generate a DH parameter using
openssl dhparam -C <lenght> and include the code into the application.
The lenght used for this commit is 2236 bits long, which is the longest
possible without risking backward incompatibilities with old systems as
stated in [1]. Newer systems should use ECDH anyway, so it makes sense
to keep this method as compatible with older system as possible.
Paramters longer than 2048 should still be secure enough at the time of
writing.

[1] https://wiki.openssl.org/index.php/Diffie-Hellman_parameters
[2] https://wiki.openssl.org/index.php/Manual:SSL_CTX_set_tmp_dh_callback(3)
2018-03-01 09:57:35 +09:00
Enrico Tagliavini
6cdc0f31b0 enable automatic ECDH when possible (openssl 1.0.2)
Openssl 1.1.0 and later are enabling ECDH automatically, but for older
version it must be enabled explicitly or all Perfect Forward Secrecy
ciphers will be silently ignored. See also [1]. This commit applies the
same fix as found in CnetOS 7 httpd package to enable automatic ECDH as
found in [2].

[1] https://wiki.openssl.org/index.php/Diffie-Hellman_parameters
[2] https://git.centos.org/blob/rpms!httpd.git/c7/SOURCES!httpd-2.4.6-ssl-ecdh-auto.patch
2018-03-01 09:57:35 +09:00
Koichiro IWAO
793a418cfb
common: log what value is set to tls_ciphers
Related to #1033.
2018-02-20 13:13:37 +09:00
Koichiro IWAO
3da4d72323
common: quit using ! as comment out symbol in config files
It is not used anywhere in default config. Some config like
`tls_ciphers` might contain `!` like this:

    tls_ciphers=FIPS:!aNULL:!eNULL

Fixes #1033.
2018-02-20 13:13:34 +09:00
Vraiment
fd37805ac0 Make sesman.ini dynamic for the location of the configuration file 2018-02-19 11:41:55 +09:00
Vraiment
9ed5243de9 Make xrdp.ini to be dynamic for each operating system 2018-02-19 11:41:55 +09:00
daixj
31ef2552c4 log: revert permission 2018-02-13 16:44:37 +09:00
daixj
828079b442 libxrdp: fix memory leak 2018-02-13 16:44:37 +09:00
daixj
ea6bb62410 log: fix fd checking 2018-02-13 16:44:37 +09:00
daixj
551bb185c5 log: remove unused code and fix potential memory leak 2018-02-13 16:44:37 +09:00
Vraiment
09712d70ad Added PAM support for MacOS 2018-02-07 21:21:59 +09:00
Koichiro IWAO
c50015122c
FreeBSD: rework setsid code
Pull request #650 is not valid to avoid run session twice.
It certainly stops running session twice but causes #1016.

In FreeBSD, sesman process will run like this. The intermediate
sesman is needed to detect session termination correctly.

xrdp-sesman (daemon)
    |
    +- xrdp-sesman (FreeBSD specific intermediate sesman)
        |
        +- xrdp-sesman (bsd sesion leader & each session)
             |
             +- Xorg
             +- startwm.sh
             +- xrdp-chansrv

To stop runninng session twice correctly, just exit before the
intermediate sesman executes Xorg, WM and chansrv.
2018-02-06 16:03:10 +09:00
Vraiment
4cee6726f8 Make changes to generate dylibs in mac again 2018-01-30 01:21:07 -08:00
Koichiro IWAO
e16029cbc2
fix leak of SCP_DISCONNECTED_SESSION
Pointed out by: #919
2018-01-23 11:16:26 +09:00
Jay Sorg
f763cb3788 fix for zombie processes sometimes appearing 2018-01-22 04:34:09 +00:00
Jay Sorg
acd05f365f xrdp: xrdp_encoder.c fix compile when XRDP_RFXCODEC is not defined 2018-01-22 04:32:36 +00:00
Jay Sorg
a64cb81a36 xrdp: fix some leaks in xrdp_encoder.c 2018-01-22 04:32:36 +00:00
Koichiro IWAO
b17c45d86f
fix potential fd leak
In most cases, checking fd > 0 is not valid. open(2) returns -1 on
error, 0 on stdin, 1 on stdout, 2 on stderr, >2 . The border should be
between -1 and 0. Additionally, between 2 and 3.

Pointed out by: #919
2018-01-17 09:38:28 +09:00
Koichiro IWAO
5daa09171e
devredir: fix xinode leak
Pointed out by: #919
2018-01-12 09:24:03 +09:00
Koichiro IWAO
08f847d74b
sesman: refactor, change variable names
session_variables1 -> env_names
session_variables2 -> env_values

Use the name used in callee function env_set_user(). The former names
are not clear.
2018-01-11 10:57:47 +09:00
Koichiro IWAO
dcf64e43ca
remove trailing space 2018-01-11 10:57:43 +09:00
Koichiro IWAO
f2db57afb0
fix indent 2018-01-09 14:09:13 +09:00
matt335672
3f2a017c97 Make listen check before daemon fork 2017-12-27 15:00:18 +00:00
Koichiro IWAO
256fa11951
update submodules to the latest release 2017-12-27 23:40:24 +09:00
Koichiro IWAO
060e04313b Bump version to v0.9.5 2017-12-27 23:29:21 +09:00
Koichiro IWAO
8fee3c0f3f
Update NEWS for v0.9.5 2017-12-27 23:26:57 +09:00
Dominik George
53eccc93a2 Simplify pulseaudio module build instructions 2017-12-26 19:06:36 +09:00
Koichiro IWAO
001cb3e2c6 README: add a link to wiki, how to set up audio redirection 2017-12-26 09:26:51 +09:00
Koichiro IWAO
93481365d1 pulse: replace old pulse notes with bran-new README 2017-12-26 09:26:51 +09:00
Dominik George
3244cb59d5 Fix memory corruption introduced by CVE-2017-16927 fix. 2017-12-21 14:07:51 +09:00
cocoon
84c160725a workaround for corrupted display with W2K8
workaround for corrupted display like black bars left of cmd with W2K8
2017-12-18 10:39:42 +09:00
Koichiro IWAO
d8bb32541a sesman: bring Xorg at the top in sesman.ini
as Xorg prefered recommended backend now. Add more comments.
2017-12-16 00:27:06 +09:00
Koichiro IWAO
942bb6316a add comment on sessions xrdp.ini 2017-12-16 00:27:06 +09:00