Commit Graph

1497 Commits

Author SHA1 Message Date
akallabeth
a4c86723a3 Unifiy string append functions
(cherry picked from commit f25261e271)
2022-06-29 14:42:22 +02:00
akallabeth
430a1ef7bd Removed recursive xf_lock_x11 warning
(cherry picked from commit 298d32164c)
2022-05-31 11:02:10 +02:00
2fly2
b8be481a56 fix moving a window shrinks it 14x7 when connect to server 2019
Signed-off-by: 2fly2 <wjatchd@163.com>
(cherry picked from commit e1e2eef4e1)
2022-05-08 09:39:51 +02:00
akallabeth
dfd5abc42b Follow up to #7832: Add NULL checks
(cherry picked from commit 8b9ab80ef4)
2022-04-27 23:29:48 +02:00
2fly2
b5dbe5f14d fix restore a maximized window when it is minimized
Signed-off-by: 2fly2 <wjatchd@163.com>
(cherry picked from commit ee8cf9e023)
2022-04-27 18:32:13 +02:00
2fly2
4308d8e91e fix x11 black RAIL window when connect to server 2019
Signed-off-by: 2fly2 <wjatchd@163.com>
(cherry picked from commit cb66a4c0df)
2022-04-22 11:06:44 +02:00
Kazuki Oikawa
572c63a9f1 Supports 10bit X11 color (BGRX32 only)
(cherry picked from commit 8a86a4e8d9)
2022-04-19 08:54:32 +02:00
akallabeth
de805f8565 Decreased logging verbosity for INFO level
(cherry picked from commit e6b0373859)
2022-03-03 10:52:00 +01:00
akallabeth
de95335701 Added support for getpwuid_r, replaced duplicate code
* Use GetUserNameExA to get current user name when required.
* Add support for getpwuid_r if available

(cherry picked from commit 8a155db877)
2022-01-25 15:34:15 +01:00
akallabeth
d39a7ba5c3
Stable 2.0 backports (#7366)
* Fixed typo in changelog

* Fix FIPS mode support and build with OpenSSL 3.0

FreeRDP fails to build with OpenSSL 3.0 because of usage of the `FIPS_mode`
and `FIPS_mode_set` functions, which were removed there. Just a note that
the FIPS mode is not supported by OpenSSL 1.1.* although the mentioned
functions are still there (see https://wiki.openssl.org/index.php/FIPS_modules).
Let's make FreeRDP build with OpenSSL 3.0 and fix the FIPS mode support.

See: https://bugzilla.redhat.com/show_bug.cgi?id=1952937
(cherry picked from commit 26bf2816c3)

* winpr: avoid calling FIPS_mode() with OpenSSL 3.0

Fixes: 26bf2816c3
(cherry picked from commit 0c81c73c8d)

* winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0 (#7210)

* winpr/crypto: Exit cleanly when EVP_EncryptInit_ex fails

The `EVP_EncryptInit_ex` function may fail in certain configurations.
Consequently, FreeRDP segfaults in `EVP_CIPHER_CTX_set_key_length`.
Let's handle the `EVP_EncryptInit_ex` failures and exit cleanly in
such case.

* winpr/crypto: Load legacy provider to fix rc4 with OpenSSL 3.0

Currently, the `EVP_EncryptInit_ex` function fails for rc4 with OpenSSL 3.0.
This is becuase rc4 is provided by the legacy provider which is not loaded
by default. Let's explicitly load the legacy provider to make FreeRDP work
with OpenSSL 3.0.

Relates: https://github.com/openssl/openssl/issues/14392
Fixes: https://github.com/FreeRDP/FreeRDP/issues/6604
(cherry picked from commit 67f3fff2c8)

Conflicts:
	winpr/libwinpr/crypto/cipher.c

* Fix TestUnicodeConversion on big endian machines (#7219)

Wide character literals are stored in native byte order.
Use an array of bytes as a reference instead.

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6968
(cherry picked from commit 5208a67ea7)

* Fixed async-input quit

* Fix data write on usb channel

* Bitmap update fix (#7349)

* Added checks for bitmap width and heigth values

Data received from the server might have invalid values for bitmap
with or height. Abort parsing if such a value is found.
Reported by Sunglin from the Knownsec 404 team & 0103 sec team

* Added checks for glyph width & height

* Fixed #7363: Length checks in ConvertUTF8toUTF16

(cherry picked from commit 623a77258a)

* Implemented missing TSG debug functions

(cherry picked from commit c06c463806)

* Refactored RPC gateway parser

Utilize wStream instead of custom binary parsing code, add proper
input validation.
Reported by Sunglin from the Knownsec 404 team & 0103 sec team

(cherry picked from commit f0b44da67c)

* Replaced chmod with safer fchmod

* Use fchmod so the file may not change underneath
* Add unit tests for SetFileAttributesA
* Add warning logs for unsupported flags

(cherry picked from commit c8571dd5fd)

* Updated changelog and version

* Added more explicit warning for deprecated command line

* Add exit codes for more errors

(cherry picked from commit aa4c3dfb8a)

* Updated changelog.

Co-authored-by: Ondrej Holy <oholy@redhat.com>
Co-authored-by: Mike Gilbert <floppym@gentoo.org>
Co-authored-by: Ondrej Holy <ondrejholy@users.noreply.github.com>
Co-authored-by: Ian Weir <mr.weir@me.com>
2021-10-21 08:30:50 +02:00
Armin Novak
301d84c62e Fixed async-input quit 2021-08-24 13:44:53 +02:00
akallabeth
537a877627 Replace fopen and path functions with wrappers (#7043)
Functions like fopen, PathFileExists, PathMakePath need to call
the wide character versions on windows for utf-8 support.

(cherry picked from commit 6b36c6d417)
2021-07-27 11:57:33 +02:00
akallabeth
1c52fc8de7 Fixed #6938: Remote app mode clipboard fix
In remote app mode the _FREERDP_TIMESTAMP_PROPERTY does not work.
Therefore ignore it

(cherry picked from commit f2254f0b09)
2021-05-25 15:30:50 +02:00
akallabeth
7beda29158 Fixed CodeQL warnings
(cherry picked from commit 95a9e60827)
2021-03-12 12:41:44 +01:00
Armin Novak
9e1e318512 Fix /monitor-list 2021-03-12 12:18:34 +01:00
akallabeth
899be1b564 Fix xf_Pointer_SetPosition with smart-sizing
(cherry picked from commit d3e3ab7b5d)
2021-03-08 14:35:28 +01:00
akallabeth
d88480fc48 Fixed a leak on mouse cursor updates 2021-03-01 10:58:24 +01:00
akallabeth
dc179867cc 2.0 compatibility for rdpinput flag debug function 2021-02-25 09:51:41 +01:00
akallabeth
e5f92ba550 Fixed #6712: Use window size from settings
The xfc->window might be NULL (remote app, ...)

(cherry picked from commit 6ecd440658)
2021-02-25 09:51:41 +01:00
Pascal Nowack
0f4ca4c3fb clients: Use the correct wheel rotation value
For the negative scrolling direction, RDP uses the two's complement,
instead of the positive wheel value with the negative flag.
xfreerdp currently uses the positive wheel value in addition to the
negative flag, which results in a wrong wheel value on the server side
(136 instead of 120).

Fix this, by using the correct wheel rotation value, which is in the
two's complement.

(cherry picked from commit 1087a5e1a6)
2021-02-25 09:51:41 +01:00
akallabeth
97327cbf33 Fixed #6801: Delay sending of resolution change
Changed the logic of the disp channel to wait for 800ms after a
ConfigureNotify before sending the new resolution.
The problem fixed with this patch is the following:
1.  Resize the window with the mouse
2.  ConfigureNotify triggers a resize notification
3.  The server resizes to the desired resolution
3a. More ConfigureNotify events are generated
4.  The local window resize to the new resolution triggers another
    ConfigureNotify

a. Depending on the timing (sending is already rate limited) the
   events from 3a and 4 will make the size of the window jump
b. Very fast resizing will pick a random resolution from the
   sequence of ConfigureNotify events as the final resolution

(cherry picked from commit d3ed42a799)
2021-02-25 09:51:41 +01:00
Armin Novak
1c590a71e7 Added option to remap scancodes
(cherry picked from commit d7bf6553c5)
2021-02-25 09:51:41 +01:00
akallabeth
d4dee27b61 Filter out duplicate ClientFormatList announcements
(cherry picked from commit a51f4ccaaa)
2021-02-25 09:51:41 +01:00
Simon Tatham
aa9b644e3a Command-line option to choose an X selection.
I personally find it more convenient to have pasted data written to
the X11 PRIMARY selection, so that I can paste it with a fast middle-
button click, than to write to CLIPBOARD which typically needs a key
sequence or menu action.

This commit adds a command-line option to let me express that
preference: now I can say "/clipboard:use-selection:PRIMARY" on the
command line, which not only enables clipboard transfer but also says
which X selection I want it to talk to. The previous options
"+clipboard" and "-clipboard" are also still supported.

(cherry picked from commit 64948b96c4)
2021-02-25 09:51:41 +01:00
Simon Tatham
818480be91 winpr/utils: allow COMMAND_LINE_VALUE_{OPTIONAL,BOOL} to coexist.
Now you can give an option the combination of flags
COMMAND_LINE_VALUE_OPTIONAL and COMMAND_LINE_VALUE_BOOL. If you do,
then all three of the syntaxes +foo, -foo and /foo:value are allowed
at once, and the receiving code can tell the difference because the
Value field is set to BoolValueTrue, BoolValueFalse or a valid char
pointer.

(cherry picked from commit 22c6b375d4)
2021-02-25 09:51:41 +01:00
Simon Tatham
04fd010402 xf_cliprdr: fill in support for TIMESTAMP requests.
A selection owner is supposed to respond to a request for the
selection target TIMESTAMP by providing the X server time at which the
selection was written. There was a /* TODO */ comment in xf_cliprdr
where the code to do that should have been.

The absence of this can cause a problem when pasting into some X
clients. xtightvncviewer, in particular, will give up the attempt to
read from the clipboard at all if it doesn't get a satisfactory
response to the initial TIMESTAMP request - and the non-answer zero
value "CurrentTime" counts as unsatisfactory. It won't be happy with
anything short of a real X server time value.

(Checking the VNC source code, that's because it reads both PRIMARY
and CLIPBOARD and picks the one with the later timestamp. So it does
depend on the timestamps existing.)

When you're writing to the selection in response to a normal X event
like a mouse click or keyboard action, you get the selection timestamp
by copying the time field out of that X event. Here, we're doing it on
our own initiative, so we have to _request_ the X server time. There
isn't a GetServerTime request in the X protocol, so I work around it
by setting a property on our own window, and waiting for a
PropertyNotify event to come back telling me it's been done - which
will have a timestamp we can use.

(cherry picked from commit fcabbc9707)
2021-02-25 09:51:41 +01:00
akallabeth
43516beb70 Fixed support for huge files in clipboard
(cherry picked from commit f3dad4106a)
2021-02-25 09:51:41 +01:00
akallabeth
2d84387fcd Conservative keyboard state sync, refactored input API
(cherry picked from commit b679f3a0eb)
2021-02-25 09:51:41 +01:00
akallabeth
1b06f38041 Fixed display channel anounce race
* The display resolution change message was prone to a race condition
* Check for actual fullscreen state instead of settings
* Assume 75dpi for display resolution to mm conversion

(cherry picked from commit 13c8a60b70)
2021-02-25 09:51:41 +01:00
Armin Novak
7612054de4 Properly discard xfc->appWindow on focus loss
(cherry picked from commit 34e5504bcc)
2021-02-25 09:51:41 +01:00
akallabeth
21ba0d2b54 Fixed #6635: Use correct window handle for pointer operations
(cherry picked from commit e8fe552ed4)
2021-02-25 09:51:41 +01:00
Nathan Loewen
5b2f35747b X11: Scale cursor when SmartSizing is on
(cherry picked from commit f4f795f323)
2021-02-25 09:51:41 +01:00
Armin Novak
cbf2a59dd9 Fixed unit tests run under memory sanitizer
(cherry picked from commit 816e792e3f)
2021-02-25 09:51:41 +01:00
akallabeth
b55664d7c1 Fixed sending of clipboard format request response
If a request was pending and new formats were announced the response
to a ServerFormatDataRequest was never sent.

(cherry picked from commit 2efb7d9274)
2021-02-25 09:51:41 +01:00
akallabeth
2dbd33b5bb Refactored freerdp_client_settings_command_line_status_print_ex
Now returns 0 if help or version information was requested.

(cherry picked from commit 531dd81836)
2021-02-25 09:51:41 +01:00
Ondrej Holy
cf3ba75673 client: Fix exit codes for /help and similar option
Currently, non-zero exit code is returned for /version, /buildconfig, /help,
/monitor-list, /kbd-list and /kbd-lang-list command-line options for several
clients. This is against conventions because 0 is usually returned in
such cases. Also, there is potentially another problem that the returned
codes overflow on UNIX systems (where the exit code is a number between 0
and 255). Let's fix the clients to return 0 in the mentioned cases to honor
conventions and 1 for the command-line parsing errors (or -1 for clients
who already use that value).

Fixes: https://github.com/FreeRDP/FreeRDP/issues/6686
(cherry picked from commit 3ee4cabcfa)
2021-02-25 09:51:41 +01:00
kubistika
9d8d5e5969 x11: use correct contact flag names in xf_input_touch_state_string
(cherry picked from commit a94fe816a4)
2021-02-25 09:51:41 +01:00
akallabeth
aca1866fc9 Added support for xwayland keyboard grab
(cherry picked from commit 896b7bc711)
2020-12-02 09:00:52 +01:00
akallabeth
ac0f0c6500 Added clipboard CB_HUGE_FILE_SUPPORT_ENABLED flag
(cherry picked from commit f282c55c7a)
2020-12-01 15:10:23 +01:00
Armin Novak
507fecf50e Fixed warnings.
(cherry picked from commit e50a8e09ee)
2020-12-01 15:10:23 +01:00
Martin Fleisz
c424322be3 Implement gateway message callback for Windows, Wayland and X11 clients
(cherry picked from commit 2fe8e762d2)
2020-08-05 10:59:50 +02:00
akallabeth
6565326bcd Use CMake to detect availability of getlogin_r
(cherry picked from commit 3a5bfd2bd0)
2020-07-06 11:13:51 +02:00
akallabeth
3606dfa921 Replaced getlogin with getlogin_r
(cherry picked from commit 36478d3d0b)
2020-06-22 12:12:02 +02:00
makki_d
0121f726d8 fix +unmap-buttons option having the opposite effect
(cherry picked from commit 4607a2766a)
2020-06-16 11:19:41 +02:00
Simon Tatham
dc735d3d36 [generate_argument_docbook] Fix typo in XML entity.
The character '>' was being rendered as &lt; instead of &gt;.

(cherry picked from commit 98930bf275)
2020-06-16 09:07:48 +02:00
Armin Novak
ce6f2a271b Fixed #6221: Update floatbar position with multitouch input
(cherry picked from commit 004910ce5d)
2020-06-16 09:05:31 +02:00
akallabeth
64bec7586d Replaced strtok with strtok_s
(cherry picked from commit 7890833af8)
2020-05-18 16:56:03 +02:00
akallabeth
dd156de828 Fixed NULL access of context struct on screen draw
Added a log message to fix occurances later on.

(cherry picked from commit cfea3fc6ed)
2020-05-18 16:56:03 +02:00
akallabeth
00b5ff301f Fixed clipboard 'called with invalid type' warning 2020-05-05 07:46:10 +02:00
Nathan Loewen
b29bdf5984 Make use of percent scale if available when calculating monitor sizes 2020-04-28 14:03:19 +02:00