X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_apply.c;h=ce20fe6116744726b0e4d394d430ce4522db98a8;hp=1737fa1b49d0e9040cfe83f3efe393836240fc44;hb=a46a4f0e37774d359808504bb69258c26945fd20;hpb=2200ddb2ab85b390daa140de5338ac9f023d3683;ds=sidebyside diff --git a/src/win32_apply.c b/src/win32_apply.c index 1737fa1b..ce20fe61 100644 --- a/src/win32_apply.c +++ b/src/win32_apply.c @@ -863,7 +863,11 @@ try_open_again: requestedAccess &= ~ACCESS_SYSTEM_SECURITY; goto try_open_again; } - if (err == ERROR_SHARING_VIOLATION) { + if (err == ERROR_SHARING_VIOLATION && + (inode->i_attributes & (FILE_ATTRIBUTE_ENCRYPTED | + FILE_ATTRIBUTE_DIRECTORY)) == + (FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_DIRECTORY)) + { if (remaining_sharing_violations) { --remaining_sharing_violations; /* This can happen when restoring encrypted directories @@ -875,13 +879,12 @@ try_open_again: } else { ERROR("Too many sharing violations; giving up..."); } - } else { - if (creationDisposition == OPEN_EXISTING) - ERROR("Failed to open \"%ls\"", stream_path); - else - ERROR("Failed to create \"%ls\"", stream_path); - win32_error(err); } + if (creationDisposition == OPEN_EXISTING) + ERROR("Failed to open \"%ls\"", stream_path); + else + ERROR("Failed to create \"%ls\"", stream_path); + win32_error(err); ret = WIMLIB_ERR_OPEN; goto fail; }