mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 10:23:17 +00:00
Patch UnRAR: don't replace symlinks with directories
UnRAR logic replaces directory symlinks found within archive file entry file paths with actual directories by deleting them after they're extracted. Unfortunately, this logic extends to deleting existing directories if you set the `DestName` instead of the `DestPath` in this API: rc = RARProcessFile(hArchive, RAR_EXTRACT, NULL, destFilePath); In the future UnRAR may change to disable the `LinksToDirs()` feature if using the `DestName` parameter. In the meantime, this commit completely disables it for our use case.
This commit is contained in:
parent
9ab25fe05a
commit
71a54bd7b2
1 changed files with 28 additions and 32 deletions
|
@ -642,10 +642,6 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
|
|||
wcsncpyz(DestFileName,Cmd->DllDestName,ASIZE(DestFileName));
|
||||
#endif
|
||||
|
||||
if (ExtrFile && Command!='P' && !Cmd->Test && !Cmd->AbsoluteLinks &&
|
||||
ConvertSymlinkPaths)
|
||||
ExtrFile=LinksToDirs(DestFileName,Cmd->ExtrPath,LastCheckedSymlink);
|
||||
|
||||
File CurFile;
|
||||
|
||||
bool LinkEntry=Arc.FileHead.RedirType!=FSREDIR_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue