Commit Graph

287 Commits

Author SHA1 Message Date
akallabeth 98fb56b767 [channels,cliprdr] implement client clipboard direction filter
* Filter remote -> local or local -> remote clipboard depending on
  setting.
* Filter remote -> local or local -> remote file clipboard
  depending on setting.
2023-05-25 16:26:39 +02:00
akallabeth 7073aef79f [channel,cliprdr] add missing include in header 2023-05-12 13:57:56 +02:00
akallabeth a5b42f0f84 [includes] untangled circular includes 2023-03-15 08:22:23 +01:00
Armin Novak 1b28bd0d36 [channels,cliprdr] use logger tag macros 2023-03-05 17:55:28 +01:00
akallabeth cf9777cd92 [channels] simplified server linking 2023-03-01 08:18:34 +01:00
akallabeth c3a82daad6 [channels] simplified client linking 2023-03-01 08:18:34 +01:00
Armin Novak 6256933e75 [channels,cliprdr] remove clipboard data hex dump
just too noisy for logging
2023-02-23 20:28:15 +01:00
Armin Novak 641022b795 [logging] remove __FUNCTION__ from actual message
prefer the log formatter to provide that information.
2023-01-25 16:26:39 +01:00
Martin Fleisz 8d917698ea cliprdr: Fix sending of server-side PDUs
The old implementation used `Stream_GetLength` to obtain the amount of
data to send. However some PDUs (i.e. CLIPRDR_FILECONTENTS_REQUEST) are
overallocated as they contain optional data (clipDataId in this case).

We now use the position to determine the actual data written to the PDU
instead of the amount of bytes allocated, avoid sending garbage data to
the client.
2023-01-09 07:47:17 +01:00
akallabeth 7e1065a9b9 Fixed Wshadow warnings 2022-12-09 15:58:26 +01:00
Armin Novak 1422136e81 [channel,cliprdr] append '\0' to format names 2022-12-03 10:53:18 +01:00
Armin Novak cfe09892be [channel,cliprdr] log debug information
Log cliprdr debug information without compile flags
2022-12-03 10:53:18 +01:00
akallabeth 5799fb2018 Replace ConvertFromUnicode and ConvertToUnicode
* Use new ConvertUtf8ToWChar, ConvertUtf8NToWChar,
  ConvertUtf8ToWCharAlloc and ConvertUtf8NToWCharAlloc
* Use new ConvertWCharToUtf8, ConvertWCharNToUtf8,
  ConvertWCharToUtf8Alloc and ConvertWCharNToUtf8Alloc
* Use new Stream UTF16 to/from UTF8 read/write functions
* Use new settings UTF16 to/from UTF8 read/write functions
2022-11-28 10:42:36 +01:00
akallabeth 2da280b8a1 Fixed compilation warnings 2022-07-04 14:59:21 +02:00
akallabeth 9a2a37786e Refactored clipboard structs 2022-07-04 14:31:08 +02:00
akallabeth bc8b4ade1c reformatted 2022-06-23 08:48:39 +02:00
akallabeth 1dcc5a180a Fixed warnings 2022-04-28 11:24:51 +02:00
akallabeth 73cdcdfe09
Logging and parser fixes (#7796)
* Fixed remdesk settings pointer

* Fixed sign warnings in display_write_monitor_layout_pdu

* Use freerdp_abort_connect_context and freerdp_shall_disconnect_context

* Added and updates settings

* info assert/dynamic timezone

* mcs assert/log/flags

* Fixed and added assertions for wStream

* Unified stream length checks

* Added new function to check for lenght and log
* Replace all usages with this new function

* Cleaned up PER, added parser logging

* Cleaned up BER, added parser logging

* log messages

* Modified Stream_CheckAndLogRequiredLengthEx

* Allow custom format and options
* Add Stream_CheckAndLogRequiredLengthExVa for prepared va_list

* Improved Stream_CheckAndLogRequiredLength

* Now have log level adjustable
* Added function equivalents for existing logger
* Added a backtrace in case of a failure is detected

* Fixed public API input checks
2022-04-19 14:29:17 +02:00
Armin Novak c6924cb126 Moved clipboard utils to core library, fixes #6760 2022-03-28 14:59:30 +02:00
Armin Novak 4d03d7c0bf Freerdp remove #ifdef HAVE_CONFIG_H 2022-03-03 11:26:48 +01:00
Armin Novak b2ad47a809 Reorganized FreeRDP headers 2022-03-03 11:26:48 +01:00
akallabeth 8cc6582044
Unify struct definitions (#7633)
* Unified enum/struct definitions, fixed include issues

* Fixed mac compilation issues

* Added missing include

* Fixed windows server build warnings

* Fixed VS2010 build issue

* Removed unnecessary library linking

* Fixed ThreadPool WinXP compatibility

* Fixed pr review remarks
2022-02-14 14:59:22 +01:00
akallabeth 2422985f2a Fixed cliprdr_parse_file_list 2022-02-05 14:06:08 +00:00
akallabeth 4a4d783d4f
Moved clipboard custom context checks to implementation (#7501) 2021-12-17 13:47:20 +01:00
akallabeth 3ccb96d52f Fixed #7350: Warnings with Stream_StaticInit
* Properly initialize the stream buffer
* Add Stream_StaticConstInit accepting a const buffer
* Modify API to return a pointer to the stream initialized
2021-10-14 12:11:16 +02:00
akallabeth 7b7e2d6f32 Prefer constant division over multiplication for length checks 2021-09-21 08:55:22 +02:00
Armin Novak cde002f460 Cleaned up cliprdr 2021-09-09 08:53:20 +02:00
Armin Novak 467f7c3f6a Fixed proxy ulimit graceful client disconnect 2021-09-09 08:53:20 +02:00
Armin Novak 054f0ea260 Use defines instad of channel names 2021-08-25 10:54:24 +02:00
Biswapriyo Nath 173ab04b59 Use same data types as calling function prototypes. 2021-05-31 13:38:19 +02:00
Marc-André Moreau 841d019565 fix broken channel include path 2021-05-31 11:10:14 +02:00
sss 6b76ac9545 Revert "Revert "allow to use in single threaded mode" (#6864)"
This reverts commit f7465af44f.
2021-03-26 11:50:45 +01:00
akallabeth f7465af44f
Revert "allow to use in single threaded mode" (#6864)
This reverts commit bee2e1526d.
2021-03-05 13:02:38 +01:00
Gluzskiy Alexandr bee2e1526d allow to use in single threaded mode
(some client side channels and all server side channels still need to be
ported to new api)

server: build fix, do not disable threads for rfx encoder

cliprdr client channel: implemented support for DisableThreads option
looks like thread does not make sense at all for this channel

do not initialize disabled image codecs (respect settings)

channels: client: rail: added support for DisableThreads setting

changed "BOOL DisableThreads" to "UINT32 ThreadingFlags"
dropped unnecessary apu changes

draft implementation of threading settings aware message handling api
for addins/channels

rail: use new messaging api

fixed memory leak

msgs handlers external api changes (as requested)

msgs_handlers: init fix

fixed memory leak

logic fix

resolved problems appeared after rebase to master, dropped unnecessary
changes

git clang-format origin/master

fixed TestFreeRDPCodecRemoteFX.c

"formatting, run `clang-format` please"

properly use new "rfx_context_new(BOOL, UINT32)" everywhere

passed Threading Flags to "rfx_context_new" where available

in older C standarts veriables declaration must be done before any code

requested changes

clang-format as requested

use broken signatures of standert C functions for m$ s**tos

clang-format

requested changes

requested changes

moved ThreadingFlags to stable api zone

define type for channel msg handler

typo fix

clang-format

build fix

us ThreadingFlags from server settings

git clang-format origin/master

clang-format
2021-02-25 14:05:40 +01:00
akallabeth f3dad4106a Fixed support for huge files in clipboard 2021-01-25 08:43:46 +01:00
akallabeth d11422b6b8 Added missing include. 2020-11-18 07:18:25 +01:00
akallabeth e4243bb33c Corrected clipboard capability mask 2020-10-02 13:17:00 +02:00
akallabeth f282c55c7a Added clipboard CB_HUGE_FILE_SUPPORT_ENABLED flag 2020-09-29 09:03:49 +02:00
akallabeth 1546a8b655 Fixed naming of FILEDESCRIPTORW 2020-09-18 12:49:54 +02:00
Zhu Qun-Ying 2ba7f9da1d cliprdr_common.c: fix memory leak in certain error condition 2020-07-25 16:55:34 +02:00
Zhu Qun-Ying 2a286fbf65 Fixed error msg typo in ciprdr_main.c 2020-07-25 16:55:21 +02:00
akallabeth 58ef235bc5 Removed unused variable warnings 2020-05-20 15:10:07 +02:00
akallabeth c6e37dce79 Fixed #6162: Clipboard temporary path length limit
The limit of clipboard temporary paths is 260 '\0' terminated
wide characters. Fix the checks to enforce that properly.
2020-05-12 12:16:00 +02:00
akallabeth cbee45aace Fixed clipboard 'called with invalid type' warning 2020-05-06 13:31:57 +02:00
akallabeth 8ec50b6cc1 Fix short format name configuration and format list return. 2020-05-06 13:31:57 +02:00
akallabeth b230ac98e9 Fixed oob read in cliprdr_read_format_list 2020-05-06 13:31:57 +02:00
akallabeth 8e1a1b4075 Fixed cliprdr_server_receive_capabilities
Thanks to hac425 CVE-2020-11017, CVE-2020-11018
2020-05-06 13:31:57 +02:00
Armin Novak d2aef75004 Fix #5852: handle CHANNEL_EVENT_WRITE_CANCELLED
When channels are cleaned up OpenHandle is most of the time
already 0. Ignore the argument checks for
CHANNEL_EVENT_WRITE_CANCELLED and CHANNEL_EVENT_WRITE_COMPLETE
only check where actually required (CHANNEL_EVENT_DATA_RECEIVED)
2020-01-29 08:52:25 +01:00
Armin Novak 7c243da6e1 Remove symbols exported by accident. 2019-12-02 10:57:31 +01:00
kubistika 511f89cd99 cliprdr: common: fix validation of file contents request pdu 2019-11-12 12:45:01 +01:00