URI: 
       tboguszip - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit fc46abdd9ce3bff29f735142ab52fec4fb1bf8a7
   DIR parent 20bd3ca2e2bc7c1b284a5a52e72a32530529d234
  HTML Author: rsc <devnull@localhost>
       Date:   Wed, 12 Apr 2006 13:10:08 +0000
       
       boguszip
       
       Diffstat:
         M mail/lib/validateattachment         |      16 +++++++++++++---
       
       1 file changed, 13 insertions(+), 3 deletions(-)
       ---
   DIR diff --git a/mail/lib/validateattachment b/mail/lib/validateattachment
       t@@ -5,9 +5,9 @@ rfork n
        
        # exit status matching:
        #
       -#        *discard* - is really bad, refuse the message 
       -#        *accept* - is really good, leave attachment alone
       -#        * - rewrite attachment to have .suspect extension
       +#        $discard - is really bad, refuse the message 
       +#        $accept - is really good, leave attachment alone
       +#        anything else - rewrite attachment to have .suspect extension
        # 
        
        # magic exit statuses known to vf
       t@@ -21,6 +21,15 @@ if(! ~ $#* 1){
                exit usage
        }
        
       +# some idiot virus is sending around attachments marked as .zip
       +# that are completely bogus and just say %TS_ZIP_ATTACH%
       +# as the base64 encoding of the zip file.  gmail rejects all zip
       +# attachments when we forward them, so nip this one here.
       +if(grep -s '^%TS_ZIP_ATTACH%$' $1 && ~ `{wc -l <$1} 1 2 3 4 5 6 7 8 9 10){
       +        echo bogus zip file!
       +        exit $discard
       +}
       +
        upas/unvf < $1 >$1.unvf
        file=$1.unvf
        fn sigexit { rm $file }
       t@@ -40,6 +49,7 @@ case *Ascii* *text* *'c program'* *'rc executable'*
                exit $accept
        
        case *'zip archive'*
       +        
                # >[2=1] because sometimes we get zip files we can't parse
                # but the errors look like
                # unzip: reading data for philw.doc.scr failed: ...