Skip to content
  • Marek Habersack's avatar
    [xaprepare] Make 7zip work with "dangerous" symlinks in ZIPs (#8737) · 82133485
    Marek Habersack authored
    From time to time, `7zip` invoked by `xaprepare` with an error similar to:
    
        ERROR: Dangerous symbolic link path was ignored : android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/lib/python3.10/site-packages/lldb/lldb-argdumper : ../../../../bin/lldb-argdumper
        ERROR: Dangerous symbolic link path was ignored : android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/lib/python3.10/site-packages/lldb/_lldb.cpython-310-x86_64-linux-gnu.so : ../../../liblldb.so
    
    The problem is that this symlink is **not** a dangerous one, as it doesn't 
    point outside the archived directory tree.
    
    This happened on mac, Windows and Linux alike.
    
    Try to work around the issue by using an undocumented `-snld` 7zip option 
    when extracting ZIP archives.  Since the option is understood only from
    `7-Zip` 20.x, check the version before using the argument.
    82133485