From chrissicool [...] googlemail.com Fri Feb 21 05: | 31:15 2014 |
MIME-Version: | 1.0 |
X-Spam-Status: | No, score=-2.699 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham |
X-Mailer: | Evolution 3.8.4-0ubuntu1 |
X-Spam-Flag: | NO |
Content-Type: | multipart/mixed; boundary="=-AgnZIrCjBOHu3egUeIZA" |
Message-ID: | <1392978657.1828.22.camel [...] raijin> |
X-Received: | by 10.15.52.66 with SMTP id o42mr7447515eew.89.1392978665046; Fri, 21 Feb 2014 02:31:05 -0800 (PST) |
X-Virus-Scanned: | Debian amavisd-new at bestpractical.com |
X-Spam-Score: | -2.699 |
Received: | from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id ED540240631 for <cpan-bug+File-MimeInfo [...] hipster.bestpractical.com>; Fri, 21 Feb 2014 05:31:14 -0500 (EST) |
Received: | from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rlXhmrXmYn3W for <cpan-bug+File-MimeInfo [...] hipster.bestpractical.com>; Fri, 21 Feb 2014 05:31:13 -0500 (EST) |
Received: | from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CCA99240615 for <bug-File-MimeInfo [...] rt.cpan.org>; Fri, 21 Feb 2014 05:31:11 -0500 (EST) |
Received: | (qmail 10294 invoked by alias); 21 Feb 2014 10:31:11 -0000 |
Received: | from mail-ea0-f177.google.com (HELO mail-ea0-f177.google.com) (209.85.215.177) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Fri, 21 Feb 2014 02:31:09 -0800 |
Received: | by mail-ea0-f177.google.com with SMTP id h10so96990eak.8 for <bug-File-MimeInfo [...] rt.cpan.org>; Fri, 21 Feb 2014 02:31:05 -0800 (PST) |
Received: | from [10.24.44.7] (gate.trust2core.de. [89.246.70.98]) by mx.google.com with ESMTPSA id f45sm24940902eeg.5.2014.02.21.02.31.02 for <bug-File-MimeInfo [...] rt.cpan.org> (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 21 Feb 2014 02:31:03 -0800 (PST) |
Authentication-Results: | hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] googlemail.com |
Delivered-To: | cpan-bug+File-MimeInfo [...] hipster.bestpractical.com |
Subject: | Double-close on a filehandle |
Return-Path: | <chrissicool [...] googlemail.com> |
X-RT-Mail-Extension: | file-mimeinfo |
X-Original-To: | cpan-bug+File-MimeInfo [...] hipster.bestpractical.com |
X-Spam-Check-BY: | la.mx.develooper.com |
Dkim-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=message-id:subject:from:to:date:content-type:mime-version; bh=m+qKgFbqmX1IMx3YOo0MMJz/ut4Tij6KFkqfdHR76MA=; b=ldsf5rQY3wVEX0S2aSni/bXImIOoOOHy2AVKxKOV/WEdzKJ17BOa00Oxz3FLFkEEpN 8Q2y5YWvtGpGCn66974bzwvYRCi2mTzmwJWgr2owVHh59IoDZGTbOW8bnS9GzlznfEFI xZg88whxreMW+yS8DvQtJJHUm6WVTeDUBdZLgS6HjtKfy7hDS3wtXD2KcLIEa5rxiVtE pD6Q2xIGh8HRAPCtsxXFMazAldgsIGKwwyDG0bLBWJ27ImRs54swvEpq4IsgEZfKjHu8 49ykFmABE+B5ID1gFbDceAyiyweBV7agoERl5MAs004m3uldIW5lumVU/X9rU8BnGXYh oVtg== |
Date: | Fri, 21 Feb 2014 11:30:57 +0100 |
X-Spam-Level: | |
To: | bug-File-MimeInfo [...] rt.cpan.org |
From: | Christian Ludwig <chrissicool [...] googlemail.com> |
X-RT-Interface: | |
Content-Length: | 0 |
content-type: | text/plain; charset="utf-8" |
Content-Transfer-Encoding: | 7bit |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 459 |
I ran into the following error:
Can't use an undefined value as a symbol reference at /usr/share/perl5/File/MimeInfo/Magic.pm line 46.
The problem is that _magic() closes the fd when it finds a result for
lower priority rules. mimetype() then tries to close it again.
Since we take a completely different route in mimetype() if 'ref file'
is true, we can close the fd safely whenever the low-priority rules
return one.
The appended patch fixes the issue.
Content-Type: | text/x-patch; charset="UTF-8"; name="magic.patch" |
Content-Disposition: | attachment; filename="magic.patch" |
Content-Transfer-Encoding: | 7bit |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 413 |
Message body is not shown because sender requested not to inline it.