From owner-freebsd-stable@freebsd.org Tue Aug 8 02:13:42 2017 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08068DD9FF2 for ; Tue, 8 Aug 2017 02:13:42 +0000 (UTC) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [IPv6:2001:1440:5001:1::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "uucp.dinoex.sub.de", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8CCCA694E9 for ; Tue, 8 Aug 2017 02:13:41 +0000 (UTC) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from uucp.dinoex.sub.de (uucp.dinoex.sub.de [194.45.71.2]) by uucp.dinoex.sub.de (8.15.2/8.14.9) with ESMTPS id v782D7N4071559 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 8 Aug 2017 04:13:07 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: Received: from citylink.dinoex.sub.org (uucp@localhost) by uucp.dinoex.sub.de (8.15.2/8.14.9/Submit) with UUCP id v782D7T9071558 for freebsd-stable@FreeBSD.ORG; Tue, 8 Aug 2017 04:13:07 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by citylink.dinoex.sub.de (8.15.2/8.15.2) with ESMTP id v7824jeu024532 for ; Tue, 8 Aug 2017 04:04:45 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: from gate.oper.dinoex.org (gate-e [192.168.98.2]) by gate.oper.dinoex.org (8.15.2/8.15.2) with ESMTP id v78241bw024436 for ; Tue, 8 Aug 2017 04:04:01 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) Received: (from news@localhost) by gate.oper.dinoex.org (8.15.2/8.15.2/Submit) id v78240Fe024435 for freebsd-stable@FreeBSD.ORG; Tue, 8 Aug 2017 04:04:00 +0200 (CEST) (envelope-from li-fbsd@citylink.dinoex.sub.org) X-Authentication-Warning: gate.oper.dinoex.org: news set sender to li-fbsd@citylink.dinoex.sub.org using -f From: Peter Subject: 11.1-RELEASE: magic hosed, file recognition fails Date: Tue, 8 Aug 2017 03:50:34 +0200 Organization: even some more stinky socks Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 8 Aug 2017 01:50:35 -0000 (UTC) Injection-Info: oper.dinoex.de; logging-data="22159"; mail-complaints-to="usenet@citylink.dinoex.sub.org" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 X-Mozilla-News-Host: news://localhost:119 Sender: li-fbsd@citylink.dinoex.sub.org To: freebsd-stable@FreeBSD.ORG X-Milter: Spamilter (Reciever: uucp.dinoex.sub.de; Sender-ip: 194.45.71.2; Sender-helo: uucp.dinoex.sub.de; ) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (uucp.dinoex.sub.de [194.45.71.2]); Tue, 08 Aug 2017 04:13:08 +0200 (CEST) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Aug 2017 02:13:42 -0000 Just found that my scripts that would detect image types by means of the "file" command do not work anymore in RELEASE-11. :( Whats happening in R11.1 is this: $ scanimage > /tmp/SCAN $ file /tmp/SCAN /tmp/SCAN: data While on R10 in looked this way, which appears slightly more useful: $ scanimage > /tmp/SCAN $ file /tmp/SCAN /tmp/SCAN: Netpbm image data, size = 2480 x 3507, rawbits, greymap Further investigation shows, the problem may have appeared with this update: >r309847 | delphij | 2016-12-11 08:33:02 +0100 (Sun, 11 Dec 2016) | 2 lines > >MFC r308420: MFV r308392: file 5.29. And that is a contrib, it seems the original comes from fishy penguins. So no proper repo, and doubtful if anybody might be in charge, but instead some colorful pictures like this one: https://fossies.org/diffs/file/5.28_vs_5.29/magic/Magdir/images-diff.html --------------------------------------------------------------- Looking closer - this is my file header: pmc@disp:604:1/tmp$ hd SCAN |more 00000000 50 35 0a 23 20 53 41 4e 45 20 64 61 74 61 20 66 |P5.# SANE data f| 00000010 6f 6c 6c 6f 77 73 0a 32 34 38 30 20 33 35 30 37 |ollows.2480 3507| 00000020 0a 32 35 35 0a 5f 58 56 4b 53 49 4b 52 54 50 51 |.255._XVKSIKRTPQ| 00000030 4e 4c 52 5b 56 55 4c 47 4e 4f 4e 4d 53 54 53 4d |NLR[VULGNONMSTSM| 00000040 53 49 50 52 4c 51 4f 53 56 55 53 4d 55 4e 4e 4c |SIPRLQOSVUSMUNNL| 00000050 55 49 4d 50 52 4c 4e 50 4d 56 4e 51 52 4e 4e 50 |UIMPRLNPMVNQRNNP| And this is the ruleset in the magic file: # PBMPLUS images # The next byte following the magic is always whitespace. # strength is changed to try these patterns before "x86 boot sector" 0 name netpbm >3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data >>&0 regex =[0-9]{1,50} \b, size = %s x >>>&0 regex =[0-9]{1,50} \b %s 0 string P5 >0 regex/4 P5\\s >>0 use netpbm >>>0 string x \b, rawbits, pixmap !:strength + 45 !:mime image/x-portable-pixmap The failing line is the one with "regex/4" command, and I dont see why there is a *double* \ - but a single one doesnt work either. Using \n instead, would work. And what also works is this one: >0 regex/4 P5[[:space:]] To figure the root cause would mean to look into that libmagic, and maybe there is a misunderstanding between the design of that lib and the linux guys maintaining the magic file?