From cf617ae866acbe976ebb301714799becc79f8de4 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Sat, 1 Mar 2014 22:32:39 +0000 Subject: [PATCH] add some binary patterns for scripts (Debian#707014) --- magic/Magdir/commands | 19 ++++++++++++++++++- magic/Magdir/varied.script | 30 +++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/magic/Magdir/commands b/magic/Magdir/commands index 4a7d8ddb..7dbee86c 100644 --- a/magic/Magdir/commands +++ b/magic/Magdir/commands @@ -1,15 +1,24 @@ #------------------------------------------------------------------------------ -# $File: commands,v 1.45 2013/02/06 14:18:52 christos Exp $ +# $File: commands,v 1.46 2013/03/25 14:06:55 christos Exp $ # commands: file(1) magic for various shells and interpreters # #0 string/w : shell archive or script for antique kernel text 0 string/wt #!\ /bin/sh POSIX shell script text executable !:mime text/x-shellscript + +0 string/wb #!\ /bin/sh POSIX shell script executable (binary data) +!:mime text/x-shellscript + + 0 string/wt #!\ /bin/csh C shell script text executable !:mime text/x-shellscript + # korn shell magic, sent by George Wu, gwu@clyde.att.com 0 string/wt #!\ /bin/ksh Korn shell script text executable +0 string/wb #!\ /bin/ksh Korn shell script executable (binary data) +!:mime text/x-shellscript + !:mime text/x-shellscript 0 string/wt #!\ /bin/tcsh Tenex C shell script text executable !:mime text/x-shellscript @@ -57,12 +66,20 @@ # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de) 0 string/wt #!\ /bin/bash Bourne-Again shell script text executable !:mime text/x-shellscript +0 string/wb #!\ /bin/bash Bourne-Again shell script executable (binary data) +!:mime text/x-shellscript 0 string/wt #!\ /usr/bin/bash Bourne-Again shell script text executable !:mime text/x-shellscript +0 string/wb #!\ /usr/bin/bash Bourne-Again shell script executable (binary data) +!:mime text/x-shellscript 0 string/wt #!\ /usr/local/bash Bourne-Again shell script text executable !:mime text/x-shellscript +0 string/wb #!\ /usr/local/bash Bourne-Again shell script executable (binary data) +!:mime text/x-shellscript 0 string/wt #!\ /usr/local/bin/bash Bourne-Again shell script text executable !:mime text/x-shellscript +0 string/wb #!\ /usr/local/bin/bash Bourne-Again shell script executable (binary data) +!:mime text/x-shellscript # PHP scripts # Ulf Harnhammar diff --git a/magic/Magdir/varied.script b/magic/Magdir/varied.script index 1226aa06..11e1d217 100644 --- a/magic/Magdir/varied.script +++ b/magic/Magdir/varied.script @@ -1,28 +1,56 @@ #------------------------------------------------------------------------------ -# $File: varied.script,v 1.8 2011/12/05 23:14:02 rrt Exp $ +# $File: varied.script,v 1.9 2011/12/16 16:32:48 rrt Exp $ # varied.script: file(1) magic for various interpreter scripts 0 string/t #!\ / a >3 string >\0 %s script text executable !:strength / 2 + +0 string/b #!\ / a +>3 string >\0 %s script executable (binary data) +!:strength / 2 + 0 string/t #!\t/ a >3 string >\0 %s script text executable !:strength / 2 + +0 string/b #!\t/ a +>3 string >\0 %s script executable (binary data) +!:strength / 2 + 0 string/t #!/ a >2 string >\0 %s script text executable !:strength / 2 + +0 string/b #!/ a +>2 string >\0 %s script executable (binary data) +!:strength / 2 + 0 string/t #!\ script text executable >3 string >\0 for %s !:strength / 3 +0 string/b #!\ script executable +>3 string >\0 for %s (binary data) +!:strength / 3 + # using env 0 string/t #!/usr/bin/env a >15 string/t >\0 %s script text executable !:strength / 10 + +0 string/b #!/usr/bin/env a +>15 string/b >\0 %s script executable (binary data) +!:strength / 10 + 0 string/t #!\ /usr/bin/env a >16 string/t >\0 %s script text executable !:strength / 10 +0 string/b #!\ /usr/bin/env a +>16 string/b >\0 %s script executable (binary data) +!:strength / 10 + # From: arno # mozilla xpconnect typelib # see http://www.mozilla.org/scriptable/typelib_file.html -- 2.40.0