Rebase against a87abdbe85779adf6a2a7897bd88984587880693.

This commit is contained in:
Alistair Leslie-Hughes
2021-10-02 12:00:05 +10:00
parent c4535e89f7
commit 4d66e1bf6b
16 changed files with 618 additions and 140 deletions

View File

@@ -1,4 +1,4 @@
From be95736e06aba40bd61378be249c238ff3dcadb9 Mon Sep 17 00:00:00 2001
From 1b6c8682eeabea769020928a1f0fadb6f4a66930 Mon Sep 17 00:00:00 2001
From: Alex Henrie <alexhenrie24@gmail.com>
Date: Sun, 1 Mar 2020 17:58:12 -0700
Subject: [PATCH] winemenubuilder: Blacklist desktop integration for certain
@@ -65,10 +65,10 @@ index 4a650b444fc..548739f4326 100644
;; PS
HKCR,"MIME\Database\Content Type\application/postscript","Extension",,".ps"
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
index 2759854396d..e867df57a22 100644
index 4ff5e874cf8..892e0a04167 100644
--- a/loader/wine.inf.in
+++ b/loader/wine.inf.in
@@ -514,6 +514,16 @@ HKCR,MIME\Database\Charset\us-ascii,"AliasForCharset",,iso-8859-1
@@ -512,6 +512,16 @@ HKCR,MIME\Database\Charset\us-ascii,"AliasForCharset",,iso-8859-1
HKCR,MIME\Database\Charset\visual,"AliasForCharset",,iso-8859-8
HKCR,MIME\Database\Charset\Windows-1254,"AliasForCharset",,iso-8859-9
@@ -86,10 +86,10 @@ index 2759854396d..e867df57a22 100644
HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"WBreakerClass",,"{369647e0-17b0-11ce-9950-00aa004bbb1f}"
HKLM,System\CurrentControlSet\Control\ContentIndex\Language\Neutral,"StemmerClass",,""
diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 6545dabd668..405ce7942dc 100644
index 6d157305135..ed400d2052e 100644
--- a/programs/winemenubuilder/winemenubuilder.c
+++ b/programs/winemenubuilder/winemenubuilder.c
@@ -2479,7 +2479,7 @@ static BOOL write_freedesktop_mime_type_entry(const char *packages_dir, const ch
@@ -2092,7 +2092,7 @@ static BOOL write_freedesktop_mime_type_entry(const WCHAR *packages_dir, const W
return ret;
}
@@ -97,8 +97,8 @@ index 6545dabd668..405ce7942dc 100644
+static BOOL is_extension_banned(const WCHAR *extension)
{
/* These are managed through external tools like wine.desktop, to evade malware created file type associations */
static const WCHAR comW[] = {'.','c','o','m',0};
@@ -2493,6 +2493,42 @@ static BOOL is_extension_banned(LPCWSTR extension)
if (!wcsicmp(extension, L".com") ||
@@ -2102,6 +2102,42 @@ static BOOL is_extension_banned(LPCWSTR extension)
return FALSE;
}
@@ -125,7 +125,7 @@ index 6545dabd668..405ce7942dc 100644
+ while (RegEnumValueW(blacklist_key, i, program_name, &len, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
+ {
+ blacklisted_command = reg_get_valW(HKEY_CURRENT_USER, blacklist_key_path, program_name);
+ if (strcmpW(command, blacklisted_command) == 0)
+ if (wcscmp(command, blacklisted_command) == 0)
+ {
+ RegCloseKey(blacklist_key);
+ return TRUE;
@@ -138,14 +138,14 @@ index 6545dabd668..405ce7942dc 100644
+ return FALSE;
+}
+
static const char* get_special_mime_type(LPCWSTR extension)
static WCHAR *get_special_mime_type(LPCWSTR extension)
{
static const WCHAR lnkW[] = {'.','l','n','k',0};
@@ -2591,6 +2627,15 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package
char *progIdA = NULL;
char *mimeProgId = NULL;
if (!wcsicmp(extension, L".lnk"))
@@ -2189,6 +2225,15 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
WCHAR *mimeProgId = NULL;
struct rb_string_entry *entry;
+ commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, openW);
+ commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, L"open");
+ if (commandW == NULL)
+ /* no command => no application is associated */
+ goto end;
@@ -154,21 +154,21 @@ index 6545dabd668..405ce7942dc 100644
+ /* command is on the blacklist => desktop integration is not desirable */
+ goto end;
+
extensionA = wchars_to_utf8_chars(strlwrW(extensionW));
if (extensionA == NULL)
{
@@ -2659,11 +2704,6 @@ static BOOL generate_associations(const char *xdg_data_home, const char *package
}
wcslwr(extensionW);
friendlyDocNameW = assoc_query(ASSOCSTR_FRIENDLYDOCNAME, extensionW, NULL);
@@ -2229,11 +2274,6 @@ static BOOL generate_associations(const WCHAR *packages_dir, const WCHAR *applic
hasChanged = TRUE;
}
- commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, openW);
- commandW = assoc_query(ASSOCSTR_COMMAND, extensionW, L"open");
- if (commandW == NULL)
- /* no command => no application is associated */
- goto end;
-
executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, openW);
executableW = assoc_query(ASSOCSTR_EXECUTABLE, extensionW, L"open");
if (executableW)
openWithIconA = compute_native_identifier(0, executableW);
openWithIcon = compute_native_identifier(0, executableW, NULL);
--
2.28.0
2.33.0