microsoft / microsoft/Windows-classic-samples
Failure in VSS pre and post restore is ignored
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 5.7k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
In the source code, after pre and post restore, CheckSelectedWriterStatus() is called to check status of writers. I've copied snippet of code here for prerestore -
// Issue a PreRestore event to the writers
m_vssClient.PreRestore();
// Execute the optional custom command between PreRestore and PostRestore
try
{
// Check selected writer status
m_vssClient.CheckSelectedWriterStatus();
As per the microsoft documentation, after pre-restore, we need to verify writer status - https://learn.microsoft.com/en-us/windows/win32/vss/overview-of-preparing-for-restore
Here is code of CheckSelectedWriterStatus -
// Check the status for all selected writers
void VssClient::CheckSelectedWriterStatus()
{
FunctionTracer ft(DBG_INFO);
if ((m_dwContext & VSS_VOLSNAP_ATTR_NO_WRITERS) != 0)
return;
Here, the if condition is true in case of restore and hence checking writer status is actually skipped.
If I comment out this if condition and try to perform restore which is supposed to fail in prerestore, it actually fails.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the pre- and post-restore call sites for VssClient::CheckSelectedWriterStatus(), then read that function alongside the linked Microsoft VSS restore documentation. Reproduce the reported restore scenario where a writer failure is ignored and compare it with the condition removed. Done means writer-status failures during restore are detected and the appropriate failure is reported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100