Ticket #3983: 7z_avoid_lockup_when_pwd_needed.patch

File 7z_avoid_lockup_when_pwd_needed.patch, 2.9 KB (added by howaboutsynergy, 5 years ago)
  • src/vfs/extfs/helpers/u7z

    this happens because 7z prompts for password in the background, so mc is locked up.
    should fix when pressing enter on a .7z passworded file, and when F3-ing one.
    
    diff --git a/src/vfs/extfs/helpers/u7z b/src/vfs/extfs/helpers/u7z
    index 04f3f9c81..a56b3d848 100755
    a b mcu7zip_list () 
    4343        [ "${date_archive}"x = x ] && date_archive=`ls -lan "$1" 2>/dev/null | awk '{print $6, $7, $8}' 2>/dev/null` 
    4444        [ "${date_archive}"x = x ] && date_archive="01-01-1970 00:00:00" 
    4545 
    46         $P7ZIP l "$1" | sed -n " 
     46        $P7ZIP l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "$1" | sed -n " 
    4747 
    4848                  # If the uncompressed size is missing, we copy the compressed size onto it. 
    4949                  # 
    mcu7zip_list () 
    6868mcu7zip_copyout () 
    6969{ 
    7070        #first we check if we have old p7zip archive with prefix ./ in filename 
    71         $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ 
     71        $P7ZIP l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "$1" "$2" | grep -q "0 files, 0 folders" && \ 
    7272        EXFNAME='*./'"$2" || EXFNAME="$2" 
    73         $P7ZIP e -so "$1" "$EXFNAME" > "$3" 2>/dev/null 
     73        $P7ZIP e -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded -so "$1" "$EXFNAME" > "$3" 2>/dev/null 
    7474} 
    7575 
    7676mcu7zip_copyin () 
    mcu7zip_rm () 
    9090{ 
    9191        # NOTE: Version 4.20 fails to delete files in subdirectories 
    9292        #first we check if we have old p7zip archive with prefix ./ in filename 
    93         $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ 
     93        $P7ZIP l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "$1" "$2" | grep -q "0 files, 0 folders" && \ 
    9494        EXFNAME='*./'"$2" || EXFNAME="$2" 
    9595        $P7ZIP d "$1" "$EXFNAME" 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \ 
    9696        { printf "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; } 
    mcu7zip_rm () 
    9999mcu7zip_rmdir () 
    100100{ 
    101101        #first we check if we have old p7zip archive with prefix ./ in filename 
    102         $P7ZIP l "$1" "$2" | grep -q "0 files, 0 folders" && \ 
     102        $P7ZIP l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "$1" "$2" | grep -q "0 files, 0 folders" && \ 
    103103        EXFNAME='*./'"$2" || EXFNAME="$2" 
    104104        $P7ZIP d "$1" "$EXFNAME"/ 2>&1 | grep -q E_NOTIMPL > /dev/null 2>&1 && \ 
    105105        { printf "Function not implemented...\n7z cannot delete from solid archive." >&2 ; exit 1 ; } 
  • misc/ext.d/archive.sh

    diff --git a/misc/ext.d/archive.sh b/misc/ext.d/archive.sh
    index e6105fdc1..5f8cbe137 100755
    a b do_view_action() { 
    113113    7z) 
    114         7za l "${MC_EXT_FILENAME}" 2>/dev/null || 
    115             7z l "${MC_EXT_FILENAME}" 
     114        7za l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "${MC_EXT_FILENAME}" 2>/dev/null || 
     115            7z l -pDUMMYPASSWORDTOAVOID_MC_LOCKUP_whenpwdneeded "${MC_EXT_FILENAME}" 
    116116