BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001000 [BusyBox] Standards Compliance minor always 08-17-06 08:28 05-03-08 04:40
Reporter VEvgeniy View Status public  
Assigned To BusyBox
Priority normal Resolution unable to reproduce  
Status closed   Product Version svn
Summary 0001000: this awk script don't work with busybox
Description multipart.awk
------ start ------
BEGIN{
  RS="\015\012"
  getline
  FS="\015\012"
  RS=$0
  dirfile="/tmp"
}
{
  head=1
  getfile=""
  getname=""
  typedata="f"
  if($1=="--"){exit}
  if($1==""){$0=substr($0,3)}
  for(i=1;i<=NF;i++){
    head=head+length($i)+length(FS)
    if($i==""){
      value=$0
      value=substr(value,head,length(value)-head-1)
      if(getfile!=""){
        printf("%s",value) > dirfile"/"getfile
    value=getfile
      }
      for(nl=1;nl<=length(value);nl=nl+2){
        value=substr(value,1,nl-1)"\\"substr(value,nl)
      }
      while((nl=index(getname,"_"))>0){getname=substr(getname,1,nl-1)" "substr(getname,nl+1)}
      if(value==""){value="''"}
      print getname" "value
      next
    }
    if(i==1){
      s=$1";"
      while(length(s)>0){
        n=index(s,";")
        sl=substr(s,1,n-1)
        while(substr(sl,1,1)==" "){sl=substr(sl,2)}
        if(typedata=="f"){
          if(sl=="Content-Disposition: form-data"){typedata="t"}
        }
        else{
          if(substr(sl,1,5)=="name="){
            getname=substr(sl,7,length(sl)-7)
          }
          if(substr(sl,1,9)=="filename="){
            getfile=substr(sl,11,length(sl)-11)
            while((nl=index(getfile,"/"))>0){getfile=substr(getfile,nl+1)}
            while((nl=index(getfile,"\\"))>0){getfile=substr(getfile,nl+1)}
          }
        }
        s=substr(s,n+1)
      }
    }
  }
}
------ end ------
This awk script work with "multipart/form-data" enctype in cgi-script for httpd
Only "multipart/form-data" enctype form download files to server.
If I use standart awk program, I have fine result with any files.
If I use busybox awk, I have bad result. My files cut.
problem strings:
...
      value=$0
      value=substr(value,head,length(value)-head-1)
      if(getfile!=""){
        printf("%s",value) > dirfile"/"getfile
    value=getfile
      }
...
more file - more probability problem
I have not fine result with 10MB file or more.
Additional Information
Attached Files

- Relationships

- Notes
(0001588)
bernhardf
08-25-06 08:40

I fear that i do not quite understand the problem you are describing.

Can you please attach a tarball with
1) the awk script
2) example input file
3) expected output file
4) a script that converts the input file to the outputfile?

regards,
 
(0001593)
VEvgeniy
08-26-06 07:10

my files size ~ 4.7 MB
bernhardf, please send your e-mail address

my e-mail vevgeniy82@mail.ru
 
(0004684)
vda
02-14-08 07:03

Bernhard Fischer rep.dot.nop AT gmail.com
Denys Vlasenko vda.linux AT googlemail.com
 

- Issue History
Date Modified Username Field Change
08-17-06 08:28 VEvgeniy New Issue
08-17-06 08:28 VEvgeniy Status new => assigned
08-17-06 08:28 VEvgeniy Assigned To  => BusyBox
08-25-06 08:40 bernhardf Note Added: 0001588
08-26-06 07:10 VEvgeniy Note Added: 0001593
02-14-08 07:03 vda Note Added: 0004684
05-03-08 04:40 vda Status assigned => closed
05-03-08 04:40 vda Resolution open => unable to reproduce


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker