From owner-freebsd-audit Sun Aug 5 19:59:13 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (unknown [217.75.135.248]) by hub.freebsd.org (Postfix) with SMTP id C68B037B401 for ; Sun, 5 Aug 2001 19:59:07 -0700 (PDT) (envelope-from roam@ringlet.net) Received: (qmail 37697 invoked by uid 1000); 6 Aug 2001 02:57:59 -0000 Date: Mon, 6 Aug 2001 05:57:59 +0300 From: Peter Pentchev To: David O'Brien Cc: audit@FreeBSD.org Subject: [PATCH] fix a file(1) minor POLA stretching Message-ID: <20010806055759.E586@ringworld.oblivion.bg> Mail-Followup-To: David O'Brien , audit@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi, It seems that the new file(1), recently imported into -current and -stable, has a slightly changed behavior, which results in a minor POLA stretching (maybe not really a violation). This new version of file(1) can "compile" magic files into a new, binary database-like format. Whenever the file(1) utility is invoked to examine a file, it first tries to open this new binary magic db, and not finding it, falls back to the old, regular magic file. This results in a warning message sent to stderr for each and every invocation of file(1) :) The fix is simple: build and install the new magic database along with the old file. Patch attached. G'luck, Peter -- If I were you, who would be reading this sentence? Index: src/usr.bin/file/Makefile =================================================================== RCS file: /home/ncvs/src/usr.bin/file/Makefile,v retrieving revision 1.18 diff -u -r1.18 Makefile --- src/usr.bin/file/Makefile 2001/07/30 03:50:04 1.18 +++ src/usr.bin/file/Makefile 2001/08/06 02:56:47 @@ -25,6 +25,7 @@ # Hacked and dismembered for bmake (Geoff Rehmet). MAGICFILE= /usr/share/misc/magic +MAGICDB= ${MAGICFILE}.mgc MAGICMODE= 444 SRCDIR= ${.CURDIR}/../../contrib/file @@ -40,17 +41,20 @@ MAN= file.1 magic.5 -CLEANFILES+= magic +CLEANFILES+= magic magic.mgc MAGFILES= ${SRCDIR}/Header\ ${SRCDIR}/Localstuff\ ${SRCDIR}/Magdir/[a-z]* -all: file magic +all: file magic magic.mgc magic: $(MAGFILES) cat $(MAGFILES) > $(.TARGET) +magic.mgc: file magic + ./file -C -m magic + CLEANFILES+= print-hacked.c print-hacked.c: print.c sed -e 's|daylight|0/*daylight*/|g' ${.ALLSRC} > ${.TARGET} @@ -58,5 +62,7 @@ beforeinstall: $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ magic $(DESTDIR)$(MAGICFILE) + $(INSTALL) $(COPY) -o $(BINOWN) -g $(BINGRP) -m $(MAGICMODE) \ + magic.mgc $(DESTDIR)$(MAGICDB) .include To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message