333 Commits

Author SHA1 Message Date
Armin Novak
ad7cedc64d [channel,rdpdr] use wLog* for client logging 2023-06-05 10:05:22 +02:00
akallabeth
c617d27115 [channels,rdpdr] enforce client state checks
Keep track of client channel state and abort on invalid messages for a
certain state
2023-06-05 10:05:22 +02:00
akallabeth
a4c86723a3 Unifiy string append functions
(cherry picked from commit f25261e27129e23737f1d9b18cf7325697f492c5)
2022-06-29 14:42:22 +02:00
Armin Novak
c6bd48f926 Use GetComputerName instead of gethostname
(cherry picked from commit 82165d95a925a775f2f895518dba8ff6f1a732d1)
2022-04-06 10:22:06 +02:00
Martin Fleisz
aa3631db0a channel/rdpdr: Fix hotplug for drive redirection on Windows
The path was incorrectly cut of after the drive letter causing hot
plugged drives to show up empty and disconnecting the client if the
device was removed later on.

(cherry picked from commit 763f239bf09811af7febb75bd3c8881099e42e3a)
2022-01-27 15:01:48 +01:00
james
d98e59237a Fix hotplug
(cherry picked from commit d5bd834e674fb737c095862e8365284154739ee3)
2022-01-25 15:34:15 +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 8a155db877d944579e2182a33cbe13b94399573c)
2022-01-25 15:34:15 +01:00
Armin Novak
c37593d9fc Filter RDPDR types other than drives on windows hotplug
(cherry picked from commit 6f599eabbedace4adc215186783deec680057003)
2021-03-09 16:08:08 +01:00
Armin Novak
f80ca4580a Fixed drive hotplug path comparison.
(cherry picked from commit c7bf33aad04822eb6400459114d405031edb376a)
2021-02-25 09:51:41 +01:00
akallabeth
2ce5f6f17c Check drive to hotplug for already being redirected
some hotplug implementations report the same drive multiple times.
to avoid redirecting the same drive multiple times check if it is
already in the list before adding.

(cherry picked from commit 9e8d3fbbf5ad7bb75799a8aca9fafa9c2dcf7fd9)
2021-02-25 09:51:41 +01:00
Gluzskiy Alexandr
647d8e9111 clang-format
(cherry picked from commit 481f3b32f6f0fd7fdc304e192f5661e2fa2e4aa9)
2020-07-31 12:47:36 +02:00
Gluzskiy Alexandr
d646302514 fixed build on freebsd
(cherry picked from commit 3bb5d57b70896dd677c8971c4c15dfade529ccd6)
2020-07-31 12:47:36 +02:00
Marco van Wieringen
1250be014b Add support for getmntent support on Illumos
This implements reading mount entries on Solarish operating systems like
OpenIndiana etc using the somewhat different getmntent support available
there.

(cherry picked from commit 56260c0cdb24fb7e10e97a70160737c0652090fd)
2020-07-31 12:47:19 +02:00
akallabeth
6565326bcd Use CMake to detect availability of getlogin_r
(cherry picked from commit 3a5bfd2bd0eee134dbac4a98dcb3ed5227a8c6dc)
2020-07-06 11:13:51 +02:00
akallabeth
813204554d Fixed fallback to getlogin for android
(cherry picked from commit caff01877d4df5f25a983b3aa5e57dde6a16a62f)
2020-06-22 12:13:56 +02:00
akallabeth
eb1cf9a2ac Fixed broken const variable.
(cherry picked from commit 1c6a6923f87dcfb295c508963f21bebbbc4292ae)
2020-06-22 12:13:31 +02:00
akallabeth
3606dfa921 Replaced getlogin with getlogin_r
(cherry picked from commit 36478d3d0b3d7fa378a875f60170a08e94747226)
2020-06-22 12:12:02 +02:00
qarmin
9fd86bee46 Don't allow to overflow dev_array array 2020-05-05 07:46:10 +02:00
Armin Novak
451c4ddee6 Passing on error code from irp_free 2020-02-21 11:31:21 +01:00
Armin Novak
30db616cec Added a free function to erase streams not processed.
When shutting down the streams still in the queue were not properly
freed.
2020-02-21 11:31:15 +01:00
Armin Novak
436b68e416 Fixed #5895: cast warnings. 2020-02-19 10:21:43 +01: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
ac553e1bb5 Fix #5805: windows hotplug drive detection. 2020-01-07 10:35:12 +01:00
ajlex140
2f2f4f91d8 reply with empty irp package with error code, if irp device is unavailable 2019-12-09 11:43:02 +01:00
Armin Novak
9f3adf10f8 Fixed #5727: use getmntent to read /proc/mounts 2019-11-18 15:25:18 +01:00
Armin Novak
72ca88f49c Reformatted to new style 2019-11-07 10:53:54 +01:00
Armin Novak
75ed12f1f0 Fixed userdata pointer and CHANNEL_EVENT_WRITE_CANCELLED message. 2019-11-06 13:01:43 +01:00
Armin Novak
1bcb799560 Listen to CHANNEL_EVENT_WRITE_CANCELLED and emit if queue is cleared. 2019-11-06 13:01:43 +01:00
Armin Novak
1b78b59926 Fixed #4809: Properly process CHANNEL_EVENT_WRITE_COMPLETE 2019-11-06 13:01:43 +01:00
Armin Novak
09d14a2462 Fixed VirtualChannelWriteEx error case leaks. 2019-11-06 13:01:43 +01:00
Armin Novak
64f64cd035 devman_load_device_service device argument can be const. 2019-10-24 15:04:48 +02:00
Armin Novak
5e9f454256 Use stat instead of lstat to iterate /Volumes
Some entries are symbolic links, so follow them and check the link
target for being a directory.
2019-09-12 14:35:01 +02:00
Armin Novak
6f82ab6204 Hotplugging only for drive redirection. 2019-09-12 11:14:39 +02:00
Armin Novak
15bc118d78 Names of services are now const. 2019-09-04 15:48:34 +02:00
Armin Novak
935ed36e68 Add dynamicDrives hotplug option. 2019-08-23 10:27:01 +02:00
Armin Novak
3eb3ad3cab Fixed sign-compare warnings 2019-04-05 09:13:24 +02:00
Armin Novak
9566ae0e90 Fixed mac compilation warnings. 2019-02-21 17:30:12 +01:00
Martin Fleisz
22e666d2d0
Merge pull request #5225 from akallabeth/rdprd_caps_read_fix
Fixed size checks when reading rdpdr capabilities.
2019-02-08 09:05:27 +01:00
Bernhard Miklautz
162a69b0f0
Merge pull request #5139 from akallabeth/drive_hotplug_shutdown_crash_fix
Fixed crash on drive hotplug shutdown.
2019-02-07 10:08:41 +01:00
Armin Novak
51039f6535 Fixed compiler warnings #5210 2019-01-29 16:15:23 +01:00
Armin Novak
8b7da77f36 Fixed size checks when reading rdpdr capabilities. 2019-01-29 11:50:27 +01:00
Armin Novak
192680a001 Added callback to handle printer custom components in printer backend. 2018-12-12 10:57:53 +01:00
Armin Novak
598ece4ae7 Fixed crash on drive hotplug shutdown. 2018-12-12 09:32:09 +01:00
Jonathan Lafontaine
35d7a1e38d Allow fixed drive redirection on Windows (a:, c:, ...) and fix macos drive duplication. 2018-10-29 10:17:42 -04:00
Norbert Federa
0572572eb9 fix issue with fnObjectFree and related casts
- remove unnecessary/dangerous OBJECT_xxx function-style casts
- fix -Wstrict-prototypes issue with OBJECT_NEW_FN definition
2018-10-19 11:30:01 +02:00
Armin Novak
62c1696d4c Removed use of unchecked sprintf 2018-08-27 14:34:42 +02:00
Armin Novak
114abad767 Removed use of strcpy. 2018-08-27 14:34:09 +02:00
Ondrej Holy
1001807c5f channels/rdpdr: Prevent buffer overflow found by covscan
buffer_size_warning: Calling strncpy with a maximum size argument of 256 bytes on destination array "irp->PathName" of size 256 bytes might leave the destination string unterminated.
buffer_size_warning: Calling strncpy with a maximum size argument of 256 bytes on destination array "irp->ExtraBuffer" of size 256 bytes might leave the destination string unterminated.
2018-08-22 13:35:43 +02:00
Ondrej Holy
472576e6e0 channels/rdpdr: Format code by astyle
Run ./scripts/format_code.sh before the following changes.
2018-08-22 13:35:43 +02:00
Ondrej Holy
10bddb9fd9 channels/rdpdr: Fix leak found by covscan
leaked_storage: Variable "newbuf" going out of scope leaks the storage it points to.
leaked_storage: Variable "keys" going out of scope leaks the storage it points to.
leaked_storage: Variable "pKeys" going out of scope leaks the storage it points to.
leaked_storage: Variable "s" going out of scope leaks the storage it points to.
leaked_storage: Variable "computerNameW" going out of scope leaks the storage it points to.
leaked_storage: Variable "s" going out of scope leaks the storage it points to.
2018-08-22 13:35:43 +02:00