Commit Graph

947 Commits

Author SHA1 Message Date
matt335672
e1c6afa38e
Merge pull request #2144 from matt335672/remove_s_check
Remove s_check() macro
2022-02-14 09:00:21 +00:00
zbstao
35d400a899 Fixed possible SIGCHILD signal lost
When multiple(eg. 20) xrdp connections are disconnected at the same time(eg.  close all rdp client at the same time), zombie process may be spawned.
2022-02-10 22:18:14 +08:00
matt335672
e6c098e750 Remove s_check() macro 2022-02-09 10:18:15 +00:00
matt335672
eb4a8e342d Add lower bound to sesman data input size check 2022-02-02 10:39:50 +00:00
matt335672
d02059d967 Add missing ssl_sha1_clear()/ssl_md5_clear() calls 2022-01-20 16:43:00 +00:00
matt335672
cffce1f856 Only advertise X11 clip formats we can supply 2022-01-14 11:11:03 +00:00
Kentaro Hayashi
47bc56f5a4 Add sesman.ini new text/file/image restriction settings
RestrictInboundClipboard is added.

Then, RestrictOutboundClipboard/RestrictInboundClipboard configuration
is extended to accept comma separated list.

  * RestrictOutboundClipboard=none
  * RestrictOutboundClipboard=text
  * RestrictOutboundClipboard=file
  * RestrictOutboundClipboard=image
  * RestrictOutboundClipboard=all
  * RestrictOutboundClipboard=text, image, file

For compatibility, the following configuration is also
accepted (alias)

  * RestrictOutboundClipboard=true
  * RestrictOutboundClipboard=false
  * RestrictOutboundClipboard=yes
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
1d6d80d14f Block inbound clipboard text/image/file respectively
Disable clipboard_event_selection_request call is overkill for
blocking text/image/file purpose.
For example, it breaks existing behavior (slow response from gedit,
gimp as a side effects)

Instead, in clipboard_event_selection_request, these media format will
be blocked respectively which depends on the following configurations
in sesman.ini [Security] section.

  * RestrictInboundClipboard=text
  * RestrictInboundClipboard=file
  * RestrictInboundClipboard=image

You can also set comma separated list.

  * RestrictInboundClipboard=text,file,image
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
fb1c4ec945 Block outbound clipboard text/image/file respectively
RestrictOutboundClipboard kills all of test/file/image
transfer via clipboard.

For controlling each content type behavior,
clipboard_xevent is not appropriate place to block respectively.

Instead, in clipboard_event_selection_notify, these media type
will be blocked which depends on the following configurations in
sesman.ini [Security] section.

  * RestrictOutboundClipboard=text
  * RestrictOutboundClipboard=file
  * RestrictOutboundClipboard=image

You can also set comma separated list

  * RestrictOutboundClipboard=text, file, image
2022-01-14 10:17:02 +09:00
Kentaro Hayashi
bd82084505 Extend In/Outbound text,file,image restriction respectively
It supports the extended configurations for sesman.ini:

Before:

  [Security]
  RestrictOutboundClipboard=true or false

After:

  [Security]
  RestrictInboundClipboard=[true or false | text or file or image | comma separated list]
  RestrictOutboundClipboard=[true or false | text or file or image | comma separated list]

Above configuration is disabled by default (false)
And it can be specified comma separated list like this:.

  RestrictInboundClipboard=file, image
  RestrictOutboundClipboard=text, file, image

Note that if RestrictOutboundClipboard=true,file is set,
file is ignored and it is treated as RestrictOutboundClipboard=true

It is same for RestrictInboundClipboard.
2022-01-14 10:17:02 +09:00
matt335672
ab0e141fa9
Merge pull request #2011 from matt335672/unify_scpv0_code
Unify scpv0 code #2011
2022-01-05 11:06:42 +00:00
Kentaro Hayashi
53027ad5af Use LOG instead of LOG_DEVEL
According to https://github.com/neutrinolabs/xrdp/wiki/Logging,
it may be better to emit this log message because this log is
useful for system administrator to know whether RestrictOutboundClipboard
configuration works or not

And raise log level to info because it is informative for system
administrator.
2021-12-23 12:58:35 +09:00
Kentaro Hayashi
23906383b6 clipboard: Fix wrong debug level log message for g_file_atom2
As g_file_atom2 is x-special/gnome-copied-files
(See g_file_atom2 definition in sesman/chansrv/clipboard.c),
it should be "x-special/gnome-copied-files" in this context.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
2021-12-06 12:40:41 +09:00
matt335672
5c610aee28 Modify sesrun to use common SCP V0 interface 2021-11-25 13:30:34 +00:00
matt335672
30a92cb095 Changes to libtrans interface 2021-11-25 13:30:34 +00:00
matt335672
5862a6123f Changes for unifying libscp code 2021-11-25 13:30:34 +00:00
matt335672
8b9b22c773 Create shared GUID module to simplify session guid handling 2021-11-25 13:29:55 +00:00
matt335672
ce23c824ea
Merge pull request #1976 from matt335672/fail2ban_support
Fail2ban support (#1076)
2021-11-18 10:11:12 +00:00
matt335672
a49144be73 Avoid deadlock in clipboard copy code 2021-10-25 16:16:59 +01:00
matt335672
b87b7f9ee8 Add xfuse_path_in_xfuse_fs() 2021-10-25 16:16:54 +01:00
matt335672
0b28fe05b6 Address review comments 2021-10-25 11:35:35 +01:00
matt335672
5fb621ca53 Logged IP address for fail2ban on login failure 2021-10-25 11:35:35 +01:00
matt335672
60016c1f75 Rename client_ip to connection_description 2021-10-25 11:35:35 +01:00
matt335672
d868c00e2c Adding (working) stanza for Apline to startwm.sh 2021-09-27 14:41:44 +01:00
matt335672
346f48401e Revert 57bf8b8a5c 2021-09-27 10:52:18 +01:00
matt335672
32d5d7cc27
Merge pull request #2001 from metalefty/clipfile-fail
clipboard file: Implement MS-RDPECLIP 3.1.5.4.7 compliance (#2001)
2021-09-21 10:37:35 +01:00
Koichiro IWAO
eb848747d2
clipboard file: adjust log level and add some detailed info 2021-09-21 18:19:47 +09:00
Koichiro IWAO
ad13956b12
clipboard file: Implement MS-RDPECLIP 3.1.5.4.7 compliance
If the requested file data could not be retrieved or the sender received
an unsuccessful Format List Response PDU (section 3.1.5.2.4), then the
clipHeader field MUST contain the CB_RESPONSE_FAIL (0x0002) flag and the
requestedFileContentsData field MUST contain no data (zero-length).

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpeclip/5d3991e9-440d-4e4d-8b8d-391c324c4007

Fixes #1997.
2021-09-21 16:50:42 +09:00
matt335672
2dbec63327 Add Nautilus 3 compatibility 2021-09-16 10:02:02 +01:00
matt335672
253ea6eb6d Send clip response for string while file list is available 2021-09-16 10:02:02 +01:00
matt335672
d9988c340c Improve error checking and logging for returned CLIPRDR_FILELIST 2021-09-16 10:02:02 +01:00
matt335672
e1bbef99aa Check CLIPRDR_FILEDESCRIPTOR is present before reading it 2021-09-09 14:38:07 +01:00
matt335672
8fdf7b518c Correct filename padding skip in CLIPRDR_FILEDESCRIPTOR 2021-09-09 14:38:04 +01:00
matt335672
6a5895ce37 Remove unnecessary malloc/free 2021-09-09 14:37:35 +01:00
matt335672
9d8676f89d Corrected size of filename in struct clip_file_desc 2021-09-09 14:37:27 +01:00
matt335672
8e9fb8008f Addressed review comments 2021-09-08 11:51:21 +01:00
matt335672
d32953c405 Parse DEVICE_ANNOUNCE header correctly 2021-09-08 11:33:43 +01:00
matt335672
b481351ad7
Merge pull request #1954 from metalefty/clipboard-file-log
clipboard: log file transfer for the purpose of audit (#1954)
2021-08-11 09:19:16 +01:00
Koichiro IWAO
1722451715
clipboard: log file transfer for the purpose of audit
Sponsored by: @CyberTrust and @haw
2021-08-11 15:38:24 +09:00
Francesco Colista
57bf8b8a5c sesman/startwm.sh : add support for Alpine Linux 2021-08-09 16:52:11 +02:00
matt335672
5c9839a7f4 Address review comments 2021-07-27 13:36:34 +01:00
matt335672
d4c81229ba Module testing now OK 2021-07-27 13:36:34 +01:00
matt335672
c9afd804a4 Minor const and comment fixes 2021-07-27 13:36:34 +01:00
matt335672
a10de5c5aa Removed struct SCP_CONNECTION type entirely 2021-07-27 13:36:34 +01:00
matt335672
3643cc37ec Fix compile issues with SCP states 2021-07-27 13:36:34 +01:00
Jay Sorg
95d4de206d work on moving to trans for scp v1 2021-07-27 13:36:32 +01:00
Jay Sorg
738e346f81 sesman: work on moving sesman to trans, v0 scp working 2021-07-27 13:35:43 +01:00
matt335672
36ec662a13 Log a message for failed logins 2021-07-19 09:29:04 +01:00
matt335672
20ec03dbe0
Merge pull request #1900 from matt335672/issue1885
Rework VNC text clipboard interface (#1900)
2021-07-07 09:22:57 +01:00
matt335672
a79f5c00b1 Replace snprintf() with g_snprintf() 2021-06-17 15:15:59 +01:00