Bug 183257 - sysutils/file: [Bug 292] Illegal byte sequence in windows magic file
sysutils/file: [Bug 292] Illegal byte sequence in windows magic file
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: bf
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 06:40 UTC by Scot Hetzel
Modified: 2014-08-14 23:48 UTC (History)
1 user (show)

See Also:


Attachments
patch-magic__Magdir__windows (445 bytes, text/plain)
2013-10-24 06:40 UTC, Scot Hetzel
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scot Hetzel 2013-10-24 06:40:00 UTC
When sysutils/file is installed and run as:

LC_ALL=en_US.UTF-8 /usr/local/bin/file /usr/ports/sysutils/file/Makefile

it reports the following error:

ERROR: line 163: regex error 17, (illegal byte sequence)

According to the Mantis Bug Tracker, this is bug 292:

http://bugs.gw.con/view.php?id=292

Which narrowed the cause down to the magic/Magdir/windows magic file.

Fix: The bug narrowed the issue down to line 163 of the magic/Magdir/windows file.

I was able to isolate the offending part of the regex.

Could someone commit it to the port and submit it upstream if the patch is correct.

Thanks
How-To-Repeat: 
cd /usr/ports/sysutils/file
make install
sh
LC_ALL=en_US.UTF-8 /usr/local/bin/file Makefile
Comment 1 Edwin Groothuis freebsd_committer 2013-10-24 06:40:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->bf

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Scot Hetzel 2014-03-05 06:52:08 UTC
 The programers of the file utility fixed the bug another way on
2/18/2014.  They patched src/softmagic.c:

- save current locale
- set locale to C
- run the regcomp
- restore the saved locale

The patch can be obtained from:

http://bugs.gw.com/view.php?id=292

Most likely the fix will be included in file >5.17.

-- 
DISCLAIMER:

No electrons were maimed while sending this message. Only slightly bruised.
Comment 3 bf1783 2014-03-05 07:17:49 UTC
On 3/5/14, Scot Hetzel <swhetzel@gmail.com> wrote:
> The following reply was made to PR ports/183257; it has been noted by
> GNATS.
>
> From: Scot Hetzel <swhetzel@gmail.com>
> To: bug-followup@FreeBSD.org
> Cc:
> Subject: Re: ports/183257: sysutils/file: [Bug 292] Illegal byte sequence
> in
>  windows magic file
> Date: Wed, 5 Mar 2014 00:52:08 -0600
>
>   The programers of the file utility fixed the bug another way on
>  2/18/2014.  They patched src/softmagic.c:
>
>  - save current locale
>  - set locale to C
>  - run the regcomp
>  - restore the saved locale
>
>  The patch can be obtained from:
>
>  http://bugs.gw.com/view.php?id=292
>
>  Most likely the fix will be included in file >5.17.

Yes, because this regex was only one of a number that could be
affected by the locale settings.  There were a number of patches to
several different files.  I'm checking to see if they are going to
release a new version that incorporates these changes -- if a new
release isn't imminent, I'll make a patch.

b.
Comment 4 dfilter freebsd_committer 2014-03-29 08:39:39 UTC
Author: bf
Date: Sat Mar 29 08:39:36 2014
New Revision: 349487
URL: http://svnweb.freebsd.org/changeset/ports/349487
QAT: https://qat.redports.org/buildarchive/r349487/

Log:
  Update to 5.18
  
  PR:		183257
  Security:	http://www.vuxml.org/freebsd/7e61a839-b714-11e3-8195-001966155bea.html

Modified:
  head/sysutils/file/Makefile
  head/sysutils/file/distinfo
  head/sysutils/file/pkg-descr

Modified: head/sysutils/file/Makefile
==============================================================================
--- head/sysutils/file/Makefile	Sat Mar 29 08:30:51 2014	(r349486)
+++ head/sysutils/file/Makefile	Sat Mar 29 08:39:36 2014	(r349487)
@@ -2,7 +2,7 @@
 # $FreeBSD$
 
 PORTNAME=	file
-PORTVERSION=	5.17
+PORTVERSION=	5.18
 CATEGORIES=	sysutils
 MASTER_SITES=	ftp://ftp.astron.com/pub/file/ \
 		ftp://ftp.fu-berlin.de/unix/tools/file/

Modified: head/sysutils/file/distinfo
==============================================================================
--- head/sysutils/file/distinfo	Sat Mar 29 08:30:51 2014	(r349486)
+++ head/sysutils/file/distinfo	Sat Mar 29 08:39:36 2014	(r349487)
@@ -1,2 +1,2 @@
-SHA256 (file-5.17.tar.gz) = 3feb97141b387b64da30aee485852925312c0e74219380a5ed451f14a90c83ca
-SIZE (file-5.17.tar.gz) = 709991
+SHA256 (file-5.18.tar.gz) = 6519fb706d583231c2419592ebecdbb21d33c62eaf7a1a0b24ddfcb80c08bf07
+SIZE (file-5.18.tar.gz) = 715461

Modified: head/sysutils/file/pkg-descr
==============================================================================
--- head/sysutils/file/pkg-descr	Sat Mar 29 08:30:51 2014	(r349486)
+++ head/sysutils/file/pkg-descr	Sat Mar 29 08:39:36 2014	(r349487)
@@ -6,3 +6,5 @@ tests, performed in the following order:
   - language tests
 
 The first test that succeeds causes the file type to be printed.
+
+WWW: http://darwinsys.com/file
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"