commit eb81dee7971fbf5e53a54e0908b4296954a6a297
parent 760c3d45acf249b2f9838dd7427683106f178e73
Author: Bob Owen <bobowencode@gmail.com>
Date: Tue, 2 Dec 2025 17:20:03 +0000
Bug 2003364 - Remove MOZ_ALWAYS_TRUE from SetNamedSecurityInfoW call. r=yjuglaret
All of the crashes looked at involve drives that might be prone to intermittent
failures or have unusual characteristics. While we could get something reported
that would be actionable it would be hard to find in the noise.
Differential Revision: https://phabricator.services.mozilla.com/D274736
Diffstat:
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/xpcom/io/nsLocalFileWin.cpp b/xpcom/io/nsLocalFileWin.cpp
@@ -1949,13 +1949,11 @@ nsresult nsLocalFile::MoveOrCopyAsSingleFileOrDir(nsIFile* aDestParent,
if (isDir.isNothing() ||
!ChildAclMatchesAclInheritedFromParent(WrapNotNull(childDacl), *isDir,
childSecDesc, aDestParent)) {
- // We don't expect this to fail, but it shouldn't crash in release.
- MOZ_ALWAYS_TRUE(
- ERROR_SUCCESS ==
- ::SetNamedSecurityInfoW(destPath.get(), SE_FILE_OBJECT,
- DACL_SECURITY_INFORMATION |
- UNPROTECTED_DACL_SECURITY_INFORMATION,
- nullptr, nullptr, childDacl, nullptr));
+ // This may fail if the destination file is not available.
+ ::SetNamedSecurityInfoW(
+ destPath.get(), SE_FILE_OBJECT,
+ DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION,
+ nullptr, nullptr, childDacl, nullptr);
}
}
}