List Info

Thread: problem lha archive extract




problem lha archive extract
country flaguser name
Japan
2007-04-19 01:09:15
I found a small problem concerning the lha extract.

The lha file compressed with UNLHA32.DLL Ver 2.02e (Windows
tool) cannot be 
extract.

The problem is in the difference of the list format. 

Example:

Unix lha compress
% lha lq unix.lzh 
-rwxr--r--     0/0          17 100.0% Apr 19 14:08
sample.txt

UNLHA32.DLL compress
% lha lq windows.lzh 
[MS-DOS]                    17 100.0% Apr 19 14:08
sample.txt

When the lha file processing was rewritten as follows, it
worked. 

try version:
 amavisd-new-2.4.2 (debian etch distribution)

do_lha : line 16163

  elsif ($ln =~ /^(?:S+s+)S+s*(S.*?)s*z/s) {
push(list,$1) }

to

  elsif ($ln =~ /.*s(S.*?)s*z/s) { push(list,$1)
}

Please fix this problem. 

The sample file is appended(uuencode).

begin 664 unix.lzh
M(^0M;&P+20    1     7&3-B !"G-A;7!L92YT>'3(N54%
%#D0< 40  
=   ' %0R^29&  !S86UP;&4=&5X="!F:6QE"!T
 
end

begin 744 windows.lzh
M2  M;&P+1$    1    ,ODF1B "R+E-!  RR<'#0
!<V%M<&QE+G1X=!L 
M09?-J;! L<!ATY[M$""QP&'3GNT0(+' 0 
<V%M<&QE('1E>'09FEL90H 
 
end

-- 

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: problem lha archive extract
country flaguser name
Slovenia
2007-04-19 07:09:54
On Thursday April 19 2007 08:09:15 Ryuhei Funatsu wrote:
> I found a small problem concerning the lha extract.
>
> The lha file compressed with UNLHA32.DLL Ver 2.02e
(Windows tool)
> cannot be extract.
> The problem is in the difference of the list format.
> -rwxr--r--     0/0          17 100.0% Apr 19 14:08
sample.txt
> [MS-DOS]                    17 100.0% Apr 19 14:08
sample.txt

>-  elsif ($ln =~ /^(?:S+s+)S+s*(S.*?)s*z/s) {
push(list,$1) }
>+  elsif ($ln =~ /.*s(S.*?)s*z/s) { push(list,$1)
}

Thanks for the problem report. Your solution does not work
for filenames with spaces in them. Please try the
following,
it will go into 2.5.0:

  } elsif
($ln=~m{^(?:S+s+d+/d+|.)(?:s+S+)s*(S.*?)s*z
}s) {
    my($name) = $1; $name = $1 if $name =~ m{^(.*) ->
(.*)z}s;  # symlink
    push(list, $name);
  }

I also found out that if the archive is named
something.lha.exe,
then lha only sees MS file members (but it does recognize
self-extracting
archives). On the other hand if an archive name is
something.lha,
it sees all members, but does not recognize SFX. I'm not
sure which
one is less bad.

  Mark

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

Re: problem lha archive extract
country flaguser name
Japan
2007-04-20 04:27:07
At Thu, 19 Apr 2007 14:09:54 +0200,
Mark Martinec wrote:
> 
> Thanks for the problem report. Your solution does not
work
> for filenames with spaces in them. Please try the
following,
> it will go into 2.5.0:
> 
>   } elsif
($ln=~m{^(?:S+s+d+/d+|.)(?:s+S+)s*(S.*?)s*z
}s) {
>     my($name) = $1; $name = $1 if $name =~ m{^(.*)
-> (.*)z}s;  # symlink
>     push(list, $name);
>   }
> 
Thank you for reply,it works fine.

> I also found out that if the archive is named
something.lha.exe,
> then lha only sees MS file members (but it does
recognize self-extracting
> archives). On the other hand if an archive name is
something.lha,
> it sees all members, but does not recognize SFX. I'm
not sure which
> one is less bad.
> 
Sorry, I do not understand a detailed specification of LHA.


but for example,

unix.lzh is a file of the header level 1. 
windows.lzh is a file of the header level 2. 

The header level is understood in 0x20 byte (0x01 or 0x02).


hedaer level 1: 
It becomes a file name from 0x22 of the header. 
However, it makes to 0 and it puts it in the enhancing
header 
for 230 bytes or more. 
The directory name is in the enhancing header. 

hedaer level 2: 
The file name and the directory name are in the enhancing
header. 

Thank you. 

-- 
------------------------------------------------------------
----------------
import java.awt.Graphics;
public class SignatureApplet extends java.applet.Applet {
 public void paint(Graphics g) {
  g.drawString("Sea Of Serenity, MR&T Consulting,
Yokomaha, Japan.", 5, 25);
  g.drawString("ryumoonrabbit.co.jp", 5,
35);
 }
}

------------------------------------------------------------
-------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and
take
control of your XML. No limits. Just data. Click to get it
now.
http://sourcefor
ge.net/powerbar/db2/
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )