Replace `VerifyDir` and `CompareFiles` with
`AssertDirectoryTreesAreEquivalent` and `AssertFilesAreEqual`.
Move `WriteFile` to `TestUtils`.
Add "Symlink" category to start.sh.
This adds a basic symlink policy test that performs backups using each
symlink policy.
If you don't have the required privilege in Windows, you can get an
exception trying to create a symbolic link. If an exception is thrown
trying to create a symbolic link, the exception is trapped and the
test is marked as "Ignored"; e.g.,
```
1) Ignored : Duplicati.UnitTest.SymLinkTests.SymLinkPolicy
Client could not create a symbolic link. Error reported: (1314) A required privilege is not held by the client. | Read: [C:\td\backup-data\target] | Write: [C:\td\backup-data\symlink]
```
Fix restore GUI handling of folders with wildcard characters.
This does so by introducing a new syntax for verbatim path specifications.
Similar to C#, expressions that are prefixed by '@' are treated as verbatim
string literals.
Change RestoreController.js to handle the case where the selected
restore paths contain literal wildcard characters. For files, prefix
with `@`. For directories, convert to regular expression filters so
that we can preserve the literal wildcard characters and also support
the equivalent of a globbing `*` suffix.
Change "find" and "restore" commands to not prefix `@` file filters
with `*` and to not suffix `@` folder filters with `*` since wildcards
cannot be used with `@` filters.
Switch back to using `FilterType.Simple` for `@` filters to fix the
restore picker again.
In LocalDatabase.cs, replace code that was explicitly looking for the
presence of wildcard characters to instead trigger off of
`FilterType.Wildcard`. This fixes the "find" command.
Change FilterEntry.ToString() to prefix Simple filters with `@` so
that if simple filters with wildcard characters make the round-trip
through a string, their `FilterType.Simple` type is preserved.
Add new filter syntax, prefixing with an "at sign"; i.e., `@...`, that
disables glob expansion, treating `*` and `?` wildcard characters as
literal characters.
In the GUI, change the restore file picker to prefix paths with `@`
when expanding a node to avoid mistaking literal `*` or `?` characters
for wildcards characters and triggering the following error:
```
Filter for list-folder-contents must be a path prefix with no wildcards Parameter name: filter
```
This fixes#4300.
Tree changes in query
* Move inner selection S to a temporary table
* Reorder join field in outer query
* Remove intersection with File view in outer selection
File view is already intersected with in selection S
With the above-mentioned changes, on a specific testset, query took 9s instead of 6min.
From Codacy:
The overloading mechanism should be used in place of optional parameters for several reasons:
* Optional parameter values are baked into the method call site code,
thus, if a default value has been changed, all referencing assemblies
need to be rebuilt, otherwise the original values will be used.
* The Common Language Specification (CLS) allows compilers to ignore
default parameter values, and thus require the caller to explicitly
specify the values. For example, if you want to consume a method with
default argument from another .NET compatible language (for instance
C++/CLI), you will have to provide all arguments. When using method
overloads, you could achieve similar behavior as default arguments.
* Optional parameters prevent muddying the definition of the function
contract. Here is a simple example: if there are two optional
parameters, when one is defined, is the second one still optional or
mandatory?
In revision c41f2c6a60 ("moved all sanitization logic into backup class
and moved from regex to using internal Uri library"), we cleaned up the
removal of passwords from an exported backup configuration. However,
the use of Uri.QueryParameters resulted in exporting decoded parameter
values, which violated some assumptions made by the decode_uri function
in AppUtils.js. This caused usernames in the JSON to contain '@'
instead of '%40', which led to incorrect decomposition of the target URL
into its components in the UI.
This concerns issue #3619.
After targeting .NET 4.7.1, some users started encountering errors like:
Could not find method '.ctor' due to a type load error: Could not load
file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
assembly:/opt/duplicati/SharpAESCrypt.exe type:SharpAESCrypt
member:(null)
The TencentCOS and Tardigrade backends are built on .NET Standard 2.0,
and it appears that the dependencies can be awoken even if these
backends are not used.
This fixes#4289.