From 2808be9288546424bc5e88a39631a6835e6bd388 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 25 Mar 2024 01:00:59 +0000 Subject: gentoo auto-resync : 25:03:2024 - 01:00:59 --- net-misc/Manifest.gz | Bin 54963 -> 54963 bytes net-misc/freerdp/Manifest | 3 +- .../files/freerdp-3.4.0-incompatible-pointer.patch | 279 +++++++++++++++++++++ net-misc/freerdp/freerdp-3.4.0-r11.ebuild | 7 + 4 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 net-misc/freerdp/files/freerdp-3.4.0-incompatible-pointer.patch (limited to 'net-misc') diff --git a/net-misc/Manifest.gz b/net-misc/Manifest.gz index 9a787ee681f7..80a713d9f32a 100644 Binary files a/net-misc/Manifest.gz and b/net-misc/Manifest.gz differ diff --git a/net-misc/freerdp/Manifest b/net-misc/freerdp/Manifest index 3680165bdd6a..e56994b18c1d 100644 --- a/net-misc/freerdp/Manifest +++ b/net-misc/freerdp/Manifest @@ -1,10 +1,11 @@ AUX freerdp-2.11-Revert-codec-encode-messages-considering-endianness.patch 10363 BLAKE2B 03dd4e9795feaf6d4ac8a9f0412b5e9baf3b33e732ff13964c7acdb1bfeb884b524f4483e99de808d4130e70f3310366427f3f1b011735ff22442afd92c6888e SHA512 c66b4d2d18d2189f8df9d68ad556ecae2c5fde8d632c5207960bd1adc33d23c3a4a0ac055657388861b96ce8e391d414b4b98c160f89dad890e911535bdde3d6 AUX freerdp-2.11.2-clang.patch 1132 BLAKE2B ba35de705f66e571e177f1291ccaf3c72f23f4dafe90c6b145b2bfe13d1cc6ec3c0729b6b6d3394da3a090fb73903b775b9d51711416ba0a56786e141d7a2bad SHA512 f45a38b36b5caee74be8b590b80e56adb91b42f41ad8149a97ef2ed0f5c10a32e4024149d75e4eb0b0242f086e71d9367ffd4c9dd307f113f1d25f1cc2c0793e +AUX freerdp-3.4.0-incompatible-pointer.patch 10251 BLAKE2B 70a23022ff8db7dcf0ada3bf2165d6b271f259f4a49b40d4ca2c2de75e5321156cbedcca77240663e143986073d5a49e74b2b6caf456a6136d83673becf6c35e SHA512 c44165fc843742d1cb5859f24c6eaa78cda13837315ca3fde48092835992998701a670a66cf351c406153a65166050b5523e432789b5b6e2151227ea43ef034d DIST freerdp-2.11.5.tar.gz 7330372 BLAKE2B 53adf40ca8f6c226f93cbc4599d857170bed2cbbe233860f52b30416b3a5d15c1ef2268c329790553dd1dbbcd93dedd834e5b62f67128029e551083d1053b357 SHA512 152dfef2783283ef703eb28ebe4d32fb02519ee6de9042b124af34395a2a6db36bd4cf1e96200ba3e93acf06c245109413e3e36e6143ed4409bd90ede6c383bd DIST freerdp-3.4.0.tar.gz 9331562 BLAKE2B 888d6c5786c7b3c5eea89e41bca23ef2b323377b8115c5f5bfd0dd38e5ed2d3701ffc7603e4aa4253e9116804a12268f4b59dadeb2f60f5c39e8170e78ba6bd1 SHA512 b69f2a2a5f6c70b4a21f0768ce2050020af47b83a3cf06d3b3b46a0e6aa7c062ed2b9de04782a8d6651002ded4c267f8653dfdc2517323926aaab3675924b6c5 EBUILD freerdp-2.11.5-r10.ebuild 3669 BLAKE2B 77e04414dba8a816cc751244e16a8266274fbc3f4ba2d79a12bac8c3aaa94b72c507b7090aaa1f92bed2596213d6ef799e19c60d08399b93250ef69755f748a3 SHA512 f940b8f6b59eadcf68d6fa146832feb30e1a7a24e58d03218231917a577cb86ae4694c349ac6e0e6f397c399df75bcceb130684bda08f089ad6e21e9dac75e39 EBUILD freerdp-2.11.5-r2.ebuild 3470 BLAKE2B 738dfd8ac8d02cf814ee17ca07a593b0c4394862aa8c5ac5a4a59f5aaf4f58f8d28c4069a7d2726a8a5a2bceace3497c18a6f93f894e02f8af997fa257799194 SHA512 cf303673f413fe5d404d98ba0dc8d08fbe1a67175f20b00fd5f857a0674baaa62c439e1a88158aa204e0498fab5a7a326521b630d73c8b72de74a6417a434812 EBUILD freerdp-2.9999.ebuild 3535 BLAKE2B beec173d3aab0eaa21c85235b2c859853796dab2e285ca91f961514044bd0bb23f444118953ae114c451113de8bfb4d316d576890d7c49b543b64d8166ea0868 SHA512 7e6baae43145d324583f77275449626f40c2f63a1f12d862edc260bbf4dcfa644d384ece41cb6e6cd9399a3d79b12445207a92f2f95b0db7a117549a8b316edd -EBUILD freerdp-3.4.0-r11.ebuild 4096 BLAKE2B 17233f00d185e600c88a24a9dd606cb35747cf314f1e690166620da318c82a66cc44811f8ea2d168441f738e3de3faed3e4820df282119a42294004829b0b588 SHA512 870744c2e32703ca45a026717a3f41c0c7ae57812599e61a9510a8925ce70540f5aeeb17fea97c2dcffe35e31ea2adb32ddd9cdf8504034d18bb237efb7bb66f +EBUILD freerdp-3.4.0-r11.ebuild 4211 BLAKE2B 58763b19489467889d80389e25e8d24d120f5c2296312896471536e70ca84dc63907c917da982a90c5f386c4aecdc269bb6b3174261f77832aa414c46e1d257f SHA512 49912560af0a3e9bef825b8638125218f51cb5b05fd7bcc48d3d9c5a00fc30cae0798e96aafbccef62bfedaf9a4e7570feafcb2201ecd719a14263fc789b6e9f EBUILD freerdp-9999.ebuild 4096 BLAKE2B 17233f00d185e600c88a24a9dd606cb35747cf314f1e690166620da318c82a66cc44811f8ea2d168441f738e3de3faed3e4820df282119a42294004829b0b588 SHA512 870744c2e32703ca45a026717a3f41c0c7ae57812599e61a9510a8925ce70540f5aeeb17fea97c2dcffe35e31ea2adb32ddd9cdf8504034d18bb237efb7bb66f MISC metadata.xml 650 BLAKE2B 619e236cb4c4b249beafc2e4772c5321e5c912242a0e69d7e181867a83078ebfadd639aa5b7cf2a0da58572ade2ae374bfd61f41d83e333065bbfde2c06533ed SHA512 f9ec3e33c342c2a364be4d780c0fc69800617896bda40e473175f0b98f39925ea7bcc1896993782470fd9aad1b04edc2848baf5db2a8dd4e2c4099c062e657ae diff --git a/net-misc/freerdp/files/freerdp-3.4.0-incompatible-pointer.patch b/net-misc/freerdp/files/freerdp-3.4.0-incompatible-pointer.patch new file mode 100644 index 000000000000..549c813f774b --- /dev/null +++ b/net-misc/freerdp/files/freerdp-3.4.0-incompatible-pointer.patch @@ -0,0 +1,279 @@ +https://github.com/FreeRDP/FreeRDP/pull/9992 +https://bugs.gentoo.org/921252 + +From 0242240ba7a61945607b835f378ff077e4582780 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:05:30 +0100 +Subject: [PATCH 1/8] [winpr,clipboard] fix incompatible WCHAR pointer + +--- + winpr/libwinpr/clipboard/synthetic_file.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/winpr/libwinpr/clipboard/synthetic_file.c b/winpr/libwinpr/clipboard/synthetic_file.c +index 14219806c76e..e748f8bea399 100644 +--- a/winpr/libwinpr/clipboard/synthetic_file.c ++++ b/winpr/libwinpr/clipboard/synthetic_file.c +@@ -276,7 +276,13 @@ static BOOL add_directory_contents_to_list(wClipboard* clipboard, const WCHAR* l + const WCHAR* remote_name, wArrayList* files) + { + BOOL result = FALSE; +- const WCHAR* wildcard = "/\0*\0\0\0"; ++ union ++ { ++ const char* c; ++ const WCHAR* w; ++ } wildcard; ++ const char buffer[4] = "/\0*\0\0\0"; ++ wildcard.c = buffer; + const size_t wildcardLen = 3; + + WINPR_ASSERT(clipboard); +@@ -290,7 +296,7 @@ static BOOL add_directory_contents_to_list(wClipboard* clipboard, const WCHAR* l + return FALSE; + + _wcsncat(namebuf, local_name, len); +- _wcsncat(namebuf, wildcard, wildcardLen); ++ _wcsncat(namebuf, wildcard.w, wildcardLen); + + result = do_add_directory_contents_to_list(clipboard, local_name, remote_name, namebuf, files); + + +From b1f60a1d117da2a6775dc12ab7e9b62c95615550 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:07:17 +0100 +Subject: [PATCH 2/8] [winpr,smartcard] fix incompatible PCSC_SCardListReaders + pointer + +--- + winpr/libwinpr/smartcard/smartcard_pcsc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/winpr/libwinpr/smartcard/smartcard_pcsc.c b/winpr/libwinpr/smartcard/smartcard_pcsc.c +index fb04d5684aa0..c94b4caafe1e 100644 +--- a/winpr/libwinpr/smartcard/smartcard_pcsc.c ++++ b/winpr/libwinpr/smartcard/smartcard_pcsc.c +@@ -992,8 +992,14 @@ static LONG WINAPI PCSC_SCardListReadersW(SCARDCONTEXT hContext, LPCWSTR mszGrou + return SCARD_E_NO_MEMORY; + } + +- status = +- PCSC_SCardListReaders_Internal(hContext, mszGroupsA, (LPSTR*)&mszReadersA, pcchReaders); ++ union ++ { ++ LPSTR* ppc; ++ LPSTR pc; ++ } cnv; ++ cnv.ppc = &mszReadersA; ++ ++ status = PCSC_SCardListReaders_Internal(hContext, mszGroupsA, cnv.pc, pcchReaders); + if (status == SCARD_S_SUCCESS) + { + size_t size = 0; + +From 48eaca08048918260d4dca05e9522118657e8210 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:10:39 +0100 +Subject: [PATCH 3/8] [core,license] fix incompatible WCHAR pointer + +--- + libfreerdp/core/license.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/libfreerdp/core/license.c b/libfreerdp/core/license.c +index 99d4fa25fc84..e6c622a6b087 100644 +--- a/libfreerdp/core/license.c ++++ b/libfreerdp/core/license.c +@@ -2802,18 +2802,25 @@ BOOL license_server_send_request(rdpLicense* license) + return license_set_state(license, LICENSE_STATE_REQUEST); + } + +-static BOOL license_set_string(const char* what, const char* value, WCHAR** dst, UINT32* dstLen) ++static BOOL license_set_string(const char* what, const char* value, BYTE** bdst, UINT32* dstLen) + { + WINPR_ASSERT(what); + WINPR_ASSERT(value); +- WINPR_ASSERT(dst); ++ WINPR_ASSERT(bdst); + WINPR_ASSERT(dstLen); + ++ union ++ { ++ WCHAR** w; ++ BYTE** b; ++ } cnv; ++ cnv.b = bdst; ++ + size_t len = 0; +- *dst = (BYTE*)ConvertUtf8ToWCharAlloc(value, &len); +- if (!*dst || (len > UINT32_MAX / sizeof(WCHAR))) ++ *cnv.w = ConvertUtf8ToWCharAlloc(value, &len); ++ if (!*cnv.w || (len > UINT32_MAX / sizeof(WCHAR))) + { +- WLog_ERR(TAG, "license->ProductInfo: %s == %p || %" PRIu32 " > UINT32_MAX", what, *dst, ++ WLog_ERR(TAG, "license->ProductInfo: %s == %p || %" PRIu32 " > UINT32_MAX", what, *cnv.w, + len); + return FALSE; + } + +From 0717b4de1549390a3404af823bd36db66772abd2 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:10:59 +0100 +Subject: [PATCH 4/8] [winpr,crt] fix incompatible WCHAR pointer + +--- + winpr/libwinpr/crt/test/TestUnicodeConversion.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/winpr/libwinpr/crt/test/TestUnicodeConversion.c b/winpr/libwinpr/crt/test/TestUnicodeConversion.c +index a5c4c75e8f71..187a068aedaa 100644 +--- a/winpr/libwinpr/crt/test/TestUnicodeConversion.c ++++ b/winpr/libwinpr/crt/test/TestUnicodeConversion.c +@@ -24,10 +24,12 @@ typedef struct + // TODO: The unit tests do not check for valid code points, so always end the test + // strings with a simple ASCII symbol for now. + static const testcase_t unit_testcases[] = { +- { "foo", 3, "f\x00o\x00o\x00\x00\x00", 3 }, +- { "foo", 4, "f\x00o\x00o\x00\x00\x00", 4 }, ++ { "foo", 3, (const WCHAR*)"f\x00o\x00o\x00\x00\x00", 3 }, ++ { "foo", 4, (const WCHAR*)"f\x00o\x00o\x00\x00\x00", 4 }, + { "βœŠπŸŽ…Δ™Κ₯κ£Έπ‘—Ša", 19, +- "\x0a\x27\x3c\xd8\x85\xdf\x19\x01\xa5\x02\xf8\xa8\x05\xd8\xca\xdd\x61\x00\x00\x00", 9 } ++ (const WCHAR*)"\x0a\x27\x3c\xd8\x85\xdf\x19\x01\xa5\x02\xf8\xa8\x05\xd8\xca\xdd\x61\x00\x00" ++ "\x00", ++ 9 } + }; + + static void create_prefix(char* prefix, size_t prefixlen, size_t buffersize, SSIZE_T rc, + +From cab7b59fccabc0f09d659bd499c03dab7e911ffa Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:13:40 +0100 +Subject: [PATCH 5/8] [codec,rfx] explicitly cast return + +cast to avoid compilation issues with incompatible-pointer-types +--- + libfreerdp/codec/rfx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c +index c83cfd5c1ac3..66ed1e04aea2 100644 +--- a/libfreerdp/codec/rfx.c ++++ b/libfreerdp/codec/rfx.c +@@ -1368,7 +1368,7 @@ const RFX_TILE** rfx_message_get_tiles(const RFX_MESSAGE* message, UINT16* numTi + WINPR_ASSERT(message); + if (numTiles) + *numTiles = message->numTiles; +- return message->tiles; ++ return (const RFX_TILE**)message->tiles; + } + + UINT16 rfx_message_get_tile_count(const RFX_MESSAGE* message) + +From 86966912502a3667c111d35dc9ba577a8b209a6d Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:17:29 +0100 +Subject: [PATCH 6/8] [client,common] fix incompatible-pointer-types + +use a union to cast to expected types. +--- + client/common/file.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/client/common/file.c b/client/common/file.c +index feb37967fc5a..39b08f18c916 100644 +--- a/client/common/file.c ++++ b/client/common/file.c +@@ -2299,9 +2299,15 @@ BOOL freerdp_client_populate_settings_from_rdp_file(const rdpFile* file, rdpSett + if (~file->RedirectLocation) + { + size_t count = 0; +- char** str = CommandLineParseCommaSeparatedValuesEx(LOCATION_CHANNEL_NAME, NULL, &count); +- const BOOL rc = freerdp_client_add_dynamic_channel(settings, count, str); +- free(str); ++ union ++ { ++ void* pv; ++ char** str; ++ const char** cstr; ++ } cnv; ++ cnv.str = CommandLineParseCommaSeparatedValuesEx(LOCATION_CHANNEL_NAME, NULL, &count); ++ const BOOL rc = freerdp_client_add_dynamic_channel(settings, count, cnv.cstr); ++ free(cnv.pv); + if (!rc) + return FALSE; + } + +From dfdb8a849ef78a6e5d1530489ad7f899c62c9c22 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:18:09 +0100 +Subject: [PATCH 7/8] [channels,drive] fix wrong function usage + +_wcslen is for WCHAR, wcslen for wchar_t +--- + channels/drive/client/drive_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/channels/drive/client/drive_main.c b/channels/drive/client/drive_main.c +index 0fdc2e08ff50..04f8d837fa6b 100644 +--- a/channels/drive/client/drive_main.c ++++ b/channels/drive/client/drive_main.c +@@ -511,7 +511,7 @@ static UINT drive_process_irp_query_volume_information(DRIVE_DEVICE* drive, IRP* + /* http://msdn.microsoft.com/en-us/library/cc232101.aspx */ + const WCHAR* diskType = + InitializeConstWCharFromUtf8("FAT32", LabelBuffer, ARRAYSIZE(LabelBuffer)); +- const size_t diskTypeLen = (wcslen(diskType) + 1) * sizeof(WCHAR); ++ const size_t diskTypeLen = (_wcslen(diskType) + 1) * sizeof(WCHAR); + const size_t length = 12ul + diskTypeLen; + Stream_Write_UINT32(output, length); /* Length */ + + +From 00ec91dc16724f7aad8866b4f988baad4c1216a8 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 10:25:00 +0100 +Subject: [PATCH 8/8] [server,shadow] cast incompatible pointer + +the context pointer to WTSOpenServerA is intentional, cast to LPSTR to +match definition +--- + server/shadow/shadow_client.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/server/shadow/shadow_client.c b/server/shadow/shadow_client.c +index 0fd52363eb6d..f2a5f63cb188 100644 +--- a/server/shadow/shadow_client.c ++++ b/server/shadow/shadow_client.c +@@ -252,7 +252,7 @@ static BOOL shadow_client_context_new(freerdp_peer* peer, rdpContext* context) + goto fail; + + region16_init(&(client->invalidRegion)); +- client->vcm = WTSOpenServerA(peer->context); ++ client->vcm = WTSOpenServerA((LPSTR)peer->context); + + if (!client->vcm || client->vcm == INVALID_HANDLE_VALUE) + goto fail; +From 00f4c9612a924f1b87a7dcdd2a5728d9e9616ee6 Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Mon, 18 Mar 2024 19:57:02 +0100 +Subject: [PATCH] [winpr,clipboard] fix WCHAR buffer size + +--- + winpr/libwinpr/clipboard/synthetic_file.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/winpr/libwinpr/clipboard/synthetic_file.c b/winpr/libwinpr/clipboard/synthetic_file.c +index e748f8bea399..ce70e1efc26e 100644 +--- a/winpr/libwinpr/clipboard/synthetic_file.c ++++ b/winpr/libwinpr/clipboard/synthetic_file.c +@@ -281,9 +281,9 @@ static BOOL add_directory_contents_to_list(wClipboard* clipboard, const WCHAR* l + const char* c; + const WCHAR* w; + } wildcard; +- const char buffer[4] = "/\0*\0\0\0"; ++ const char buffer[6] = "/\0*\0\0\0"; + wildcard.c = buffer; +- const size_t wildcardLen = 3; ++ const size_t wildcardLen = ARRAYSIZE(buffer) / sizeof(WCHAR); + + WINPR_ASSERT(clipboard); + WINPR_ASSERT(local_name); diff --git a/net-misc/freerdp/freerdp-3.4.0-r11.ebuild b/net-misc/freerdp/freerdp-3.4.0-r11.ebuild index 8285a658a86c..7768efd323b8 100644 --- a/net-misc/freerdp/freerdp-3.4.0-r11.ebuild +++ b/net-misc/freerdp/freerdp-3.4.0-r11.ebuild @@ -106,6 +106,13 @@ RDEPEND="${COMMON_DEPEND} server? ( !net-misc/freerdp:2[server] ) " +src_prepare() { + local PATCHES=( + "${FILESDIR}/freerdp-3.4.0-incompatible-pointer.patch" + ) + cmake_src_prepare +} + option() { usex "$1" ON OFF } -- cgit v1.2.3