qilingframework / qiling

A True Instrumentable Binary Emulation Framework
https://qiling.io
GNU General Public License v2.0
5.11k stars 742 forks source link

POSIX: unlink() returns EPERM (-1) on failure. #1467

Open iMoD1998 opened 6 months ago

iMoD1998 commented 6 months ago

*Describe the bug Similar to #1442, unlink returns EPERM on failure resulting in some implementations of tar (specifically in busybox) to fail extracting. This likely due to tar trying to remove old files before extracting and if this fails it assumes directory isn't writable due to EPERM.

Expected behavior Unlink should return proper error code such as ENOENT when a directory doesnt exist etc.