Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 882b25b

Browse files
committed
Bug 1964385 - improve handling of .terminal files, r=mak,dimi
Differential Revision: https://phabricator.services.mozilla.com/D250229
1 parent 17e4185 commit 882b25b

6 files changed

Lines changed: 13 additions & 9 deletions

File tree

toolkit/components/reputationservice/ApplicationReputation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ const char* const ApplicationReputationService::kNonBinaryExecutables[] = {
149149
".air",
150150
".atloc",
151151
".ftploc",
152+
".terminal",
152153
// clang-format on
153154
};
154155

toolkit/components/reputationservice/ApplicationReputation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ApplicationReputationService final
2525
NS_DECL_NSIAPPLICATIONREPUTATIONSERVICE
2626

2727
public:
28-
static const char* const kNonBinaryExecutables[5];
28+
static const char* const kNonBinaryExecutables[6];
2929
#ifdef XP_WIN
3030
static const char* const kBinaryFileExtensions[184];
3131
#else

toolkit/components/reputationservice/test/gtest/TestExecutableLists.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ static const char* const kTestFileExtensions[] = {
241241
".tbz", // Linux archive (bzip2)
242242
".tbz2", // Linux archive (bzip2)
243243
".tcsh", // Linux shell
244+
".terminal", // Apple Terminal configuration files
244245
".tgz", // Linux archive (gzip)
245246
".torrent", // Bittorrent
246247
".tpz", // Linux archive (gzip)

xpcom/io/nsLocalFileCommon.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ const char* const sExecutableExts[] = {
118118
".settingcontent-ms",
119119
".shb",
120120
".shs",
121+
".terminal", // macOS terminal files
121122
".url",
122123
".vb",
123124
".vbe",

xpcom/io/nsLocalFileCommon.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#define _NS_LOCAL_FILE_COMMON_H_
99

1010
#ifdef MOZ_ESR
11-
extern const char* const sExecutableExts[109];
12-
#else
1311
extern const char* const sExecutableExts[110];
12+
#else
13+
extern const char* const sExecutableExts[111];
1414
#endif
1515

1616
#endif

xpcom/io/nsLocalFileUnix.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1962,12 +1962,13 @@ nsLocalFile::IsExecutable(bool* aResult) {
19621962
#endif
19631963
"air", // Adobe AIR installer
19641964
#ifdef MOZ_WIDGET_COCOA
1965-
"atloc", // Can point to other files.
1966-
"fileloc", // File location files can be used to point to other
1967-
// files.
1968-
"ftploc", // Can point to other files.
1969-
"inetloc", // Shouldn't be able to do the same, but can, due to
1970-
// macOS vulnerabilities.
1965+
"atloc", // Can point to other files.
1966+
"fileloc", // File location files can be used to point to other
1967+
// files.
1968+
"ftploc", // Can point to other files.
1969+
"inetloc", // Shouldn't be able to do the same, but can, due to
1970+
// macOS vulnerabilities.
1971+
"terminal", // macOS Terminal app configuration files
19711972
#endif
19721973
"jar" // java application bundle
19731974
};

0 commit comments

Comments
 (0)