forked from restic/restic
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Alternate Data Streams in Windows #15
Open
aneesh-n
wants to merge
29
commits into
windows-ea-support
Choose a base branch
from
windows-ads-support
base: windows-ea-support
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Move main file check into node as we do not want to rely on : in file name. Use encrypt file system call for directories. Call removeExtraStreams for ads in files and folders from restore metadata before restoring meta data so that readonly is false before we start removing the streams.
Remove recreation of files fin fileswriter_windows for encrypted file handling. Fix nonencrypted restore over encrypted file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR change? What problem does it solve?
Restic did not back up Alternate Data Streams in Windows. Restic now backs up Alternate Data Streams (ADS) and restores them back to the main files.
The Alternate Data Streams are backed up like any other normal files, and the full name of the stream like 'file_name.txt:stream_name' is stored as the name of the file representing the ADS.
During restore, the ADS files are restored and attached to the original files as Alternate Data Streams. For progress and summary, the ADS are not counted in the "filesFinished" and "filesTotal" count, but the sizes of the ADS files are counted.
This feature does not require any update to the repository structure.
However, if restic#4611 is merged, it can be leveraged for making an optimization in this PR.
While restoring the ADS files, since the main file and ADS can be restored in any order, it is possible that the ADS can be restored before the main file, in which case it creates an empty main file and starts the ADS restore. After this when the main file is restored, if it is restored with the os.O_CREATE option, then it would replace the full file and ADS would be lost. Hence, we need to first try without the os.O_CREATE option and if we find that the file does not exist, then use the os.O_CREATE option. Presently this is being done for all files. With restic#4611 merged, we would be able to add a new generic attribute TypeADS to indicate if a file has ADS and only do the check without the os.O_CREATE option for those files.
Was the change previously discussed in an issue or on the forum?
Closes restic#1401
Checklist
changelog/unreleased/
that describes the changes for our users (see template).gofmt
on the code in all commits.