From owner-freebsd-current@FreeBSD.ORG Thu Jun 5 02:52:36 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5984A37B401 for ; Thu, 5 Jun 2003 02:52:36 -0700 (PDT) Received: from mail.liwing.de (mail.liwing.de [213.70.188.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82FAC43FBF for ; Thu, 5 Jun 2003 02:52:34 -0700 (PDT) (envelope-from rehsack@liwing.de) Received: (qmail 33705 invoked from network); 5 Jun 2003 09:52:32 -0000 Received: from stingray.liwing.de (HELO liwing.de) ([213.70.188.164]) (envelope-sender ) by mail.liwing.de (qmail-ldap-1.03) with SMTP for ; 5 Jun 2003 09:52:32 -0000 Message-ID: <3EDF12E0.4020009@liwing.de> Date: Thu, 05 Jun 2003 11:52:32 +0200 From: Jens Rehsack Organization: LiWing IT-Services User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 (Compact - Build 2) X-Accept-Language: en-us, en MIME-Version: 1.0 To: David O'Brien Content-Type: multipart/mixed; boundary="------------090807070903090406050009" cc: FreeBSD-Current List cc: freebsd-audit Subject: file(1) doesn't recognize scripts correctly X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jun 2003 09:52:36 -0000 This is a multi-part message in MIME format. --------------090807070903090406050009 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi David, hi list, you got this mail, because you maintain src/contrib/file/. If you're not responsible, please let me know and I will find someone else to bother with this :-) I was playing around with file(1) to find a solution for detecting file content correctly. I've detected, that the pattern in src/contrib/file/Magfiles/commands which are useful detecting unknow scripts correctly (lines 44-52), prevents file from detecting eg. perl or scripts correctly. Sample: $ file -b /var/www/data/trevor/flexpage/tools/fpcombinelib a /usr/local/bin/php -Cqe script text executable $ file -b /var/www/data/trevor/flexpage/tools/getPage.pl a /usr/bin/perl script text executable I created a patch which may only a workaround until a script language is added which first letters are bigger than 'various'. Maybe a better solution would be renaming all scripts to 'script.shell', 'script.php', 'script.perl', ... 'script.various' or concatanation order is created. Last one may be the best solution. Please let me know what you think. Sample after patch: $ file -b /var/www/data/trevor/flexpage/tools/getPage.pl perl script text executable $ file -b /var/www/data/trevor/flexpage/tools/fpcombinelib PHP script text executable Regards, Jens --------------090807070903090406050009 Content-Type: text/plain; name="patch-contrib-file-Magdir" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="patch-contrib-file-Magdir" diff -uNr Magdir.old/commands Magdir/commands --- Magdir.old/commands Thu Jun 5 09:43:50 2003 +++ Magdir/commands Thu Jun 5 09:46:15 2003 @@ -40,17 +40,6 @@ 0 string #!\ /usr/bin/env a >16 string >\0 %s script text executable - -# generic shell magic -0 string #!\ / a ->3 string >\0 %s script text executable -0 string #!\ / a ->3 string >\0 %s script text executable -0 string #!/ a ->2 string >\0 %s script text executable -0 string #!\ script text executable ->3 string >\0 for %s - # PHP scripts # Ulf Harnhammar 0 string/c =3 string >\0 %s script text executable +0 string #!\ / a +>3 string >\0 %s script text executable +0 string #!/ a +>2 string >\0 %s script text executable +0 string #!\ script text executable +>3 string >\0 for %s + + --------------090807070903090406050009--