From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26849 invoked by alias); 16 Dec 2016 20:41:10 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 26674 invoked by uid 89); 16 Dec 2016 20:41:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=cygwin-apps, cygwinapps, H*m:5657, H*MI:5657 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Dec 2016 20:40:55 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DDE173F21B for ; Fri, 16 Dec 2016 20:40:53 +0000 (UTC) Received: from red.redhat.com (ovpn-117-243.rdu2.redhat.com [10.10.117.243]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBGKerLX008678 for ; Fri, 16 Dec 2016 15:40:53 -0500 From: Eric Blake To: cygwin-apps@cygwin.com Subject: [PATCH] src_postinst.cygpart: Sanitize binary data in bash command subst Date: Fri, 16 Dec 2016 20:41:00 -0000 Message-Id: <20161216204052.5657-1-eblake@redhat.com> X-IsSubscribed: yes X-SW-Source: 2016-12/txt/msg00025.txt.bz2 bash 4.4 now warns about skipping NUL bytes in $(command), since command substitution is only well-formed for commands that output text, but NUL bytes are not text. Silence the warning by removing NUL bytes from the stream before bash can see them. --- lib/src_postinst.cygpart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src_postinst.cygpart b/lib/src_postinst.cygpart index 30ad90e..2ae26b6 100644 --- a/lib/src_postinst.cygpart +++ b/lib/src_postinst.cygpart @@ -967,14 +967,14 @@ __prepstrip() { # Magic number is at end of file: # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#74 # http://cygwin.com/ml/cygwin-apps/2010-10/msg00057.html - case $(tail -c 12 "${exe}") in + case $(tail -c 12 "${exe}" | tr -d '\0') in Caml1999X0[0-9][0-9]) continue ;; esac # Perl Archive (PAR) binaries must not be stripped # https://rt.cpan.org/Public/Bug/Display.html?id=18536 # http://cygwin.com/ml/cygwin-apps/2012-07/msg00088.html - case $(tail -c 8 "${exe}" | tr '\012' '%') in + case $(tail -c 8 "${exe}" | tr '\012\0' '%') in %PAR\.pm%) continue ;; esac -- 2.9.3