Skip to content

Commit cf178d4

Browse files
committed
[release] Add static UnRAR and Unicode copy safeguards
Squash merge local work branch onto origin/main for v1.0.19. Highlights: - Route disk-panel copy, move, drop, and copy-of operations through the wide snapshot builder with filters, ADS handling, rename masks, and long-path coverage. - Preserve legacy copy safeguards for same-path targets and encrypted source/target destinations. - Statically link the vendored UnRAR engine into salunrar.dll and remove the external unrar.dll dependency. - Expand plugin build coverage, including FTP CMake support and release distribution population.
1 parent 2a5ded3 commit cf178d4

238 files changed

Lines changed: 37436 additions & 755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmake/sal_plugin.cmake

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,23 @@ if(NOT DEFINED SAL_ROOT)
88
include("${CMAKE_CURRENT_LIST_DIR}/sal_common.cmake")
99
endif()
1010

11-
# sal_add_plugin_lang(NAME <plugin_name>)
11+
# sal_add_plugin_lang(NAME <plugin_name>
12+
# [SOURCE_DIR <plugin_root>]
13+
# )
1214
# Adds the English language file (.slg) for a plugin
1315
# Looks for lang/lang.rc in the plugin directory
1416
function(sal_add_plugin_lang)
15-
cmake_parse_arguments(PARSE_ARGV 0 LANG "" "NAME" "")
17+
cmake_parse_arguments(PARSE_ARGV 0 LANG "" "NAME;SOURCE_DIR" "")
1618

1719
if(NOT LANG_NAME)
1820
message(FATAL_ERROR "sal_add_plugin_lang: NAME is required")
1921
endif()
2022

21-
set(PLUGIN_DIR "${SAL_PLUGINS}/${LANG_NAME}")
23+
if(LANG_SOURCE_DIR)
24+
get_filename_component(PLUGIN_DIR "${LANG_SOURCE_DIR}" ABSOLUTE)
25+
else()
26+
set(PLUGIN_DIR "${SAL_PLUGINS}/${LANG_NAME}")
27+
endif()
2228
set(LANG_RC "${PLUGIN_DIR}/lang/lang.rc")
2329

2430
if(NOT EXISTS "${LANG_RC}")
@@ -64,6 +70,7 @@ endfunction()
6470

6571
# sal_add_plugin(NAME <plugin_name>
6672
# SOURCES <source_files>...
73+
# [SOURCE_DIR <plugin_root>]
6774
# [INCLUDES <include_dirs>...]
6875
# [DEFINES <preprocessor_defines>...]
6976
# [LIBS <libraries>...]
@@ -77,7 +84,7 @@ endfunction()
7784
function(sal_add_plugin)
7885
cmake_parse_arguments(PARSE_ARGV 0 PLUGIN
7986
"NO_SHARED;NO_PCH;NO_LANG"
80-
"NAME;RC;DEF;PCH"
87+
"NAME;SOURCE_DIR;RC;DEF;PCH"
8188
"SOURCES;INCLUDES;DEFINES;LIBS"
8289
)
8390

@@ -86,7 +93,11 @@ function(sal_add_plugin)
8693
endif()
8794

8895
set(TARGET_NAME "plugin_${PLUGIN_NAME}")
89-
set(PLUGIN_DIR "${SAL_PLUGINS}/${PLUGIN_NAME}")
96+
if(PLUGIN_SOURCE_DIR)
97+
get_filename_component(PLUGIN_DIR "${PLUGIN_SOURCE_DIR}" ABSOLUTE)
98+
else()
99+
set(PLUGIN_DIR "${SAL_PLUGINS}/${PLUGIN_NAME}")
100+
endif()
90101

91102
# Default PCH header
92103
if(NOT PLUGIN_PCH)
@@ -188,7 +199,7 @@ function(sal_add_plugin)
188199

189200
# Build language file if it exists (unless NO_LANG is specified)
190201
if(NOT PLUGIN_NO_LANG)
191-
sal_add_plugin_lang(NAME ${PLUGIN_NAME})
202+
sal_add_plugin_lang(NAME ${PLUGIN_NAME} SOURCE_DIR "${PLUGIN_DIR}")
192203
endif()
193204

194205
message(STATUS "Added plugin: ${PLUGIN_NAME}")

cmake/targets/sally_sources.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ set(SALLY_SOURCES
1515
"${SAL_SRC}/color.cpp"
1616
"${SAL_SRC}/common/allochan.cpp"
1717
"${SAL_SRC}/common/array.cpp"
18+
"${SAL_SRC}/common/BuildScript.cpp"
1819
"${SAL_SRC}/common/handles.cpp"
1920
"${SAL_SRC}/common/heap.cpp"
2021
"${SAL_SRC}/common/messages.cpp"

doc/DEV.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ A few Altap Salamander 4.0 plugins are either not included or cannot be compiled
3333

3434
- **PictView**: The engine `pvw32cnv.dll` is not open-sourced. Consider switching to [WIC](https://learn.microsoft.com/en-us/windows/win32/wic/-wic-about-windows-imaging-codec) or another library.
3535
- **Encrypt**: Incompatible with modern SSD disks and has been deprecated.
36-
- **UnRAR**: Missing [unrar.dll](https://www.rarlab.com/rar_add.htm) (solvable, open source).
36+
- **UnRAR**: RAR handling is statically linked into `salunrar.dll` from vendored [RARLAB UnRAR source](https://www.rarlab.com/rar_add.htm), which is source-available/freeware for handling RAR archives and is not GPL/OSI-free.
3737
- **FTP**: Missing [OpenSSL](https://www.openssl.org/) libraries (solvable, open source).
3838
- **WinSCP**: Requires Embarcadero C++ Builder to build.
3939

doc/third_party.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ Copyright (C) Microsoft Corporation 1993-1997
3434

3535
=== Alexander Roshal ===
3636
Portions of UnRAR plugin utilizes decompression library written by Alexander Roshal.
37-
Copyright (C) 1993-2019 Alexander Roshal
37+
Copyright (C) 1993-2024 Alexander Roshal
38+
The vendored UnRAR source is statically linked into salunrar.dll and is
39+
distributed under the upstream UnRAR freeware/source-available terms in
40+
src/plugins/unrar/unrarsrc/license.txt.
41+
It may be used to handle RAR archives, but may not be used to develop a
42+
RAR/WinRAR-compatible archiver or recreate the proprietary RAR compression
43+
algorithm.
3844

3945
=== Martin Prikryl ===
4046
Portions of WinSCP plugin licensed from Martin Prikryl.

0 commit comments

Comments
 (0)