Compare commits

...
99 Commits
Author SHA1 Message Date
Xin LI b06b7e647f Fix multiple vulnerabilities of ntp.
Approved by:	so
2016-12-22 16:19:05 +00:00
Gleb Smirnoff 8c7ff71d35 Merge r309688: address regressions in SA-16:37.libc.
PR:		215105
Submitted by:	<jtd2004a sbcglobal.net>
Approved by:	so
2016-12-07 23:35:15 +00:00
Gleb Smirnoff eb302dbc19 Fix possible login(1) argument injection in telnetd(8). [SA-16:36]
Fix link_ntoa(3) buffer overflow in libc. [SA-16:37]
Fix warnings about valid time zone abbreviations. [EN-16:19]
Update timezone database information. [EN-16:20]

Security:	FreeBSD-SA-16:36.telnetd
Security:	FreeBSD-SA-16:37.libc
Errata Notice:	FreeBSD-EN-16:19.tzcode
Errata Notice:	FreeBSD-EN-16:20.tzdata
Approved by:	so
2016-12-06 18:50:06 +00:00
Gleb Smirnoff 2ec2a2e9b9 Update tzdata to 2016i.
Note: because of what appears to be a missing MFC to stable branches,
these patches were generated by doing:

 % rsync -av stable/9/contrib/tzdata releng/9.3/contrib/tzdata
 % svn add releng/9.3/contrib/tzdata

Errata Notice:	EN-16:19
Submitted by:	gjb
Approved by:	so
2016-12-05 23:02:02 +00:00
Gleb Smirnoff bd89ab6fea Merge r307360 from stable/9:
Incorporate a change from OpenBSD by [email protected]

  Don't warn about valid time zone abbreviations.  POSIX
  through 2000 says that an abbreviation cannot start with ':', and
  cannot contain ',', '-', '+', NUL, or a digit.  POSIX from 2001
  on changes this rule to say that an abbreviation can contain only
  '-', '+', and alphanumeric characters from the portable character
  set in the current locale.  To be portable to both sets of rules,
  an abbreviation must therefore use only ASCII letters."  Adapted
  from tzcode2015f.

Errata Notice:	EN-16:19.tzcode
Approved by:	so
2016-12-05 22:43:24 +00:00
Xin LI e116dc6401 Fix BIND remote Denial of Service vulnerability. [SA-16:34]
Fix OpenSSL remote DoS vulnerability. [SA-16:35]

Security:	FreeBSD-SA-16:34.bind
Security:	FreeBSD-SA-16:35.openssl
Approved by:	so
2016-11-02 07:24:34 +00:00
Gleb Smirnoff 9be442673a Revised SA-16:15. The initial patch didn't cover all possible overflows
based on passing incorrect parameters to sysarch(2).

Security:	SA-16:15
Approved by:	so
2016-10-25 17:11:02 +00:00
Xin LI 2d004eec09 Fix BIND remote Denial of Service vulnerability. [SA-16:28]
Fix bspatch heap overflow vulnerability. [SA-16:29]

Fix multiple portsnap vulnerabilities. [SA-16:30]

Approved by:	so
2016-10-10 07:19:16 +00:00
Xin LI fa4337308b Apply upstream revision 3612ff6fcec0e3d1f2a598135fe12177c0419582:
Fix overflow check in BN_bn2dec()
Fix an off by one error in the overflow check added by 07bed46
("Check for errors in BN_bn2dec()").

This fixes a regression introduced in SA-16:26.openssl.

Submitted by:	jkim
PR:		212921
Approved by:	so
2016-09-26 08:21:29 +00:00
Xin LI 78c5f605d6 Fix multiple OpenSSL vulnerabilitites.
Approved by:	so
Security:	FreeBSD-SA-16:26.openssl
2016-09-23 07:48:34 +00:00
Xin LI ad95f32fa8 Fix bspatch heap overflow vulnerability. [SA-16:25]
Fix freebsd-update(8) support of FreeBSD 11.0 release
distribution. [EN-16:09]

Approved by:	so
2016-07-25 15:04:17 +00:00
Xin LI 67df32044e Fix multiple ntp vulnerabilities.
Security:	FreeBSD-SA-16:24.ntp
Approved by:	so
2016-06-04 05:46:52 +00:00
Gleb Smirnoff 6a50ad79cf Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]

Security:	SA-16:20
Security:	SA-16:21
Approved by:	so
2016-05-31 16:55:37 +00:00
Gleb Smirnoff 66fbe91e01 Merge r300363 by mm@:
Backport security fix for absolute path traversal vulnerability in bsdcpio.

Security:       CVE-2015-2304
Security:       SA-16:22
Approved by:	so
2016-05-31 16:23:56 +00:00
Gleb Smirnoff f7883cce14 - Use unsigned version of min() when handling arguments of SETFKEY ioctl.
- Validate that user supplied control message length in sendmsg(2)
  is not negative.

Security:	SA-16:18
Security:	CVE-2016-1886
Security:	SA-16:19
Security:	CVE-2016-1887
Submitted by:	C Turt <cturt hardenedbsd.org>
Approved by:	so
2016-05-17 22:28:36 +00:00
Xin LI 03a95b12f3 Fix multiple OpenSSL vulnerabilitites. [SA-16:17]
Fix memory leak in ZFS. [EN-16:08]

Approved by:	so
2016-05-04 15:27:09 +00:00
Xin LI 5399f0d753 Fix ntp multiple vulnerabilities.
Approved by:	so
2016-04-29 08:02:31 +00:00
Gleb Smirnoff 67072943b9 o Fix OpenSSH xauth(1) command injection. [SA-16:14]
o Fix incorrect argument validation in sysarch(2). [SA-16:15]

Security:       FreeBSD-SA-16:14.openssh-xauth, CVE-2016-3115
Security:       FreeBSD-SA-16:15.sysarch, CVE-2016-1885
Approved by:    so
2016-03-16 22:30:03 +00:00
Xin LI 0ee1827916 Fix multiple vulnerabilities of BIND. [SA-16:13]
Fix a regression with OpenSSL patch. [SA-16:12]

Approved by:	so
2016-03-10 10:03:28 +00:00
Xin LI 7ebda18cb2 Fix multiple OpenSSL vulnerabilities.
Security:	FreeBSD-SA-16:12.openssl
Approved by:	so
2016-03-07 16:22:11 +00:00
Xin LI 07528f6e24 Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability.
Security:	CVE-2015-3197
Security:	FreeBSD-SA-16:11.openssl
Approved by:	so
2016-01-30 06:12:03 +00:00
Xin LI b904cda23e Fix BIND remote denial of service vulnerability. [SA-16:08]
Fix multiple vulnerabilities of ntp. [SA-16:09]

Fix Linux compatibility layer issetugid(2) system call
vulnerability. [SA-16:10]

Security:	FreeBSD-SA-16:08.bind
Security:	FreeBSD-SA-16:09.ntp
Security:	FreeBSD-SA-16:10.linux
Approved by:	so
2016-01-27 07:42:11 +00:00
Gleb Smirnoff 2c8d95a109 Fix OpenSSH client information leak.
Security:	SA-16:07.openssh
Security:	CVE-2016-0777
Approved by:	so
2016-01-14 22:53:07 +00:00
Gleb Smirnoff b6dd8ce45d o Fix invalid TCP checksums with pf(4). [EN-16:02.pf]
o Fix YP/NIS client library critical bug. [EN-16:03.yplib]
o Fix SCTP ICMPv6 error message vulnerability. [SA-16:01.sctp]
o Fix ntp panic threshold bypass vulnerability. [SA-16:02.ntp]
o Fix Linux compatibility layer incorrect futex handling. [SA-16:03.linux]
o Fix Linux compatibility layer setgroups(2) system call. [SA-16:04.linux]
o Fix TCP MD5 signature denial of service. [SA-16:05.tcp]
o Fix insecure default bsnmpd.conf permissions. [SA-16:06.bsnmpd]

Errata:		FreeBSD-EN-16:02.pf
Errata:		FreeBSD-EN-16:03.yplib
Security:	FreeBSD-SA-16:01.sctp, CVE-2016-1879
Security:	FreeBSD-SA-16:02.ntp, CVE-2015-5300
Security:	FreeBSD-SA-16:03.linux, CVE-2016-1880
Security:	FreeBSD-SA-16:04.linux, CVE-2016-1881
Security:	FreeBSD-SA-16:05.tcp, CVE-2016-1882
Security:	FreeBSD-SA-16:06.bsnmpd, CVE-2015-5677
Approved by:	so
2016-01-14 09:11:26 +00:00
Xin LI 8a77a62f4e Fix BIND remote denial of service vulnerability. [SA-15:27]
Security:	FreeBSD-SA-15:27.bind
Security:	CVE-2015-8000
Approved by:	so
2015-12-16 06:21:26 +00:00
Xin LI 7ba27652e5 Fix OpenSSL multiple vulnerabilities.
Security:	FreeBSD-SA-15:26.openssl
Approved by:	so
2015-12-05 09:53:58 +00:00
Gleb Smirnoff d2f49e812c o Fix regressions related to SA-15:25 upgrade of NTP. [1]
o Fix kqueue write events never fired for files greater 2GB. [2]
o Fix kpplications exiting due to segmentation violation on a correct
  memory address. [3]

PR:		204046 [1]
PR:		204203 [1]
Errata Notice:	FreeBSD-EN-15:19.kqueue [2]
Errata Notice:	FreeBSD-EN-15:20.vm [3]
Approved by:	so
2015-11-04 11:27:30 +00:00
Gleb Smirnoff 009e7aaa36 Upgrade NTP to 4.2.8p4.
Security:	FreeBSD-SA-15:25.ntp
Security:	CVE-2015-7871
Security:	CVE-2015-7855
Security:	CVE-2015-7854
Security:	CVE-2015-7853
Security:	CVE-2015-7852
Security:	CVE-2015-7851
Security:	CVE-2015-7850
Security:	CVE-2015-7849
Security:	CVE-2015-7848
Security:	CVE-2015-7701
Security:	CVE-2015-7703
Security:	CVE-2015-7704, CVE-2015-7705
Security:	CVE-2015-7691, CVE-2015-7692, CVE-2015-7702
Approved by:	so
2015-10-26 11:42:25 +00:00
Xin LI 9f2ff1c7f3 Fix a regression with SA-15:24 patch that prevented NIS from
working.

Approved by:	so
2015-10-02 16:37:06 +00:00
Xin LI 375f80570f The Sun RPC framework uses a netbuf structure to represent the
transport specific form of a universal transport address.  The
structure is expected to be opaque to consumers.  In the current
implementation, the structure contains a pointer to a buffer
that holds the actual address.

In rpcbind(8), netbuf structures are copied directly, which would
result in two netbuf structures that reference to one shared
address buffer.  When one of the two netbuf structures is freed,
access to the other netbuf structure would result in an undefined
result that may crash the rpcbind(8) daemon.

Fix this by making a copy of the buffer that is going to be freed
instead of doing a shallow copy.

Security:	FreeBSD-SA-15:24.rpcbind
Security:	CVE-2015-7236
Approved by:	so
2015-09-29 18:07:18 +00:00
Xin LI 33d4d1ebed Implement pubkey support for pkg(7) bootstrap. [EN-15:18]
Approved by:	so
2015-09-16 21:00:21 +00:00
Xin LI 8161c709ee Fix remote denial of service vulnerability when parsing malformed
key.

Security:	CVE-2015-5722
Security:	FreeBSD-SA-15:23.bind
Approved by:	so
2015-09-02 20:07:03 +00:00
Xin LI 0a4794072c Fix local privilege escalation in IRET handler. [SA-15:21]
Fix OpenSSH multiple vulnerabilities. [SA-15:22]

Fix insufficient check of unsupported pkg(7) signature methods.
[EN-15:15]

Approved by:	so
2015-08-25 20:49:05 +00:00
Xin LI 85d704f8b6 Fix multiple integer overflows in expat.
Security:	CVE-2015-1283
Security:	FreeBSD-SA-15:20.expat
Approved by:	so
2015-08-18 19:30:35 +00:00
Xin LI 4ca6726079 Fix routed remote denial of service vulnerability. [SA-15:19]
Approved by:	so
2015-08-05 22:05:24 +00:00
Xin LI fd0d21b4fd Fix resource exhaustion in TCP reassembly. [SA-15:15]
Fix OpenSSH multiple vulnerabilities. [SA-15:16]

Fix BIND remote denial of service vulnerability. [SA-15:17]

Approved by:	so
2015-07-28 19:59:22 +00:00
Xin LI cf5f0e1f96 Fix resource exhaustion due to sessions stuck in LAST_ACK state.
Security:	CVE-2015-5358
Security:	SA-15:13.tcp
Submitted by:	Jonathan Looney (Juniper SIRT)
Approved by:	so
2015-07-21 23:42:56 +00:00
Xin LI e86b89b34b Fix BIND resolver remote denial of service when validating.
Security:	CVE-2015-4620
Security:	FreeBSD-SA-15:11.bind
Approved by:	so
2015-07-07 21:44:01 +00:00
Xin LI bb2a154066 [EN-15:08] Revised: Improvements to sendmail TLS/DH interoperability.
[EN-15:09] Fix inconsistency between locale and rune locale states.

Approved by:	so
2015-06-30 23:21:48 +00:00
Xin LI 3cc4b903a1 Raise the default for sendmail client connections to 1024-bit DH
parameters to imporve TLS/DH interoperability with newer SSL/TLS
suite, notably OpenSSL after FreeBSD 10.1-RELEASE-p12 (FreeBSD-
SA-15:10.openssl).

This is MFC of r284436 (gshapiro), the original commit message
was:

===
The import of openssl to address the FreeBSD-SA-15:10.openssl security
advisory includes a change which rejects handshakes with DH parameters
below 768 bits.  sendmail releases prior to 8.15.2 (not yet released),
defaulted to a 512 bit DH parameter setting for client connections.
This commit chages that default to 1024 bits.  sendmail 8.15.2, when
released well use a default of 2048 bits.
===

Reported by:	Frank Seltzer
Errata Notice:	FreeBSD-EN-15:08.sendmail
Approved by:	so
2015-06-18 05:36:45 +00:00
Xin LI cc0676581f Fix OpenSSL multiple vulnerabilities.
Security:	FreeBSD-SA-15:10.openssl
Approved by:	so
2015-06-12 07:23:55 +00:00
Xin LI a2f2409ea1 Update base system file(1) to 5.22 to address multiple denial of
service issues. [EN-15:06]

Approved by:	so
2015-06-09 22:13:53 +00:00
Xin LI 51a4ba663a Fix bug with freebsd-update(8) that does not ensure the previous
upgrade was completed. [EN-15:04]

Approved by:	so
2015-05-13 22:52:51 +00:00
Xin LI b5c01884f4 Improve patch for SA-15:04.igmp to solve a potential buffer overflow.
Fix multiple vulnerabilities of ntp. [SA-15:07]

Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09]

Approved by:	so
2015-04-07 20:21:23 +00:00
Xin LI 2212159696 Fix issues with original SA-15:06.openssl commit:
- Revert a portion of ASN1 change per suggested by OpenBSD
   and OpenSSL developers.  The change was removed from the
   formal OpenSSL release and does not solve security issue.
 - Properly fix CVE-2015-0209 and CVE-2015-0288.

Approved by:	so
2015-03-20 07:12:02 +00:00
Xin LI f998a156a4 Fix multiple OpenSSL vulnerabilities.
Security:	FreeBSD-SA-15:06.openssl
Security:	CVE-2015-0209
Security:	CVE-2015-0286
Security:	CVE-2015-0287
Security:	CVE-2015-0288
Security:	CVE-2015-0289
Security:	CVE-2015-0293
Approved by:	so
2015-03-19 17:42:38 +00:00
Xin LI 8abcb78bc9 Fix multiple OpenSSL vulnerabilities.
Security:	FreeBSD-SA-15:06.openssl
Security:	CVE-2015-0209
Security:	CVE-2015-0286
Security:	CVE-2015-0287
Security:	CVE-2015-0288
Security:	CVE-2015-0289
Security:	CVE-2015-0293
Approved by:	so
2015-03-19 17:41:17 +00:00
Xin LI fec769336c Fix integer overflow in IGMP protocol. [SA-15:04]
Fix BIND remote denial of service vulnerability. [SA-15:05]

Fix vt(4) crash with improper ioctl parameters. [EN-15:01]

Updated base system OpenSSL to 0.9.8zd. [EN-15:02]

Fix freebsd-update libraries update ordering issue. [EN-15:03]

Approved by:	so
2015-02-25 05:56:54 +00:00
Xin LI fc751aec5c Fix SCTP SCTP_SS_VALUE kernel memory corruption and disclosure vulnerability
and SCTP stream reset vulnerability.

Security:	FreeBSD-SA-15:02.kmem
Security:	CVE-2014-8612
Security:	FreeBSD-SA-15:03.sctp
Security:	CVE-2014-8613
Approved by:	so
2015-01-27 19:37:02 +00:00
Xin LI f81b479042 Fix multiple vulnerabilities in OpenSSL. [SA-15:01]
Approved by:	so
2015-01-14 21:27:46 +00:00
Dag-Erling Smørgrav 85263293fa [SA-14:31] Fix multiple vulnerabilities in NTP suite.
[EN-14:13] Fix directory deletion issue in freebsd-update.

Approved by:	so
2014-12-23 22:54:25 +00:00
Xin LI a2e5f6ff73 Fix multiple vulnerabilities in file(1) and libmagic(3).
Security:	FreeBSD-SA-14:28.file
Security:	CVE-2014-3710, CVE-2014-8116, CVE-2014-8117

Fix BIND remote denial of service vulnerability.

Security:	FreeBSD-SA-14:29.bind
Security:	CVE-2014-8500

Approved by:	so
2014-12-10 08:36:40 +00:00
Dag-Erling Smørgrav 95694478db [SA-14:25] Fix kernel stack disclosure in setlogin(2) / getlogin(2).
[SA-14:26] Fix remote command execution in ftp(1).
[EN-14:12] Fix NFSv4 and ZFS cache consistency issue.

Approved by:	so (des)
2014-11-04 23:33:46 +00:00
Xin LI 99a93d59ba Time zone data file update. [EN-14:10]
Change crypt(3) default hashing algorithm back to DES. [EN-14:11]

Approved by:	so
2014-10-21 23:50:46 +00:00
Xin LI aa50020434 Fix rtsold(8) remote buffer overflow vulnerability. [SA-14:20]
Fix routed(8) remote denial of service vulnerability. [SA-14:21]

Fix memory leak in sandboxed namei lookup. [SA-14:22]

Fix OpenSSL multiple vulnerabilities. [SA-14:23]

Approved by:	so
2014-10-21 20:21:10 +00:00
Xin LI 6a60f8a617 Fix Denial of Service in TCP packet processing.
Security:	FreeBSD-SA-14:19.tcp
Approved by:	so
2014-09-16 09:50:19 +00:00
Xin LI 82807c7c73 Fix multiple OpenSSL vulnerabilities:
The receipt of a specifically crafted DTLS handshake message may cause OpenSSL
to consume large amounts of memory. [CVE-2014-3506]

The receipt of a specifically crafted DTLS packet could cause OpenSSL to leak
memory. [CVE-2014-3507]

A flaw in OBJ_obj2txt may cause pretty printing functions such as
X509_name_oneline, X509_name_print_ex et al. to leak some information from
the stack. [CVE-2014-3508]

OpenSSL DTLS clients enabling anonymous (EC)DH ciphersuites are subject to
a denial of service attack. [CVE-2014-3510]

Security:	CVE-2014-3506, CVE-2014-3507, CVE-2014-3508, CVE-2014-3510
Security:	FreeBSD-SA-14:18.openssl
Approved by:	so
2014-09-09 10:13:46 +00:00
Glen Barber 2318891ec4 Update releng/9.3 to -RELEASE in preparation of starting
9.3-RELEASE builds.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-10 21:53:54 +00:00
Glen Barber dc412b00b5 Set static abitag to the current value of __FreeBSD_version.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-10 21:52:31 +00:00
Glen Barber fd73ee09e9 Anticipate when we will announce 9.3-RELEASE.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-10 21:51:37 +00:00
Glen Barber 2fcc072881 Document FreeBSD-SA-14:17.kmem
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 22:54:11 +00:00
Xin LI 1121df919e Fix kernel memory disclosure in control message and SCTP notifications.
Security:	FreeBSD-SA-14:17.kmem
Security:	CVE-2014-3952, CVE-2014-3953
Approved by:	re (implicit)
2014-07-08 21:55:02 +00:00
Glen Barber 46dc671e90 Remove incorrect (for this branch) entry regarding r262124.
Submitted by:	José María Alcaide (via -stable@)
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 19:55:44 +00:00
Glen Barber 4517d526a2 Reorder the KDE4 entry so it does not follow how to continue
using old Xorg.

Requested by:	wblock
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 19:52:41 +00:00
Glen Barber 9a11dca784 Add a 'Ports and Packages' section to make note of
several items of importance regarding Xorg and KMS.

Submitted by:	wblock (original)
Reviewed by:	kms, wblock
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 19:44:32 +00:00
Glen Barber 9471e2aff3 In errata/article.xml, update the document will be maintained
until the EoL of the stable/9 branch.

In share/xml/release.xsl update the recommended mailing list
from -current to -stable.

In share/examples/Makefile.relnotesng, update the branch name
convention from CVS-style to SVN-style.

In installation/article.xml:
 - Use descriptive text for the synching.html and the
   makeworld.html pages to fix how the URLs are displayed.
 - Remove a reference to 7.x.
 - Change a reference from 8.2-RELEASE to 8.4-RELEASE.

In readme/article.xml:
 - Change the recommended mailing list from -current
   to -stable.
 - Replace send-pr(1) references to Bugzilla equivalents.
 - Note that send-pr(1) is a stub shell script now.
 - Use descriptive text in a link to fix the URL.

In share/xml/release.ent:
 - Update release.type from 'snapshot' to 'release.'
 - Set IGNORE on release.type.snapshot, and INCLUDE on
   release.type.release.
 - Update release.manpath.freebsd to 9.3-RELEASE.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 16:31:59 +00:00
Glen Barber 06fe5baafd Document r267911, send-pr(1) replaced with a stub instructing
to use the Bugzilla interface.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-08 16:21:21 +00:00
Glen Barber ff12590186 Switch releng/9.3 to -RC3 as part of the 9.3-RELEASE cycle.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-04 21:04:19 +00:00
Hans Petter Selasky 57eb02157d MFC r268221 and r268222:
- Remove some unused variables.
- Add proper rangechecks in "axge_rx_frame()" function and
fix receive loop header parsing.
- Add new USB IDs.

Approved by: 	re, gjb @
PR:		191432
2014-07-03 17:42:26 +00:00
Hajimu UMEMOTO 1b7f455aea MFS r268218 (MFC r267912, r267915):
- Exclude loopback address rather than loopback interface.
- style(9)

Spotted by:	melifaro
Approved by:	re (gjb)
2014-07-03 16:26:37 +00:00
Hans Petter Selasky e4ea187dcb MFC r268078 and r268080:
Fix for memory use after free() and mtx_destroy().

Approved by:	re, glebius @
2014-07-03 13:49:43 +00:00
Devin Teske 82fbce84cc MFS9 r268171 (MFC r267680):
Fix a code typo that prevented mkdir from firing (unnoticed usually
because another part of the code succeeded in making the same
directory).

Approved by:	re (gjb)
2014-07-02 19:53:51 +00:00
Hajimu UMEMOTO 58f4b53eca MFS r268053 (MFC r267800):
Exclude IPv4 address from doing longest match.
It prevented DNS based load balancing.

Approved by:	re (delphij)
2014-07-01 18:05:38 +00:00
Hajimu UMEMOTO c51853ba05 MFS r267876 (MFC r267616):
Retooling addrconfig() to exclude addresses on loopback interfaces
when looking for configured addresses.
This change is based upon the code from the submitter, and made
following changes:
- Exclude addresses assigned on interfaces which are down, like NetBSD
  does.
- Exclude addresses assigned on interfaces which are ifdisabled.

PR:		190824
Submitted by:	Justin McOmie
Approved by:	re (marius)
2014-07-01 17:31:47 +00:00
Glen Barber 732a9a3936 Fix typo: s/ata/ichsmb/
Wrap.

Submitted by:	mav
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-07-01 14:12:59 +00:00
Craig Rodrigues 5be21ecf7e MFC r267821:
Strict value checking will cause problem.
Bay trail DN2820FYKH is supported on Linux but does not work on FreeBSD.
This behaviour is bug-compatible with Linux-3.13.5.

References:
http://d.hatena.ne.jp/syuu1228/20140326
http://lxr.linux.no/linux+v3.13.5/arch/x86/kernel/acpi/boot.c#L1094

Submitted by: syuu
PR: 187966
Approved by: re (gjb)
2014-06-30 23:39:13 +00:00
Glen Barber ea2938fd97 Make reference to vt(4) a link now that the manual page is available.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-30 19:36:08 +00:00
Glen Barber 70027a7adc Prefix SA-14:16.file with 'FreeBSD-' for consistency with other SA
listings.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-30 19:33:04 +00:00
Xin LI 7de120e818 MFS r267944 (MFC r258941,267839):
Apply vendor improvements to oce(4) driver:

 - Add support to 20Gbps, 25Gbps, 40Gbps devices;
 - Add support to control adaptive interrupt coalescing (AIC)
   via sysctl;
 - Improve support of BE3 devices;
 - Big endian support fixes;

Many thanks to Emulex for their continued support of FreeBSD.

Submitted by:	Venkata Duvvuru <VenkatKumar.Duvvuru Emulex.Com>
Approved by:	re (gjb)
2014-06-30 16:16:35 +00:00
Marius Strobl 0025715929 MFC: r267967, r267968
- SC_NO_SYSMOUSE isn't currently supported by vt(4), so nuke it from vt.4.
- vt_vga(4) is a driver rather than a function so reference it accordingly.
- Uncomment HISTORY section given that vt(4) will first appear in 9.3.

Reviewed by:	emaste (modulo last part)
Approved by:	re (gjb)
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-06-30 12:20:25 +00:00
Glen Barber f24c4bfef1 Update releng/9.3 to -RC2 status as part of the 9.2-RELEASE
process.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-27 00:11:01 +00:00
Navdeep Parhar bea6412bff Merge r267757, which was MFC'd to stable/9 as r267882:
cxgbe(4): Update the bundled T4 and T5 firmwares to versions 1.11.27.0.

Approved by:	re (glebius)
Obtained from:	Chelsio
2014-06-26 17:58:29 +00:00
Gavin Atkinson 9b7559478f Merge r267738 from stable/9:
Remove send-pr and fix up all references to it.  Replace it with a
  stub send-pr directing people towards the web site.

Approved by:	re (gjb), bugmeister
2014-06-26 11:02:51 +00:00
Glen Barber c3f26ccfe5 MFS9 r267683 (dteske):
- Replace pkg-tools with pkgng
  - Fix cosmetic typos
  - Use `pkg -vv' to obtain ABI
  - Unbreak the installer
  - Remove the env(1) but keep the var
  - Remove an unused variable
  - Improve debugging with f_eval_catch()
  - Fix package installation from physical media such as DVD
  - Fix PKG_ABI detection after pkg-1.2
  - Fix failed attempt to send pkg(8) stderr to /dev/null
  - Export 'REPOS_DIR' when selected source medium is cdrom

Approved by:	re (glebius)
Sponsored by:	The FreeBSD Foundation
2014-06-26 03:27:12 +00:00
Glen Barber e5d4da4d0f MFS9 r267879:
Fix a bug in bsdgrep(1) where patterns are not correctly
  detected.

  Certain criteria must be met for this bug to show up:

   * the -w flag is specified, and
   * neither -o or --color are specified, and
   * the pattern is part of another word in the line, and
   * the other word that contains the pattern occurs first

PR:		181973
Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2014-06-25 19:22:40 +00:00
Marius Strobl 0489917303 MFC: r267145
Fix the keyfile being cleared prematurely after r259428 (MFCed to stable/9
in r266750).

PR:		185084
Submitted by:	[email protected]
Reviewed by:	pjd
Approved by:	re (glebius)
2014-06-25 10:27:17 +00:00
Glen Barber 896d2994bc Document FreeBSD-SA-14:16.file.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-25 00:33:30 +00:00
John Baldwin 2703fe37e0 MFC 253392:
Workaround some broken BIOSes that specify edge-sensitive but active-low
settings for ACPI-enumerated serial ports by forcing any IRQs that use
an ISA IRQ value with these settings to active-high instead of active-low.

This is known to occur with the BIOS on an Intel D2500CCE motherboard.

Approved by:	re (gjb)
2014-06-24 20:35:20 +00:00
Xin LI 43f2b8537b Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:16]

Security:	CVE-2013-7345, CVE-2014-1943, CVE-2014-2270
Security:	FreeBSD-SA-14:16.file
Approved by:	re (implicit)
2014-06-24 19:05:19 +00:00
Michael Tuexen 3acb8e70d3 MFC r267781:
Fix a bug in the setsockopt()-handling of the SCTP
specific option SCTP_PEER_ADDR_THLDS: Use the
provided address as intended.

MFC r267781:
Fix a bug which incorrectly allowed two listening SCTP sockets on
the same port bound to the wildcard address.

Approved by: re (gjb@)
2014-06-23 19:47:25 +00:00
Glen Barber 3318ba1c74 Packages for KDE4 will not immediately be available for
9.3-RELEASE, so include XFCE4 on the DVD in its place.

This is a direct commit to releng/9.3.

Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2014-06-23 19:37:11 +00:00
Glen Barber 1998538b2b Switch the DVD pkg(8) repository to 'release_3' now that
the 9.3-RELEASE package builds are complete.

This is a direct commit to releng/9.3.

Approved by:	re (marius)
Sponsored by:	The FreeBSD Foundation
2014-06-23 19:36:57 +00:00
Michael Tuexen 5e16ff578b MFC r267780:
Honor jails for unbound SCTP sockets when selecting source addresses,
reporting IP-addresses to the peer during the handshake, adding
addresses to the host, reporting the addresses via the sysctl
interface (used by netstat, for example) and reporting the
addresses to the application via socket options.
This issue was reported by Bernd Walter.

Approved by: re (glebius@)
2014-06-23 15:04:32 +00:00
Glen Barber a28ab21b40 Reword the compatibility note regarding earlier versions of
FreeBSD prior to 9.0.

Submitted by:	wblock
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-21 23:35:11 +00:00
Glen Barber 808faf4e3b Spell '14' correctly.
Submitted by:	delphij
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-21 01:11:59 +00:00
Navdeep Parhar 14e377ffe1 Merge r267600, which was MFC'd to stable/9 as r267695.
cxgbe(4):  Fix bug in the fast rx buffer recycle path.  In some cases rx
buffers were getting recycled when they should have been left alone.

Approved by:	re (gjb)
2014-06-21 01:05:46 +00:00
Glen Barber 7c4fc11753 Remove the '<?ignore ?>' surrounding the 9.3R installation
documentation.

Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-20 21:35:39 +00:00
Glen Barber 8ce5685daf Update __FreeBSD_version now that releng/9.3 is branched.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-20 00:18:25 +00:00
Glen Barber 5c3d876b2a Remove svn:mergeinfo carried over from stable/9.
Approved by:	re (implicit)
Sponsored by:	The FreeBSD Foundation
2014-06-20 00:13:56 +00:00
3749 changed files with 1047358 additions and 432408 deletions

No files matched your search

-1
View File
@@ -114,7 +114,6 @@ lib/libbluetooth emax Pre-commit review preferred.
lib/libsdp emax Pre-commit review preferred.
usr.bin/bluetooth emax Pre-commit review preferred.
usr.sbin/bluetooth emax Pre-commit review preferred.
gnu/usr.bin/send-pr bugmaster Pre-commit review requested.
*env(3) secteam Due to the problematic security history of this
code, please have patches reviewed by secteam.
share/zoneinfo edwin Heads-up appreciated, since our data is coming
+4
View File
@@ -38,6 +38,10 @@
# xargs -n1 | sort | uniq -d;
# done
# 20140614: send-pr removal
OLD_FILES+=usr/share/man/man1/send-pr.1.gz
OLD_FILES+=etc/gnats/freefall
OLD_DIRS+=etc/gnats
# 20140512: new clang import which bumps version from 3.4 to 3.4.1.
OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h
OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h
+343
View File
@@ -11,6 +11,349 @@ handbook:
Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running portupgrade.
20161222 p53 FreeBSD-SA-16:39.ntp
Fix multiple vulnerabilities of ntp.
20161208 p52 FreeBSD-SA-16:37.libc [revised]
Fix regressions introduced by SA-16:37.libc.
20161206 p51 FreeBSD-SA-16:36.telnetd
FreeBSD-SA-16:37.libc
FreeBSD-EN-16:19.tzcode
FreeBSD-EN-16:20.tzdata
Fix possible login(1) argument injection in telnetd(8). [SA-16:36]
Fix link_ntoa(3) buffer overflow in libc. [SA-16:37]
Fix warnings about valid time zone abbreviations. [EN-16:19]
Update timezone database information. [EN-16:20]
20161102 p50 FreeBSD-SA-16:34.bind
FreeBSD-SA-16:35.openssl
Fix BIND remote Denial of Service vulnerability. [SA-16:34]
Fix OpenSSL remote DoS vulnerability. [SA-16:35]
20161025 p49 FreeBSD-SA-16:15.sysarch [revised]
Fix incorrect argument validation in sysarch(2). [SA-16:15]
20161010 p48 FreeBSD-SA-16:28.bind
FreeBSD-SA-16:29.bspatch
FreeBSD-SA-16:30.portsnap
Fix BIND remote Denial of Service vulnerability. [SA-16:28]
Fix bspatch heap overflow vulnerability. [SA-16:29]
Fix multiple portsnap vulnerabilities. [SA-16:30]
20160926 p47 FreeBSD-SA-16:26.openssl [revised]
Fix OpenSSL regression introduced in SA-16:26.
20160923 p46 FreeBSD-SA-16:26.openssl
Fix multiple OpenSSL vulnerabilitites.
20160725 p45 FreeBSD-SA-16:25.bspatch
FreeBSD-EN-16:09.freebsd-update
Fix bspatch heap overflow vulnerability. [SA-16:25]
Fix freebsd-update(8) support of FreeBSD 11.0 release
distribution. [EN-16:09]
20160604 p44 FreeBSD-SA-16:24.ntp
Fix multiple vulnerabilities of ntp.
20160531 p43 FreeBSD-SA-16:20.linux
FreeBSD-SA-16:21.43bsd
FreeBSD-SA-16:22.libarchive
FreeBSD-SA-16:23.libarchive
Fix kernel stack disclosure in Linux compatibility layer. [SA-16:20]
Fix kernel stack disclosure in 4.3BSD compatibility layer. [SA-16:21]
Fix directory traversal in cpio(1). [SA-16:22]
Fix buffer overflow in libarchive(3). [SA-16:23]
20160517 p42 FreeBSD-SA-16:18.atkbd
Fix buffer overflow in keyboard driver. [SA-16:18]
20160504 p41 FreeBSD-SA-16:17.openssl
FreeBSD-EN-16:08.zfs
Fix multiple OpenSSL vulnerabilitites. [SA-16:17]
Fix memory leak in ZFS. [EN-16:08]
20160429 p40 FreeBSD-SA-16:16.ntp
Fix multiple vulnerabilities of ntp.
20160316 p39 FreeBSD-SA-16:14.openssh-xauth
FreeBSD-SA-16:15.sysarch
Fix OpenSSH xauth(1) command injection. [SA-16:14]
Fix incorrect argument validation in sysarch(2). [SA-16:15]
20160310 p38 FreeBSD-SA-16:13.bind
FreeBSD-SA-16:12.openssl [revised]
Fix multiple vulnerabilities of BIND. [SA-16:13]
Fix a regression with OpenSSL patch. [SA-16:12]
20160303 p37 FreeBSD-SA-16:12.openssl
Fix multiple vulnerabilities of OpenSSL.
20160130 p36 FreeBSD-SA-16:11.openssl
Fix OpenSSL SSLv2 ciphersuite downgrade vulnerability. [SA-16:11]
20160127 p35 FreeBSD-SA-16:08.bind
FreeBSD-SA-16:09.ntp
FreeBSD-SA-16:10.linux
Fix BIND remote denial of service vulnerability. [SA-16:08]
Fix multiple vulnerabilities of ntp. [SA-16:09]
Fix Linux compatibility layer issetugid(2) system call
vulnerability. [SA-16:10]
20160114 p34 FreeBSD-SA-16:07.openssh
Fix OpenSSH client information leak. [SA-16:07]
20160114 p33 FreeBSD-EN-16:02.pf
FreeBSD-EN-16:03.yplib
FreeBSD-SA-16:01.sctp
FreeBSD-SA-16:02.ntp
FreeBSD-SA-16:03.linux
FreeBSD-SA-16:04.linux
FreeBSD-SA-16:05.tcp
FreeBSD-SA-16:06.bsnmpd
Fix pf(4) generating bad TCP checksums. [EN-16:02]
Fix infinite loop in YP/NIS client library. [EN-16:03]
Fix remote denial of service in SCTP. [SA-16:01]
Update NTP to 4.2.8p5. [SA-16:02]
Fix kernel memory diclosure in Linux compatibility layer. [SA-16:03]
Fix kernel memory overwrite in Linux compatibility layer. [SA-16:04]
Fix crash in TCP MD5 signatures. [SA-16:05]
Fix insecure default permissions for snmpd.config. [SA-16:06]
20151216 p32 FreeBSD-SA-15:27.bind
Fix BIND remote denial of service vulnerability. [SA-15:27]
20151205 p31 FreeBSD-SA-15:26.openssl
Fix OpenSSL X509_ATTRIBUTE memory leak. [SA-15:26]
20151104 p30 FreeBSD-SA-15:25.ntp [revised]
FreeBSD-EN-15:19.kqueue
FreeBSD-EN-15:20.vm
Fix regression of ntpq(8) utility exiting due to trap 6 in
9.3-RELEASE-p29. [SA-15:25]
Fix regression in ntpd(8) lacking support for RAWDCF reference
clock in 9.3-RELEASE-p29. [SA-15:25]
Fix kqueue write events never fired for files greater 2GB. [EN-15:19]
Fix applications exiting due to segmentation violation on a correct
memory address. [EN-15:20]
20151026: p29 FreeBSD-SA-15:25.ntp
Fix multiple NTP vulnerabilities. New NTP version is 4.2.8p4.
The configuration file syntax has been changed, thus mergemaster
run is recommended. Now the "kod" parameter requires "limited"
parameter. If the ntp.conf is not updated, the ntpd will run
successfully, but with KoD disabled.
20151002: p28 FreeBSD-SA-15:24.rpcbind [revised]
Revised patch to address a regression that prevents NIS from working.
20150929: p27 FreeBSD-SA-15:24.rpcbind
Fix rpcbind(8) remote denial of service. [SA-15:24]
20150916: p26 FreeBSD-EN-15:18.pkg
Implement pubkey support for pkg(7) bootstrap. [EN-15:18]
20150902: p25 FreeBSD-SA-15:23.bind
Fix BIND remote denial of service vulnerability. [SA-15:23]
20150825: p24 FreeBSD-SA-15:21.amd64
FreeBSD-SA-15:22.openssh
FreeBSD-EN-15:15.pkg
Fix local privilege escalation in IRET handler. [SA-15:21]
Fix OpenSSH multiple vulnerabilities. [SA-15:22]
Fix insufficient check of unsupported pkg(7) signature methods.
[EN-15:15]
20150818: p23 FreeBSD-SA-15:20.expat
Fix multiple integer overflows in expat (libbsdxml) XML parser.
[SA-15:20]
20150805: p22 FreeBSD-SA-15:19.routed
Fix routed remote denial of service vulnerability.
20150728: p21 FreeBSD-SA-15:15.tcp
FreeBSD-SA-15:16.openssh
FreeBSD-SA-15:17.bind
Fix resource exhaustion in TCP reassembly. [SA-15:15]
Fix OpenSSH multiple vulnerabilities. [SA-15:16]
Fix BIND remote denial of service vulnerability. [SA-15:17]
20150721: p20 FreeBSD-SA-15:13.tcp
Fix resource exhaustion due to sessions stuck in LAST_ACK state.
[SA-15:13]
20150707: p19 FreeBSD-SA-15:11.bind
Fix BIND resolver remote denial of service when validating.
20150630: p18 FreeBSD-EN-15:08.sendmail [revised]
FreeBSD-EN-15:09.xlocale
Improvements to sendmail TLS/DH interoperability. [EN-15:08]
Fix inconsistency between locale and rune locale states.
[EN-15:09]
20150618: p17 FreeBSD-EN-15:08.sendmail
Improvements to sendmail TLS/DH interoperability. [EN-15:08]
20150612: p16 FreeBSD-SA-15:10.openssl
Fix multiple vulnerabilities in OpenSSL. [SA-15:10]
20150609: p15 FreeBSD-EN-15:06.file
Updated base system file(1) to 5.22 to address multiple denial
of service issues.
20150513: p14 FreeBSD-EN-15:04.freebsd-update
Fix bug with freebsd-update(8) that does not ensure the previous
upgrade was completed. [EN-15:04]
20150407: p13 FreeBSD-SA-15:04.igmp [revised]
FreeBSD-SA-15:07.ntp
FreeBSD-SA-15:09.ipv6
Improved patch for SA-15:04.igmp.
Fix multiple vulnerabilities of ntp. [SA-15:07]
Fix Denial of Service with IPv6 Router Advertisements. [SA-15:09]
20150320: p12
Fix patch for SA-15:06.openssl.
20150319: p11 FreeBSD-SA-15:06.openssl
Fix multiple vulnerabilities in OpenSSL. [SA-15:06]
20150225: p10 FreeBSD-SA-15:04.igmp
FreeBSD-SA-15:05.bind
FreeBSD-EN-15:01.vt
FreeBSD-EN-15:02.openssl
FreeBSD-EN-15:03.freebsd-update
Fix integer overflow in IGMP protocol. [SA-15:04]
Fix BIND remote denial of service vulnerability. [SA-15:05]
Fix vt(4) crash with improper ioctl parameters. [EN-15:01]
Updated base system OpenSSL to 0.9.8zd. [EN-15:02]
Fix freebsd-update libraries update ordering issue. [EN-15:03]
20150127: p9 FreeBSD-SA-15:02.kmem
FreeBSD-SA-15:03.sctp
Fix SCTP SCTP_SS_VALUE kernel memory corruption and disclosure
vulnerability. [SA-15:02]
Fix SCTP stream reset vulnerability. [SA-15:03]
20150114: p8 FreeBSD-SA-15:01.openssl
Fix multiple vulnerabilities in OpenSSL. [SA-15:01]
20141223: p7 FreeBSD-SA-14:31.ntp
FreeBSD-EN-14:13.freebsd-update
Fix multiple vulnerabilities in NTP suite. [SA-14:31]
Fix directory deletion issue in freebsd-update. [EN-14:13]
20141210: p6 FreeBSD-SA-14:28.file
FreeBSD-SA-14:29.bind
Fix multiple vulnerabilities in file(1) and libmagic(3).
[SA-14:28]
Fix BIND remote denial of service vulnerability. [SA-14:29]
20141104: p5 FreeBSD-SA-14:25.setlogin
FreeBSD-SA-14:26.ftp
FreeBSD-EN-14:12.zfs
Fix kernel stack disclosure in setlogin(2) / getlogin(2).
[SA-14:25]
Fix remote command execution in ftp(1). [SA-14:26]
Fix NFSv4 and ZFS cache consistency issue. [EN-14:12]
20141022: p4 FreeBSD-EN-14:10.tzdata
FreeBSD-EN-14:11.crypt
Time zone data file update. [EN-14:10]
Change crypt(3) default hashing algorithm back to DES. [EN-14:11]
20141021: p3 FreeBSD-SA-14:20.rtsold
FreeBSD-SA-14:21.routed
FreeBSD-SA-14:22.namei
FreeBSD-SA-14:23.openssl
Fix rtsold(8) remote buffer overflow vulnerability. [SA-14:20]
Fix routed(8) remote denial of service vulnerability. [SA-14:21]
Fix memory leak in sandboxed namei lookup. [SA-14:22]
Fix OpenSSL multiple vulnerabilities. [SA-14:23]
20140916: p2 FreeBSD-SA-14:19.tcp
Fix Denial of Service in TCP packet processing. [SA-14:19]
20140909: p1 FreeBSD-SA-14:18.openssl
Fix OpenSSL multiple vulnerabilities. [SA-14:18]
20140716:
9.3-RELEASE.
20140608:
On i386 and amd64 systems, the onifconsole flag is now set by default
in /etc/ttys for ttyu0. This causes ttyu0 to be automatically enabled
+11
View File
@@ -1,3 +1,14 @@
4006. [security] A flaw in delegation handling could be exploited
to put named into an infinite loop. This has
been addressed by placing limits on the number
of levels of recursion named will allow (default 7),
and the number of iterative queries that it will
send (default 50) before terminating a recursive
query (CVE-2014-8500).
The recursion depth limit is configured via the
"max-recursion-depth" option. [RT #35780]
--- 9.9.5 released ---
--- 9.9.5rc2 released ---
+1 -2
View File
@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: config.c,v 1.123 2012/01/06 23:46:41 tbox Exp $ */
/*! \file */
#include <config.h>
@@ -160,6 +158,7 @@ options {\n\
dnssec-accept-expired no;\n\
clients-per-query 10;\n\
max-clients-per-query 100;\n\
max-recursion-depth 7;\n\
zero-no-soa-ttl-cache no;\n\
nsec3-test-zone no;\n\
allow-new-zones no;\n\
+1 -1
View File
@@ -69,7 +69,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
#endif
data = isccc_alist_lookup(message, "_data");
if (data == NULL) {
if (!isccc_alist_alistp(data)) {
/*
* No data section.
*/
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008, 2011-2014 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2008, 2011-2014, 2016 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -396,7 +396,7 @@ control_recvmessage(isc_task_t *task, isc_event_t *event) {
* Limit exposure to replay attacks.
*/
_ctrl = isccc_alist_lookup(request, "_ctrl");
if (_ctrl == NULL) {
if (!isccc_alist_alistp(_ctrl)) {
log_invalid(&conn->ccmsg, ISC_R_FAILURE);
goto cleanup_request;
}
+3 -4
View File
@@ -3872,12 +3872,11 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qname,
peeraddr = &client->peeraddr;
else
peeraddr = NULL;
result = dns_resolver_createfetch2(client->view->resolver,
result = dns_resolver_createfetch3(client->view->resolver,
qname, qtype, qdomain, nameservers,
NULL, peeraddr, client->message->id,
client->query.fetchoptions,
client->task,
query_resume, client,
client->query.fetchoptions, 0,
client->task, query_resume, client,
rdataset, sigrdataset,
&client->query.fetch);
+5
View File
@@ -3141,6 +3141,11 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
cfg_obj_asuint32(obj),
max_clients_per_query);
obj = NULL;
result = ns_config_get(maps, "max-recursion-depth", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setmaxdepth(view->resolver, cfg_obj_asuint32(obj));
#ifdef ALLOW_FILTER_AAAA_ON_V4
obj = NULL;
result = ns_config_get(maps, "filter-aaaa-on-v4", &obj);
+4 -4
View File
@@ -252,8 +252,8 @@ rndc_recvdone(isc_task_t *task, isc_event_t *event) {
DO("parse message", isccc_cc_fromwire(&source, &response, &secret));
data = isccc_alist_lookup(response, "_data");
if (data == NULL)
fatal("no data section in response");
if (!isccc_alist_alistp(data))
fatal("bad or missing data section in response");
result = isccc_cc_lookupstring(data, "err", &errormsg);
if (result == ISC_R_SUCCESS) {
failed = ISC_TRUE;
@@ -316,8 +316,8 @@ rndc_recvnonce(isc_task_t *task, isc_event_t *event) {
DO("parse message", isccc_cc_fromwire(&source, &response, &secret));
_ctrl = isccc_alist_lookup(response, "_ctrl");
if (_ctrl == NULL)
fatal("_ctrl section missing");
if (!isccc_alist_alistp(_ctrl))
fatal("bad or missing ctrl section in response");
nonce = 0;
if (isccc_cc_lookupuint32(_ctrl, "_nonce", &nonce) != ISC_R_SUCCESS)
nonce = 0;
+41 -15
View File
@@ -201,6 +201,7 @@ struct dns_adbfetch {
unsigned int magic;
dns_fetch_t *fetch;
dns_rdataset_t rdataset;
unsigned int depth;
};
/*%
@@ -301,7 +302,7 @@ static inline void violate_locking_hierarchy(isc_mutex_t *, isc_mutex_t *);
static isc_boolean_t clean_namehooks(dns_adb_t *, dns_adbnamehooklist_t *);
static void clean_target(dns_adb_t *, dns_name_t *);
static void clean_finds_at_name(dns_adbname_t *, isc_eventtype_t,
unsigned int);
isc_uint32_t, unsigned int);
static isc_boolean_t check_expire_namehooks(dns_adbname_t *, isc_stdtime_t);
static isc_boolean_t check_expire_entry(dns_adb_t *, dns_adbentry_t **,
isc_stdtime_t);
@@ -309,7 +310,7 @@ static void cancel_fetches_at_name(dns_adbname_t *);
static isc_result_t dbfind_name(dns_adbname_t *, isc_stdtime_t,
dns_rdatatype_t);
static isc_result_t fetch_name(dns_adbname_t *, isc_boolean_t,
dns_rdatatype_t);
unsigned int, dns_rdatatype_t);
static inline void check_exit(dns_adb_t *);
static void destroy(dns_adb_t *);
static isc_boolean_t shutdown_names(dns_adb_t *);
@@ -982,7 +983,7 @@ kill_name(dns_adbname_t **n, isc_eventtype_t ev) {
* Clean up the name's various lists. These two are destructive
* in that they will always empty the list.
*/
clean_finds_at_name(name, ev, DNS_ADBFIND_ADDRESSMASK);
clean_finds_at_name(name, ev, 0, DNS_ADBFIND_ADDRESSMASK);
result4 = clean_namehooks(adb, &name->v4);
result6 = clean_namehooks(adb, &name->v6);
clean_target(adb, &name->target);
@@ -1407,7 +1408,7 @@ event_free(isc_event_t *event) {
*/
static void
clean_finds_at_name(dns_adbname_t *name, isc_eventtype_t evtype,
unsigned int addrs)
isc_uint32_t qtotal, unsigned int addrs)
{
isc_event_t *ev;
isc_task_t *task;
@@ -1467,6 +1468,7 @@ clean_finds_at_name(dns_adbname_t *name, isc_eventtype_t evtype,
ev->ev_sender = find;
find->result_v4 = find_err_map[name->fetch_err];
find->result_v6 = find_err_map[name->fetch6_err];
find->qtotal += qtotal;
ev->ev_type = evtype;
ev->ev_destroy = event_free;
ev->ev_destroy_arg = find;
@@ -1821,6 +1823,7 @@ new_adbfind(dns_adb_t *adb) {
h->flags = 0;
h->result_v4 = ISC_R_UNEXPECTED;
h->result_v6 = ISC_R_UNEXPECTED;
h->qtotal = 0;
ISC_LINK_INIT(h, publink);
ISC_LINK_INIT(h, plink);
ISC_LIST_INIT(h->list);
@@ -2769,6 +2772,19 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, dns_adbfind_t **findp)
{
return (dns_adb_createfind2(adb, task, action, arg, name,
qname, qtype, options, now,
target, port, 0, findp));
}
isc_result_t
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *qname,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, unsigned int depth,
dns_adbfind_t **findp)
{
dns_adbfind_t *find;
dns_adbname_t *adbname;
@@ -3000,7 +3016,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
* Start V4.
*/
if (WANT_INET(wanted_fetches) &&
fetch_name(adbname, start_at_zone,
fetch_name(adbname, start_at_zone, depth,
dns_rdatatype_a) == ISC_R_SUCCESS) {
DP(DEF_LEVEL,
"dns_adb_createfind: started A fetch for name %p",
@@ -3011,7 +3027,7 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
* Start V6.
*/
if (WANT_INET6(wanted_fetches) &&
fetch_name(adbname, start_at_zone,
fetch_name(adbname, start_at_zone, depth,
dns_rdatatype_aaaa) == ISC_R_SUCCESS) {
DP(DEF_LEVEL,
"dns_adb_createfind: "
@@ -3627,6 +3643,7 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
isc_result_t result;
unsigned int address_type;
isc_boolean_t want_check_exit = ISC_FALSE;
isc_uint32_t qtotal = 0;
UNUSED(task);
@@ -3637,6 +3654,8 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
adb = name->adb;
INSIST(DNS_ADB_VALID(adb));
qtotal = dev->qtotal;
bucket = name->lock_bucket;
LOCK(&adb->namelocks[bucket]);
@@ -3754,6 +3773,12 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
DP(DEF_LEVEL, "adb: fetch of '%s' %s failed: %s",
buf, address_type == DNS_ADBFIND_INET ? "A" : "AAAA",
dns_result_totext(dev->result));
/*
* Don't record a failure unless this is the initial
* fetch of a chain.
*/
if (fetch->depth > 1)
goto out;
/* XXXMLG Don't pound on bad servers. */
if (address_type == DNS_ADBFIND_INET) {
name->expire_v4 = ISC_MIN(name->expire_v4, now + 300);
@@ -3785,15 +3810,14 @@ fetch_callback(isc_task_t *task, isc_event_t *ev) {
free_adbfetch(adb, &fetch);
isc_event_free(&ev);
clean_finds_at_name(name, ev_status, address_type);
clean_finds_at_name(name, ev_status, qtotal, address_type);
UNLOCK(&adb->namelocks[bucket]);
}
static isc_result_t
fetch_name(dns_adbname_t *adbname,
isc_boolean_t start_at_zone,
dns_rdatatype_t type)
fetch_name(dns_adbname_t *adbname, isc_boolean_t start_at_zone,
unsigned int depth, dns_rdatatype_t type)
{
isc_result_t result;
dns_adbfetch_t *fetch = NULL;
@@ -3838,12 +3862,14 @@ fetch_name(dns_adbname_t *adbname,
result = ISC_R_NOMEMORY;
goto cleanup;
}
fetch->depth = depth;
result = dns_resolver_createfetch(adb->view->resolver, &adbname->name,
type, name, nameservers, NULL,
options, adb->task, fetch_callback,
adbname, &fetch->rdataset, NULL,
&fetch->fetch);
result = dns_resolver_createfetch3(adb->view->resolver, &adbname->name,
type, name, nameservers, NULL,
NULL, 0, options, depth, adb->task,
fetch_callback, adbname,
&fetch->rdataset, NULL,
&fetch->fetch);
if (result != ISC_R_SUCCESS)
goto cleanup;
+21 -9
View File
@@ -76,7 +76,7 @@ hmacmd5_createctx(dst_key_t *key, dst_context_t *dctx) {
hmacmd5ctx = isc_mem_get(dctx->mctx, sizeof(isc_hmacmd5_t));
if (hmacmd5ctx == NULL)
return (ISC_R_NOMEMORY);
isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_SHA1_BLOCK_LENGTH);
isc_hmacmd5_init(hmacmd5ctx, hkey->key, ISC_MD5_BLOCK_LENGTH);
dctx->ctxdata.hmacmd5ctx = hmacmd5ctx;
return (ISC_R_SUCCESS);
}
@@ -139,7 +139,7 @@ hmacmd5_compare(const dst_key_t *key1, const dst_key_t *key2) {
else if (hkey1 == NULL || hkey2 == NULL)
return (ISC_FALSE);
if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_SHA1_BLOCK_LENGTH))
if (isc_safe_memcmp(hkey1->key, hkey2->key, ISC_MD5_BLOCK_LENGTH))
return (ISC_TRUE);
else
return (ISC_FALSE);
@@ -150,17 +150,17 @@ hmacmd5_generate(dst_key_t *key, int pseudorandom_ok, void (*callback)(int)) {
isc_buffer_t b;
isc_result_t ret;
unsigned int bytes;
unsigned char data[ISC_SHA1_BLOCK_LENGTH];
unsigned char data[ISC_MD5_BLOCK_LENGTH];
UNUSED(callback);
bytes = (key->key_size + 7) / 8;
if (bytes > ISC_SHA1_BLOCK_LENGTH) {
bytes = ISC_SHA1_BLOCK_LENGTH;
key->key_size = ISC_SHA1_BLOCK_LENGTH * 8;
if (bytes > ISC_MD5_BLOCK_LENGTH) {
bytes = ISC_MD5_BLOCK_LENGTH;
key->key_size = ISC_MD5_BLOCK_LENGTH * 8;
}
memset(data, 0, ISC_SHA1_BLOCK_LENGTH);
memset(data, 0, ISC_MD5_BLOCK_LENGTH);
ret = dst__entropy_getdata(data, bytes, ISC_TF(pseudorandom_ok != 0));
if (ret != ISC_R_SUCCESS)
@@ -169,7 +169,7 @@ hmacmd5_generate(dst_key_t *key, int pseudorandom_ok, void (*callback)(int)) {
isc_buffer_init(&b, data, bytes);
isc_buffer_add(&b, bytes);
ret = hmacmd5_fromdns(key, &b);
memset(data, 0, ISC_SHA1_BLOCK_LENGTH);
memset(data, 0, ISC_MD5_BLOCK_LENGTH);
return (ret);
}
@@ -223,7 +223,7 @@ hmacmd5_fromdns(dst_key_t *key, isc_buffer_t *data) {
memset(hkey->key, 0, sizeof(hkey->key));
if (r.length > ISC_SHA1_BLOCK_LENGTH) {
if (r.length > ISC_MD5_BLOCK_LENGTH) {
isc_md5_init(&md5ctx);
isc_md5_update(&md5ctx, r.base, r.length);
isc_md5_final(&md5ctx, hkey->key);
@@ -236,6 +236,8 @@ hmacmd5_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacmd5 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
@@ -512,6 +514,8 @@ hmacsha1_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacsha1 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
@@ -790,6 +794,8 @@ hmacsha224_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacsha224 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
@@ -1068,6 +1074,8 @@ hmacsha256_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacsha256 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
@@ -1346,6 +1354,8 @@ hmacsha384_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacsha384 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
@@ -1624,6 +1634,8 @@ hmacsha512_fromdns(dst_key_t *key, isc_buffer_t *data) {
key->key_size = keylen * 8;
key->keydata.hmacsha512 = hkey;
isc_buffer_forward(data, r.length);
return (ISC_R_SUCCESS);
}
+8
View File
@@ -118,6 +118,8 @@ struct dns_adbfind {
isc_result_t result_v6; /*%< RO: v6 result */
ISC_LINK(dns_adbfind_t) publink; /*%< RW: client use */
isc_uint32_t qtotal;
/* Private */
isc_mutex_t lock; /* locks all below */
in_port_t port;
@@ -334,6 +336,12 @@ dns_adb_createfind(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target,
in_port_t port, dns_adbfind_t **find);
isc_result_t
dns_adb_createfind2(dns_adb_t *adb, isc_task_t *task, isc_taskaction_t action,
void *arg, dns_name_t *name, dns_name_t *qname,
dns_rdatatype_t qtype, unsigned int options,
isc_stdtime_t now, dns_name_t *target, in_port_t port,
unsigned int depth, dns_adbfind_t **find);
/*%<
* Main interface for clients. The adb will look up the name given in
* "name" and will build up a list of found addresses, and perhaps start
+11 -2
View File
@@ -15,8 +15,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id$ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
@@ -211,6 +209,8 @@ struct dns_message {
unsigned int verify_attempted : 1;
unsigned int free_query : 1;
unsigned int free_saved : 1;
unsigned int tkey : 1;
unsigned int rdclass_set : 1;
unsigned int opt_reserved;
unsigned int sig_reserved;
@@ -1375,6 +1375,15 @@ dns_message_buildopt(dns_message_t *msg, dns_rdataset_t **opt,
* \li other.
*/
void
dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass);
/*%<
* Set the expected class of records in the response.
*
* Requires:
* \li msg be a valid message with parsing intent.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_MESSAGE_H */
@@ -82,6 +82,7 @@ typedef struct dns_fetchevent {
isc_sockaddr_t * client;
dns_messageid_t id;
isc_result_t vresult;
isc_uint32_t qtotal;
} dns_fetchevent_t;
/*
@@ -274,6 +275,18 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp);
isc_result_t
dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
dns_forwarders_t *forwarders,
isc_sockaddr_t *client, isc_uint16_t id,
unsigned int options, unsigned int depth,
isc_task_t *task,
isc_taskaction_t action, void *arg,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp);
/*%<
* Recurse to answer a question.
*
@@ -575,6 +588,18 @@ dns_resolver_printbadcache(dns_resolver_t *resolver, FILE *fp);
* \li resolver to be valid.
*/
void
dns_resolver_setmaxdepth(dns_resolver_t *resolver, unsigned int maxdepth);
unsigned int
dns_resolver_getmaxdepth(dns_resolver_t *resolver);
/*%
* Get and set how many NS indirections will be followed when looking for
* nameserver addresses.
*
* Requires:
* \li resolver to be valid.
*/
ISC_LANG_ENDDECLS
#endif /* DNS_RESOLVER_H */
+1
View File
@@ -69,6 +69,7 @@ typedef struct dst_context dst_context_t;
#define DST_ALG_HMACSHA256 163 /* XXXMPA */
#define DST_ALG_HMACSHA384 164 /* XXXMPA */
#define DST_ALG_HMACSHA512 165 /* XXXMPA */
#define DST_ALG_INDIRECT 252
#define DST_ALG_PRIVATE 254
#define DST_ALG_EXPAND 255
#define DST_MAX_ALGS 255
+71 -16
View File
@@ -436,6 +436,8 @@ msginit(dns_message_t *m) {
m->saved.base = NULL;
m->saved.length = 0;
m->free_saved = 0;
m->tkey = 0;
m->rdclass_set = 0;
m->querytsig = NULL;
}
@@ -1086,12 +1088,18 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
* If this class is different than the one we already read,
* this is an error.
*/
if (msg->state == DNS_SECTION_ANY) {
msg->state = DNS_SECTION_QUESTION;
if (msg->rdclass_set == 0) {
msg->rdclass = rdclass;
msg->rdclass_set = 1;
} else if (msg->rdclass != rdclass)
DO_FORMERR;
/*
* Is this a TKEY query?
*/
if (rdtype == dns_rdatatype_tkey)
msg->tkey = 1;
/*
* Can't ask the same question twice.
*/
@@ -1236,12 +1244,12 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
* If there was no question section, we may not yet have
* established a class. Do so now.
*/
if (msg->state == DNS_SECTION_ANY &&
if (msg->rdclass_set == 0 &&
rdtype != dns_rdatatype_opt && /* class is UDP SIZE */
rdtype != dns_rdatatype_tsig && /* class is ANY */
rdtype != dns_rdatatype_tkey) { /* class is undefined */
msg->rdclass = rdclass;
msg->state = DNS_SECTION_QUESTION;
msg->rdclass_set = 1;
}
/*
@@ -1251,13 +1259,23 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
if (msg->opcode != dns_opcode_update
&& rdtype != dns_rdatatype_tsig
&& rdtype != dns_rdatatype_opt
&& rdtype != dns_rdatatype_dnskey /* in a TKEY query */
&& rdtype != dns_rdatatype_key /* in a TKEY query */
&& rdtype != dns_rdatatype_sig /* SIG(0) */
&& rdtype != dns_rdatatype_tkey /* Win2000 TKEY */
&& msg->rdclass != dns_rdataclass_any
&& msg->rdclass != rdclass)
DO_FORMERR;
/*
* If this is not a TKEY query/response then the KEY
* record's class needs to match.
*/
if (msg->opcode != dns_opcode_update && !msg->tkey &&
rdtype == dns_rdatatype_key &&
msg->rdclass != dns_rdataclass_any &&
msg->rdclass != rdclass)
DO_FORMERR;
/*
* Special type handling for TSIG, OPT, and TKEY.
*/
@@ -1372,6 +1390,10 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
skip_name_search = ISC_TRUE;
skip_type_search = ISC_TRUE;
issigzero = ISC_TRUE;
} else {
if (msg->rdclass != dns_rdataclass_any &&
msg->rdclass != rdclass)
DO_FORMERR;
}
} else
covers = 0;
@@ -1610,6 +1632,7 @@ dns_message_parse(dns_message_t *msg, isc_buffer_t *source,
msg->counts[DNS_SECTION_ADDITIONAL] = isc_buffer_getuint16(source);
msg->header_ok = 1;
msg->state = DNS_SECTION_QUESTION;
/*
* -1 means no EDNS.
@@ -1713,7 +1736,7 @@ dns_message_renderbegin(dns_message_t *msg, dns_compress_t *cctx,
if (r.length < DNS_MESSAGE_HEADERLEN)
return (ISC_R_NOSPACE);
if (r.length < msg->reserved)
if (r.length - DNS_MESSAGE_HEADERLEN < msg->reserved)
return (ISC_R_NOSPACE);
/*
@@ -1840,8 +1863,29 @@ norender_rdataset(const dns_rdataset_t *rdataset, unsigned int options)
return (ISC_TRUE);
}
#endif
static isc_result_t
renderset(dns_rdataset_t *rdataset, dns_name_t *owner_name,
dns_compress_t *cctx, isc_buffer_t *target,
unsigned int reserved, unsigned int options, unsigned int *countp)
{
isc_result_t result;
/*
* Shrink the space in the buffer by the reserved amount.
*/
if (target->length - target->used < reserved)
return (ISC_R_NOSPACE);
target->length -= reserved;
result = dns_rdataset_towire(rdataset, owner_name,
cctx, target, options, countp);
target->length += reserved;
return (result);
}
isc_result_t
dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
unsigned int options)
@@ -1884,6 +1928,8 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
/*
* Shrink the space in the buffer by the reserved amount.
*/
if (msg->buffer->length - msg->buffer->used < msg->reserved)
return (ISC_R_NOSPACE);
msg->buffer->length -= msg->reserved;
total = 0;
@@ -2160,9 +2206,8 @@ dns_message_renderend(dns_message_t *msg) {
* Render.
*/
count = 0;
result = dns_rdataset_towire(msg->opt, dns_rootname,
msg->cctx, msg->buffer, 0,
&count);
result = renderset(msg->opt, dns_rootname, msg->cctx,
msg->buffer, msg->reserved, 0, &count);
msg->counts[DNS_SECTION_ADDITIONAL] += count;
if (result != ISC_R_SUCCESS)
return (result);
@@ -2178,9 +2223,8 @@ dns_message_renderend(dns_message_t *msg) {
if (result != ISC_R_SUCCESS)
return (result);
count = 0;
result = dns_rdataset_towire(msg->tsig, msg->tsigname,
msg->cctx, msg->buffer, 0,
&count);
result = renderset(msg->tsig, msg->tsigname, msg->cctx,
msg->buffer, msg->reserved, 0, &count);
msg->counts[DNS_SECTION_ADDITIONAL] += count;
if (result != ISC_R_SUCCESS)
return (result);
@@ -2201,9 +2245,8 @@ dns_message_renderend(dns_message_t *msg) {
* the owner name of a SIG(0) is irrelevant, and will not
* be set in a message being rendered.
*/
result = dns_rdataset_towire(msg->sig0, dns_rootname,
msg->cctx, msg->buffer, 0,
&count);
result = renderset(msg->sig0, dns_rootname, msg->cctx,
msg->buffer, msg->reserved, 0, &count);
msg->counts[DNS_SECTION_ADDITIONAL] += count;
if (result != ISC_R_SUCCESS)
return (result);
@@ -3550,3 +3593,15 @@ dns_message_buildopt(dns_message_t *message, dns_rdataset_t **rdatasetp,
dns_message_puttemprdatalist(message, &rdatalist);
return (result);
}
void
dns_message_setclass(dns_message_t *msg, dns_rdataclass_t rdclass) {
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTPARSE);
REQUIRE(msg->state == DNS_SECTION_ANY);
REQUIRE(msg->rdclass_set == 0);
msg->rdclass = rdclass;
msg->rdclass_set = 1;
}
+3 -6
View File
@@ -614,13 +614,11 @@ dns_ncache_getsigrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name,
dns_name_fromregion(&tname, &remaining);
INSIST(remaining.length >= tname.length);
isc_buffer_forward(&source, tname.length);
remaining.length -= tname.length;
remaining.base += tname.length;
isc_region_consume(&remaining, tname.length);
INSIST(remaining.length >= 2);
type = isc_buffer_getuint16(&source);
remaining.length -= 2;
remaining.base += 2;
isc_region_consume(&remaining, 2);
if (type != dns_rdatatype_rrsig ||
!dns_name_equal(&tname, name)) {
@@ -632,8 +630,7 @@ dns_ncache_getsigrdataset(dns_rdataset_t *ncacherdataset, dns_name_t *name,
INSIST(remaining.length >= 1);
trust = isc_buffer_getuint8(&source);
INSIST(trust <= dns_trust_ultimate);
remaining.length -= 1;
remaining.base += 1;
isc_region_consume(&remaining, 1);
raw = remaining.base;
count = raw[0] * 256 + raw[1];
+19 -16
View File
@@ -266,8 +266,10 @@ openssldh_destroy(dst_key_t *key) {
static void
uint16_toregion(isc_uint16_t val, isc_region_t *region) {
*region->base++ = (val & 0xff00) >> 8;
*region->base++ = (val & 0x00ff);
*region->base = (val & 0xff00) >> 8;
isc_region_consume(region, 1);
*region->base = (val & 0x00ff);
isc_region_consume(region, 1);
}
static isc_uint16_t
@@ -278,7 +280,8 @@ uint16_fromregion(isc_region_t *region) {
val = ((unsigned int)(cp[0])) << 8;
val |= ((unsigned int)(cp[1]));
region->base += 2;
isc_region_consume(region, 2);
return (val);
}
@@ -319,16 +322,16 @@ openssldh_todns(const dst_key_t *key, isc_buffer_t *data) {
}
else
BN_bn2bin(dh->p, r.base);
r.base += plen;
isc_region_consume(&r, plen);
uint16_toregion(glen, &r);
if (glen > 0)
BN_bn2bin(dh->g, r.base);
r.base += glen;
isc_region_consume(&r, glen);
uint16_toregion(publen, &r);
BN_bn2bin(dh->pub_key, r.base);
r.base += publen;
isc_region_consume(&r, publen);
isc_buffer_add(data, dnslen);
@@ -369,10 +372,12 @@ openssldh_fromdns(dst_key_t *key, isc_buffer_t *data) {
return (DST_R_INVALIDPUBLICKEY);
}
if (plen == 1 || plen == 2) {
if (plen == 1)
special = *r.base++;
else
if (plen == 1) {
special = *r.base;
isc_region_consume(&r, 1);
} else {
special = uint16_fromregion(&r);
}
switch (special) {
case 1:
dh->p = &bn768;
@@ -387,10 +392,9 @@ openssldh_fromdns(dst_key_t *key, isc_buffer_t *data) {
DH_free(dh);
return (DST_R_INVALIDPUBLICKEY);
}
}
else {
} else {
dh->p = BN_bin2bn(r.base, plen, NULL);
r.base += plen;
isc_region_consume(&r, plen);
}
/*
@@ -421,15 +425,14 @@ openssldh_fromdns(dst_key_t *key, isc_buffer_t *data) {
return (DST_R_INVALIDPUBLICKEY);
}
}
}
else {
} else {
if (glen == 0) {
DH_free(dh);
return (DST_R_INVALIDPUBLICKEY);
}
dh->g = BN_bin2bn(r.base, glen, NULL);
}
r.base += glen;
isc_region_consume(&r, glen);
if (r.length < 2) {
DH_free(dh);
@@ -441,7 +444,7 @@ openssldh_fromdns(dst_key_t *key, isc_buffer_t *data) {
return (DST_R_INVALIDPUBLICKEY);
}
dh->pub_key = BN_bin2bn(r.base, publen, NULL);
r.base += publen;
isc_region_consume(&r, publen);
key->key_size = BN_num_bits(dh->p);
+24 -16
View File
@@ -29,8 +29,6 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id$ */
#ifdef OPENSSL
#ifndef USE_EVP
#define USE_EVP 1
@@ -137,6 +135,7 @@ openssldsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
DSA *dsa = key->keydata.dsa;
isc_region_t r;
DSA_SIG *dsasig;
unsigned int klen;
#if USE_EVP
EVP_MD_CTX *evp_md_ctx = dctx->ctxdata.evp_md_ctx;
EVP_PKEY *pkey;
@@ -188,6 +187,7 @@ openssldsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
ISC_R_FAILURE));
}
free(sigbuf);
#elif 0
/* Only use EVP for the Digest */
if (!EVP_DigestFinal_ex(evp_md_ctx, digest, &siglen)) {
@@ -209,11 +209,17 @@ openssldsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
"DSA_do_sign",
DST_R_SIGNFAILURE));
#endif
*r.base++ = (key->key_size - 512)/64;
klen = (key->key_size - 512)/64;
if (klen > 255)
return (ISC_R_FAILURE);
*r.base = klen;
isc_region_consume(&r, 1);
BN_bn2bin_fixed(dsasig->r, r.base, ISC_SHA1_DIGESTLENGTH);
r.base += ISC_SHA1_DIGESTLENGTH;
isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH);
BN_bn2bin_fixed(dsasig->s, r.base, ISC_SHA1_DIGESTLENGTH);
r.base += ISC_SHA1_DIGESTLENGTH;
isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH);
DSA_SIG_free(dsasig);
isc_buffer_add(sig, ISC_SHA1_DIGESTLENGTH * 2 + 1);
@@ -446,15 +452,16 @@ openssldsa_todns(const dst_key_t *key, isc_buffer_t *data) {
if (r.length < (unsigned int) dnslen)
return (ISC_R_NOSPACE);
*r.base++ = t;
*r.base = t;
isc_region_consume(&r, 1);
BN_bn2bin_fixed(dsa->q, r.base, ISC_SHA1_DIGESTLENGTH);
r.base += ISC_SHA1_DIGESTLENGTH;
isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH);
BN_bn2bin_fixed(dsa->p, r.base, key->key_size/8);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
BN_bn2bin_fixed(dsa->g, r.base, key->key_size/8);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
BN_bn2bin_fixed(dsa->pub_key, r.base, key->key_size/8);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
isc_buffer_add(data, dnslen);
@@ -479,29 +486,30 @@ openssldsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
return (ISC_R_NOMEMORY);
dsa->flags &= ~DSA_FLAG_CACHE_MONT_P;
t = (unsigned int) *r.base++;
t = (unsigned int) *r.base;
isc_region_consume(&r, 1);
if (t > 8) {
DSA_free(dsa);
return (DST_R_INVALIDPUBLICKEY);
}
p_bytes = 64 + 8 * t;
if (r.length < 1 + ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) {
if (r.length < ISC_SHA1_DIGESTLENGTH + 3 * p_bytes) {
DSA_free(dsa);
return (DST_R_INVALIDPUBLICKEY);
}
dsa->q = BN_bin2bn(r.base, ISC_SHA1_DIGESTLENGTH, NULL);
r.base += ISC_SHA1_DIGESTLENGTH;
isc_region_consume(&r, ISC_SHA1_DIGESTLENGTH);
dsa->p = BN_bin2bn(r.base, p_bytes, NULL);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
dsa->g = BN_bin2bn(r.base, p_bytes, NULL);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
dsa->pub_key = BN_bin2bn(r.base, p_bytes, NULL);
r.base += p_bytes;
isc_region_consume(&r, p_bytes);
key->key_size = p_bytes * 8;
+2 -4
View File
@@ -14,8 +14,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id$ */
#include <config.h>
#ifdef HAVE_OPENSSL_ECDSA
@@ -159,9 +157,9 @@ opensslecdsa_sign(dst_context_t *dctx, isc_buffer_t *sig) {
"ECDSA_do_sign",
DST_R_SIGNFAILURE));
BN_bn2bin_fixed(ecdsasig->r, r.base, siglen / 2);
r.base += siglen / 2;
isc_region_consume(&r, siglen / 2);
BN_bn2bin_fixed(ecdsasig->s, r.base, siglen / 2);
r.base += siglen / 2;
isc_region_consume(&r, siglen / 2);
ECDSA_SIG_free(ecdsasig);
isc_buffer_add(sig, siglen);
ret = ISC_R_SUCCESS;
+10 -8
View File
@@ -965,6 +965,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
RSA *rsa;
isc_region_t r;
unsigned int e_bytes;
unsigned int length;
#if USE_EVP
EVP_PKEY *pkey;
#endif
@@ -972,6 +973,7 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
isc_buffer_remainingregion(data, &r);
if (r.length == 0)
return (ISC_R_SUCCESS);
length = r.length;
rsa = RSA_new();
if (rsa == NULL)
@@ -982,17 +984,18 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
RSA_free(rsa);
return (DST_R_INVALIDPUBLICKEY);
}
e_bytes = *r.base++;
r.length--;
e_bytes = *r.base;
isc_region_consume(&r, 1);
if (e_bytes == 0) {
if (r.length < 2) {
RSA_free(rsa);
return (DST_R_INVALIDPUBLICKEY);
}
e_bytes = ((*r.base++) << 8);
e_bytes += *r.base++;
r.length -= 2;
e_bytes = (*r.base) << 8;
isc_region_consume(&r, 1);
e_bytes += *r.base;
isc_region_consume(&r, 1);
}
if (r.length < e_bytes) {
@@ -1000,14 +1003,13 @@ opensslrsa_fromdns(dst_key_t *key, isc_buffer_t *data) {
return (DST_R_INVALIDPUBLICKEY);
}
rsa->e = BN_bin2bn(r.base, e_bytes, NULL);
r.base += e_bytes;
r.length -= e_bytes;
isc_region_consume(&r, e_bytes);
rsa->n = BN_bin2bn(r.base, r.length, NULL);
key->key_size = BN_num_bits(rsa->n);
isc_buffer_forward(data, r.length);
isc_buffer_forward(data, length);
#if USE_EVP
pkey = EVP_PKEY_new();
+2 -2
View File
@@ -116,7 +116,7 @@ totext_in_apl(ARGS_TOTEXT) {
isc_uint8_t len;
isc_boolean_t neg;
unsigned char buf[16];
char txt[sizeof(" !64000")];
char txt[sizeof(" !64000:")];
const char *sep = "";
int n;
@@ -140,7 +140,7 @@ totext_in_apl(ARGS_TOTEXT) {
isc_region_consume(&sr, 1);
INSIST(len <= sr.length);
n = snprintf(txt, sizeof(txt), "%s%s%u:", sep,
neg ? "!": "", afi);
neg ? "!" : "", afi);
INSIST(n < (int)sizeof(txt));
RETERR(str_totext(txt, target));
switch (afi) {
+238 -137
View File
@@ -131,6 +131,16 @@
#define MAXIMUM_QUERY_TIMEOUT 30 /* The maximum time in seconds for the whole query to live. */
#endif
/* The default maximum number of recursions to follow before giving up. */
#ifndef DEFAULT_RECURSION_DEPTH
#define DEFAULT_RECURSION_DEPTH 7
#endif
/* The default maximum number of iterative queries to allow before giving up. */
#ifndef DEFAULT_MAX_QUERIES
#define DEFAULT_MAX_QUERIES 50
#endif
/*%
* Maximum EDNS0 input packet size.
*/
@@ -297,6 +307,7 @@ struct fetchctx {
isc_uint64_t duration;
isc_boolean_t logged;
unsigned int querysent;
unsigned int totalqueries;
unsigned int referrals;
unsigned int lamecount;
unsigned int neterr;
@@ -307,6 +318,7 @@ struct fetchctx {
isc_boolean_t timeout;
dns_adbaddrinfo_t *addrinfo;
isc_sockaddr_t *client;
unsigned int depth;
};
#define FCTX_MAGIC ISC_MAGIC('F', '!', '!', '!')
@@ -418,6 +430,7 @@ struct dns_resolver {
isc_timer_t * spillattimer;
isc_boolean_t zero_no_soa_ttl;
unsigned int query_timeout;
unsigned int maxdepth;
/* Locked by lock. */
unsigned int references;
@@ -511,7 +524,9 @@ valcreate(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo, dns_name_t *name,
valarg->addrinfo = addrinfo;
if (!ISC_LIST_EMPTY(fctx->validators))
INSIST((valoptions & DNS_VALIDATOR_DEFER) != 0);
valoptions |= DNS_VALIDATOR_DEFER;
else
valoptions &= ~DNS_VALIDATOR_DEFER;
result = dns_validator_create(fctx->res->view, name, type, rdataset,
sigrdataset, fctx->rmessage,
@@ -1093,6 +1108,7 @@ fctx_sendevents(fetchctx_t *fctx, isc_result_t result, int line) {
event->result == DNS_R_NCACHENXRRSET);
}
event->qtotal = fctx->totalqueries;
isc_task_sendanddetach(&task, ISC_EVENT_PTR(&event));
count++;
}
@@ -1533,7 +1549,9 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
if (result != ISC_R_SUCCESS)
goto cleanup_dispatch;
}
fctx->querysent++;
fctx->totalqueries++;
ISC_LIST_APPEND(fctx->queries, query, link);
query->fctx->nqueries++;
@@ -2186,9 +2204,10 @@ fctx_finddone(isc_task_t *task, isc_event_t *event) {
*/
INSIST(!SHUTTINGDOWN(fctx));
fctx->attributes &= ~FCTX_ATTR_ADDRWAIT;
if (event->ev_type == DNS_EVENT_ADBMOREADDRESSES)
if (event->ev_type == DNS_EVENT_ADBMOREADDRESSES) {
want_try = ISC_TRUE;
else {
fctx->totalqueries += find->qtotal;
} else {
fctx->findfail++;
if (fctx->pending == 0) {
/*
@@ -2471,12 +2490,13 @@ findname(fetchctx_t *fctx, dns_name_t *name, in_port_t port,
* See what we know about this address.
*/
find = NULL;
result = dns_adb_createfind(fctx->adb,
res->buckets[fctx->bucketnum].task,
fctx_finddone, fctx, name,
&fctx->name, fctx->type,
options, now, NULL,
res->view->dstport, &find);
result = dns_adb_createfind2(fctx->adb,
res->buckets[fctx->bucketnum].task,
fctx_finddone, fctx, name,
&fctx->name, fctx->type,
options, now, NULL,
res->view->dstport,
fctx->depth + 1, &find);
if (result != ISC_R_SUCCESS) {
if (result == DNS_R_ALIAS) {
/*
@@ -2584,6 +2604,11 @@ fctx_getaddresses(fetchctx_t *fctx, isc_boolean_t badcache) {
res = fctx->res;
if (fctx->depth > res->maxdepth) {
FCTXTRACE("too much NS indirection");
return (DNS_R_SERVFAIL);
}
/*
* Forwarders.
*/
@@ -3022,6 +3047,9 @@ fctx_try(fetchctx_t *fctx, isc_boolean_t retrying, isc_boolean_t badcache) {
REQUIRE(!ADDRWAIT(fctx));
if (fctx->totalqueries > DEFAULT_MAX_QUERIES)
fctx_done(fctx, DNS_R_SERVFAIL, __LINE__);
addrinfo = fctx_nextaddress(fctx);
if (addrinfo == NULL) {
/*
@@ -3380,6 +3408,7 @@ fctx_start(isc_task_t *task, isc_event_t *event) {
* Normal fctx startup.
*/
fctx->state = fetchstate_active;
fctx->totalqueries = 0;
/*
* Reset the control event for later use in shutting down
* the fctx.
@@ -3449,6 +3478,7 @@ fctx_join(fetchctx_t *fctx, isc_task_t *task, isc_sockaddr_t *client,
event->fetch = fetch;
event->client = client;
event->id = id;
event->qtotal = 0;
dns_fixedname_init(&event->foundname);
/*
@@ -3485,7 +3515,8 @@ log_ns_ttl(fetchctx_t *fctx, const char *where) {
static isc_result_t
fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
unsigned int options, unsigned int bucketnum, fetchctx_t **fctxp)
unsigned int options, unsigned int bucketnum, unsigned int depth,
fetchctx_t **fctxp)
{
fetchctx_t *fctx;
isc_result_t result;
@@ -3537,6 +3568,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx->state = fetchstate_init;
fctx->want_shutdown = ISC_FALSE;
fctx->cloned = ISC_FALSE;
fctx->depth = depth;
ISC_LIST_INIT(fctx->queries);
ISC_LIST_INIT(fctx->finds);
ISC_LIST_INIT(fctx->altfinds);
@@ -3555,6 +3587,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
fctx->pending = 0;
fctx->restarts = 0;
fctx->querysent = 0;
fctx->totalqueries = 0;
fctx->referrals = 0;
TIME_NOW(&fctx->start);
fctx->timeouts = 0;
@@ -4818,13 +4851,6 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_adbaddrinfo_t *addrinfo,
rdataset,
sigrdataset,
valoptions, task);
/*
* Defer any further validations.
* This prevents multiple validators
* from manipulating fctx->rmessage
* simultaneously.
*/
valoptions |= DNS_VALIDATOR_DEFER;
}
} else if (CHAINING(rdataset)) {
if (rdataset->type == dns_rdatatype_cname)
@@ -4930,6 +4956,11 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_adbaddrinfo_t *addrinfo,
eresult == DNS_R_NCACHENXRRSET);
}
event->result = eresult;
if (adbp != NULL && *adbp != NULL) {
if (anodep != NULL && *anodep != NULL)
dns_db_detachnode(*adbp, anodep);
dns_db_detach(adbp);
}
dns_db_attach(fctx->cache, adbp);
dns_db_transfernode(fctx->cache, &node, anodep);
clone_results(fctx);
@@ -5177,6 +5208,11 @@ ncache_message(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
fctx->attributes |= FCTX_ATTR_HAVEANSWER;
if (event != NULL) {
event->result = eresult;
if (adbp != NULL && *adbp != NULL) {
if (anodep != NULL && *anodep != NULL)
dns_db_detachnode(*adbp, anodep);
dns_db_detach(adbp);
}
dns_db_attach(fctx->cache, adbp);
dns_db_transfernode(fctx->cache, &node, anodep);
clone_results(fctx);
@@ -5354,14 +5390,11 @@ cname_target(dns_rdataset_t *rdataset, dns_name_t *tname) {
}
static inline isc_result_t
dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
dns_name_t *oname, dns_fixedname_t *fixeddname)
dname_target(dns_rdataset_t *rdataset, dns_name_t *qname,
unsigned int nlabels, dns_fixedname_t *fixeddname)
{
isc_result_t result;
dns_rdata_t rdata = DNS_RDATA_INIT;
unsigned int nlabels;
int order;
dns_namereln_t namereln;
dns_rdata_dname_t dname;
dns_fixedname_t prefix;
@@ -5376,21 +5409,6 @@ dname_target(fetchctx_t *fctx, dns_rdataset_t *rdataset, dns_name_t *qname,
if (result != ISC_R_SUCCESS)
return (result);
/*
* Get the prefix of qname.
*/
namereln = dns_name_fullcompare(qname, oname, &order, &nlabels);
if (namereln != dns_namereln_subdomain) {
char qbuf[DNS_NAME_FORMATSIZE];
char obuf[DNS_NAME_FORMATSIZE];
dns_rdata_freestruct(&dname);
dns_name_format(qname, qbuf, sizeof(qbuf));
dns_name_format(oname, obuf, sizeof(obuf));
log_formerr(fctx, "unrelated DNAME in answer: "
"%s is not in %s", qbuf, obuf);
return (DNS_R_FORMERR);
}
dns_fixedname_init(&prefix);
dns_name_split(qname, nlabels, dns_fixedname_name(&prefix), NULL);
dns_fixedname_init(fixeddname);
@@ -6003,13 +6021,15 @@ static isc_result_t
answer_response(fetchctx_t *fctx) {
isc_result_t result;
dns_message_t *message;
dns_name_t *name, *qname, tname, *ns_name;
dns_name_t *name, *dname = NULL, *qname, *dqname, tname, *ns_name;
dns_name_t *cname = NULL;
dns_rdataset_t *rdataset, *ns_rdataset;
isc_boolean_t done, external, chaining, aa, found, want_chaining;
isc_boolean_t have_answer, found_cname, found_type, wanted_chaining;
isc_boolean_t have_answer, found_cname, found_dname, found_type;
isc_boolean_t wanted_chaining;
unsigned int aflag;
dns_rdatatype_t type;
dns_fixedname_t dname, fqname;
dns_fixedname_t fdname, fqname, fqdname;
dns_view_t *view;
FCTXTRACE("answer_response");
@@ -6023,6 +6043,7 @@ answer_response(fetchctx_t *fctx) {
done = ISC_FALSE;
found_cname = ISC_FALSE;
found_dname = ISC_FALSE;
found_type = ISC_FALSE;
chaining = ISC_FALSE;
have_answer = ISC_FALSE;
@@ -6032,15 +6053,23 @@ answer_response(fetchctx_t *fctx) {
aa = ISC_TRUE;
else
aa = ISC_FALSE;
qname = &fctx->name;
dqname = qname = &fctx->name;
type = fctx->type;
view = fctx->res->view;
dns_fixedname_init(&fqdname);
result = dns_message_firstname(message, DNS_SECTION_ANSWER);
while (!done && result == ISC_R_SUCCESS) {
dns_namereln_t namereln, dnamereln;
int order;
unsigned int nlabels;
name = NULL;
dns_message_currentname(message, DNS_SECTION_ANSWER, &name);
external = ISC_TF(!dns_name_issubdomain(name, &fctx->domain));
if (dns_name_equal(name, qname)) {
namereln = dns_name_fullcompare(qname, name, &order, &nlabels);
dnamereln = dns_name_fullcompare(dqname, name, &order,
&nlabels);
if (namereln == dns_namereln_equal) {
wanted_chaining = ISC_FALSE;
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
@@ -6134,7 +6163,7 @@ answer_response(fetchctx_t *fctx) {
}
} else if (rdataset->type == dns_rdatatype_rrsig
&& rdataset->covers ==
dns_rdatatype_cname
dns_rdatatype_cname
&& !found_type) {
/*
* We're looking for something else,
@@ -6164,11 +6193,19 @@ answer_response(fetchctx_t *fctx) {
* a CNAME or DNAME).
*/
INSIST(!external);
if (aflag ==
DNS_RDATASETATTR_ANSWER)
if ((rdataset->type !=
dns_rdatatype_cname) ||
!found_dname ||
(aflag ==
DNS_RDATASETATTR_ANSWER))
{
have_answer = ISC_TRUE;
name->attributes |=
DNS_NAMEATTR_ANSWER;
if (rdataset->type ==
dns_rdatatype_cname)
cname = name;
name->attributes |=
DNS_NAMEATTR_ANSWER;
}
rdataset->attributes |= aflag;
if (aa)
rdataset->trust =
@@ -6223,6 +6260,8 @@ answer_response(fetchctx_t *fctx) {
if (wanted_chaining)
chaining = ISC_TRUE;
} else {
dns_rdataset_t *dnameset = NULL;
/*
* Look for a DNAME (or its SIG). Anything else is
* ignored.
@@ -6230,32 +6269,56 @@ answer_response(fetchctx_t *fctx) {
wanted_chaining = ISC_FALSE;
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
isc_boolean_t found_dname = ISC_FALSE;
dns_name_t *dname_name;
rdataset = ISC_LIST_NEXT(rdataset, link))
{
/*
* Only pass DNAME or RRSIG(DNAME).
*/
if (rdataset->type != dns_rdatatype_dname &&
(rdataset->type != dns_rdatatype_rrsig ||
rdataset->covers != dns_rdatatype_dname))
continue;
/*
* If we're not chaining, then the DNAME and
* its signature should not be external.
*/
if (!chaining && external) {
char qbuf[DNS_NAME_FORMATSIZE];
char obuf[DNS_NAME_FORMATSIZE];
dns_name_format(name, qbuf,
sizeof(qbuf));
dns_name_format(&fctx->domain, obuf,
sizeof(obuf));
log_formerr(fctx, "external DNAME or "
"RRSIG covering DNAME "
"in answer: %s is "
"not in %s", qbuf, obuf);
return (DNS_R_FORMERR);
}
if (dnamereln != dns_namereln_subdomain) {
char qbuf[DNS_NAME_FORMATSIZE];
char obuf[DNS_NAME_FORMATSIZE];
dns_name_format(dqname, qbuf,
sizeof(qbuf));
dns_name_format(name, obuf,
sizeof(obuf));
log_formerr(fctx, "unrelated DNAME "
"in answer: %s is "
"not in %s", qbuf, obuf);
return (DNS_R_FORMERR);
}
found = ISC_FALSE;
aflag = 0;
if (rdataset->type == dns_rdatatype_dname) {
/*
* We're looking for something else,
* but we found a DNAME.
*
* If we're not chaining, then the
* DNAME should not be external.
*/
if (!chaining && external) {
log_formerr(fctx,
"external DNAME");
return (DNS_R_FORMERR);
}
found = ISC_TRUE;
want_chaining = ISC_TRUE;
POST(want_chaining);
aflag = DNS_RDATASETATTR_ANSWER;
result = dname_target(fctx, rdataset,
qname, name,
&dname);
result = dname_target(rdataset, dqname,
nlabels, &fdname);
if (result == ISC_R_NOSPACE) {
/*
* We can't construct the
@@ -6267,90 +6330,80 @@ answer_response(fetchctx_t *fctx) {
} else if (result != ISC_R_SUCCESS)
return (result);
else
found_dname = ISC_TRUE;
dnameset = rdataset;
dname_name = dns_fixedname_name(&dname);
dname = dns_fixedname_name(&fdname);
if (!is_answertarget_allowed(view,
qname,
rdataset->type,
dname_name,
&fctx->domain)) {
dqname, rdataset->type,
dname, &fctx->domain))
{
return (DNS_R_SERVFAIL);
}
} else if (rdataset->type == dns_rdatatype_rrsig
&& rdataset->covers ==
dns_rdatatype_dname) {
dqname = dns_fixedname_name(&fqdname);
dns_name_copy(dname, dqname, NULL);
} else {
/*
* We've found a signature that
* covers the DNAME.
*/
found = ISC_TRUE;
aflag = DNS_RDATASETATTR_ANSWERSIG;
}
if (found) {
/*
* We've found an answer to our
* question.
*/
name->attributes |= DNS_NAMEATTR_CACHE;
rdataset->attributes |= DNS_RDATASETATTR_CACHE;
rdataset->trust = dns_trust_answer;
if (!chaining) {
/*
* We've found an answer to our
* question.
* This data is "the" answer to
* our question only if we're
* not chaining.
*/
name->attributes |=
DNS_NAMEATTR_CACHE;
rdataset->attributes |=
DNS_RDATASETATTR_CACHE;
rdataset->trust = dns_trust_answer;
if (!chaining) {
/*
* This data is "the" answer
* to our question only if
* we're not chaining.
*/
INSIST(!external);
if (aflag ==
DNS_RDATASETATTR_ANSWER)
have_answer = ISC_TRUE;
INSIST(!external);
if (aflag == DNS_RDATASETATTR_ANSWER) {
have_answer = ISC_TRUE;
found_dname = ISC_TRUE;
if (cname != NULL)
cname->attributes &=
~DNS_NAMEATTR_ANSWER;
name->attributes |=
DNS_NAMEATTR_ANSWER;
rdataset->attributes |= aflag;
if (aa)
rdataset->trust =
dns_trust_authanswer;
} else if (external) {
rdataset->attributes |=
DNS_RDATASETATTR_EXTERNAL;
}
/*
* DNAME chaining.
*/
if (found_dname) {
/*
* Copy the dname into the
* qname fixed name.
*
* Although we check for
* failure of the copy
* operation, in practice it
* should never fail since
* we already know that the
* result fits in a fixedname.
*/
dns_fixedname_init(&fqname);
result = dns_name_copy(
dns_fixedname_name(&dname),
dns_fixedname_name(&fqname),
NULL);
if (result != ISC_R_SUCCESS)
return (result);
wanted_chaining = ISC_TRUE;
name->attributes |=
DNS_NAMEATTR_CHAINING;
rdataset->attributes |=
DNS_RDATASETATTR_CHAINING;
qname = dns_fixedname_name(
&fqname);
}
rdataset->attributes |= aflag;
if (aa)
rdataset->trust =
dns_trust_authanswer;
} else if (external) {
rdataset->attributes |=
DNS_RDATASETATTR_EXTERNAL;
}
}
/*
* DNAME chaining.
*/
if (dnameset != NULL) {
/*
* Copy the dname into the qname fixed name.
*
* Although we check for failure of the copy
* operation, in practice it should never fail
* since we already know that the result fits
* in a fixedname.
*/
dns_fixedname_init(&fqname);
qname = dns_fixedname_name(&fqname);
result = dns_name_copy(dname, qname, NULL);
if (result != ISC_R_SUCCESS)
return (result);
wanted_chaining = ISC_TRUE;
name->attributes |= DNS_NAMEATTR_CHAINING;
dnameset->attributes |=
DNS_RDATASETATTR_CHAINING;
}
if (wanted_chaining)
chaining = ISC_TRUE;
}
@@ -6910,6 +6963,8 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
goto done;
}
dns_message_setclass(message, fctx->res->rdclass);
result = dns_message_parse(message, &devent->buffer, 0);
if (result != ISC_R_SUCCESS) {
switch (result) {
@@ -6982,6 +7037,12 @@ resquery_response(isc_task_t *task, isc_event_t *event) {
*/
log_packet(message, ISC_LOG_DEBUG(10), fctx->res->mctx);
if (message->rdclass != fctx->res->rdclass) {
resend = ISC_TRUE;
FCTXTRACE("bad class");
goto done;
}
/*
* Process receive opt record.
*/
@@ -7731,6 +7792,7 @@ dns_resolver_create(dns_view_t *view,
res->spillattimer = NULL;
res->zero_no_soa_ttl = ISC_FALSE;
res->query_timeout = DEFAULT_QUERY_TIMEOUT;
res->maxdepth = DEFAULT_RECURSION_DEPTH;
res->nbuckets = ntasks;
res->activebuckets = ntasks;
res->buckets = isc_mem_get(view->mctx,
@@ -8169,9 +8231,9 @@ dns_resolver_createfetch(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
return (dns_resolver_createfetch2(res, name, type, domain,
return (dns_resolver_createfetch3(res, name, type, domain,
nameservers, forwarders, NULL, 0,
options, task, action, arg,
options, 0, task, action, arg,
rdataset, sigrdataset, fetchp));
}
@@ -8186,6 +8248,25 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
return (dns_resolver_createfetch3(res, name, type, domain,
nameservers, forwarders, client, id,
options, 0, task, action, arg,
rdataset, sigrdataset, fetchp));
}
isc_result_t
dns_resolver_createfetch3(dns_resolver_t *res, dns_name_t *name,
dns_rdatatype_t type,
dns_name_t *domain, dns_rdataset_t *nameservers,
dns_forwarders_t *forwarders,
isc_sockaddr_t *client, dns_messageid_t id,
unsigned int options, unsigned int depth,
isc_task_t *task,
isc_taskaction_t action, void *arg,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_fetch_t **fetchp)
{
dns_fetch_t *fetch;
fetchctx_t *fctx = NULL;
@@ -8273,11 +8354,12 @@ dns_resolver_createfetch2(dns_resolver_t *res, dns_name_t *name,
if (fctx == NULL) {
result = fctx_create(res, name, type, domain, nameservers,
options, bucketnum, &fctx);
options, bucketnum, depth, &fctx);
if (result != ISC_R_SUCCESS)
goto unlock;
new_fctx = ISC_TRUE;
}
} else if (fctx->depth > depth)
fctx->depth = depth;
result = fctx_join(fctx, task, client, id, action, arg,
rdataset, sigrdataset, fetch);
@@ -8885,6 +8967,12 @@ dns_resolver_algorithm_supported(dns_resolver_t *resolver, dns_name_t *name,
REQUIRE(VALID_RESOLVER(resolver));
/*
* DH is unsupported for DNSKEYs, see RFC 4034 sec. A.1.
*/
if ((alg == DST_ALG_DH) || (alg == DST_ALG_INDIRECT))
return (ISC_FALSE);
#if USE_ALGLOCK
RWLOCK(&resolver->alglock, isc_rwlocktype_read);
#endif
@@ -8904,6 +8992,7 @@ dns_resolver_algorithm_supported(dns_resolver_t *resolver, dns_name_t *name,
#endif
if (found)
return (ISC_FALSE);
return (dst_algorithm_supported(alg));
}
@@ -9049,3 +9138,15 @@ dns_resolver_settimeout(dns_resolver_t *resolver, unsigned int seconds) {
resolver->query_timeout = seconds;
}
void
dns_resolver_setmaxdepth(dns_resolver_t *resolver, unsigned int maxdepth) {
REQUIRE(VALID_RESOLVER(resolver));
resolver->maxdepth = maxdepth;
}
unsigned int
dns_resolver_getmaxdepth(dns_resolver_t *resolver) {
REQUIRE(VALID_RESOLVER(resolver));
return (resolver->maxdepth);
}
+1
View File
@@ -650,6 +650,7 @@ dns_tkey_processquery(dns_message_t *msg, dns_tkeyctx_t *tctx,
* Try the answer section, since that's where Win2000
* puts it.
*/
name = NULL;
if (dns_message_findname(msg, DNS_SECTION_ANSWER, qname,
dns_rdatatype_tkey, 0, &name,
&tkeyset) != ISC_R_SUCCESS) {
+1 -3
View File
@@ -1406,7 +1406,6 @@ compute_keytag(dns_rdata_t *rdata, dns_rdata_dnskey_t *key) {
*/
static isc_boolean_t
isselfsigned(dns_validator_t *val) {
dns_fixedname_t fixed;
dns_rdataset_t *rdataset, *sigrdataset;
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
@@ -1462,8 +1461,7 @@ isselfsigned(dns_validator_t *val) {
result = dns_dnssec_verify3(name, rdataset, dstkey,
ISC_TRUE,
val->view->maxbits,
mctx, &sigrdata,
dns_fixedname_name(&fixed));
mctx, &sigrdata, NULL);
dst_key_free(&dstkey);
if (result != ISC_R_SUCCESS)
continue;
+2
View File
@@ -1211,6 +1211,8 @@ xfrin_recv_done(isc_task_t *task, isc_event_t *ev) {
msg->tsigctx = xfr->tsigctx;
xfr->tsigctx = NULL;
dns_message_setclass(msg, xfr->rdclass);
if (xfr->nmsg > 0)
msg->tcp_continuation = 1;
+7 -1
View File
@@ -8496,6 +8496,12 @@ keyfetch_done(isc_task_t *task, isc_event_t *event) {
namebuf, tag);
trustkey = ISC_TRUE;
}
} else {
/*
* No previously known key, and the key is not
* secure, so skip it.
*/
continue;
}
/* Delete old version */
@@ -8544,7 +8550,7 @@ keyfetch_done(isc_task_t *task, isc_event_t *event) {
trust_key(zone, keyname, &dnskey, mctx);
}
if (!deletekey)
if (secure && !deletekey)
set_refreshkeytimer(zone, &keydata, now);
}
+7 -7
View File
@@ -287,10 +287,10 @@ verify(isccc_sexpr_t *alist, unsigned char *data, unsigned int length,
* Extract digest.
*/
_auth = isccc_alist_lookup(alist, "_auth");
if (_auth == NULL)
if (!isccc_alist_alistp(_auth))
return (ISC_R_FAILURE);
hmd5 = isccc_alist_lookup(_auth, "hmd5");
if (hmd5 == NULL)
if (!isccc_sexpr_binaryp(hmd5))
return (ISC_R_FAILURE);
/*
* Compute digest.
@@ -545,7 +545,7 @@ isccc_cc_createack(isccc_sexpr_t *message, isc_boolean_t ok,
REQUIRE(ackp != NULL && *ackp == NULL);
_ctrl = isccc_alist_lookup(message, "_ctrl");
if (_ctrl == NULL ||
if (!isccc_alist_alistp(_ctrl) ||
isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
isccc_cc_lookupuint32(_ctrl, "_tim", &t) != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
@@ -590,7 +590,7 @@ isccc_cc_isack(isccc_sexpr_t *message)
isccc_sexpr_t *_ctrl;
_ctrl = isccc_alist_lookup(message, "_ctrl");
if (_ctrl == NULL)
if (!isccc_alist_alistp(_ctrl))
return (ISC_FALSE);
if (isccc_cc_lookupstring(_ctrl, "_ack", NULL) == ISC_R_SUCCESS)
return (ISC_TRUE);
@@ -603,7 +603,7 @@ isccc_cc_isreply(isccc_sexpr_t *message)
isccc_sexpr_t *_ctrl;
_ctrl = isccc_alist_lookup(message, "_ctrl");
if (_ctrl == NULL)
if (!isccc_alist_alistp(_ctrl))
return (ISC_FALSE);
if (isccc_cc_lookupstring(_ctrl, "_rpl", NULL) == ISC_R_SUCCESS)
return (ISC_TRUE);
@@ -623,7 +623,7 @@ isccc_cc_createresponse(isccc_sexpr_t *message, isccc_time_t now,
_ctrl = isccc_alist_lookup(message, "_ctrl");
_data = isccc_alist_lookup(message, "_data");
if (_ctrl == NULL || _data == NULL ||
if (!isccc_alist_alistp(_ctrl) || !isccc_alist_alistp(_data) ||
isccc_cc_lookupuint32(_ctrl, "_ser", &serial) != ISC_R_SUCCESS ||
isccc_cc_lookupstring(_data, "type", &type) != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
@@ -812,7 +812,7 @@ isccc_cc_checkdup(isccc_symtab_t *symtab, isccc_sexpr_t *message,
isccc_sexpr_t *_ctrl;
_ctrl = isccc_alist_lookup(message, "_ctrl");
if (_ctrl == NULL ||
if (!isccc_alist_alistp(_ctrl) ||
isccc_cc_lookupstring(_ctrl, "_ser", &_ser) != ISC_R_SUCCESS ||
isccc_cc_lookupstring(_ctrl, "_tim", &_tim) != ISC_R_SUCCESS)
return (ISC_R_FAILURE);
+1
View File
@@ -1419,6 +1419,7 @@ view_clauses[] = {
{ "max-cache-ttl", &cfg_type_uint32, 0 },
{ "max-clients-per-query", &cfg_type_uint32, 0 },
{ "max-ncache-ttl", &cfg_type_uint32, 0 },
{ "max-recursion-depth", &cfg_type_uint32, 0 },
{ "max-udp-size", &cfg_type_uint32, 0 },
{ "min-roots", &cfg_type_uint32, CFG_CLAUSEFLAG_NOTIMP },
{ "minimal-responses", &cfg_type_boolean, 0 },
+21 -2
View File
@@ -1678,6 +1678,12 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
void * XMLCALL
XML_GetBuffer(XML_Parser parser, int len)
{
/* BEGIN MOZILLA CHANGE (sanity check len) */
if (len < 0) {
errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
/* END MOZILLA CHANGE */
switch (ps_parsing) {
case XML_SUSPENDED:
errorCode = XML_ERROR_SUSPENDED;
@@ -1689,8 +1695,13 @@ XML_GetBuffer(XML_Parser parser, int len)
}
if (len > bufferLim - bufferEnd) {
/* FIXME avoid integer overflow */
int neededSize = len + (int)(bufferEnd - bufferPtr);
/* BEGIN MOZILLA CHANGE (sanity check neededSize) */
if (neededSize < 0) {
errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
/* END MOZILLA CHANGE */
#ifdef XML_CONTEXT_BYTES
int keep = (int)(bufferPtr - buffer);
@@ -1719,7 +1730,15 @@ XML_GetBuffer(XML_Parser parser, int len)
bufferSize = INIT_BUFFER_SIZE;
do {
bufferSize *= 2;
} while (bufferSize < neededSize);
/* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */
} while (bufferSize < neededSize && bufferSize > 0);
/* END MOZILLA CHANGE */
/* BEGIN MOZILLA CHANGE (sanity check bufferSize) */
if (bufferSize <= 0) {
errorCode = XML_ERROR_NO_MEMORY;
return NULL;
}
/* END MOZILLA CHANGE */
newBuf = (char *)MALLOC(bufferSize);
if (newBuf == 0) {
errorCode = XML_ERROR_NO_MEMORY;
+339 -3
View File
@@ -1,3 +1,339 @@
2015-01-02 15:15 Christos Zoulas <[email protected]>
* release 5.22
2015-01-01 12:01 Christos Zoulas <[email protected]>
* add indirect relative for TIFF/Exif
2014-12-16 18:10 Christos Zoulas <[email protected]>
* restructure elf note printing to avoid repeated messages
* add note limit, suggested by Alexander Cherepanov
2014-12-16 16:53 Christos Zoulas <[email protected]>
* Bail out on partial pread()'s (Alexander Cherepanov)
* Fix incorrect bounds check in file_printable (Alexander Cherepanov)
2014-12-11 20:01 Christos Zoulas <[email protected]>
* PR/405: ignore SIGPIPE from uncompress programs
* change printable -> file_printable and use it in
more places for safety
* in ELF, instead of "(uses dynamic libraries)" when PT_INTERP
is present print the interpreter name.
2014-12-10 20:01 Christos Zoulas <[email protected]>
* release 5.21
2014-11-27 18:40 Christos Zoulas <[email protected]>
* Allow setting more parameters from the command line.
* Split name/use and indirect magic recursion limits.
2014-11-27 11:12 Christos Zoulas <[email protected]>
* Adjust ELF parameters and the default recursion
level.
* Allow setting the recursion level dynamically.
2014-11-24 8:55 Christos Zoulas <[email protected]>
* The following fixes resulted from Thomas Jarosch's fuzzing
tests that revealed severe performance issues on pathological
input:
- limit number of elf program and sections processing
- abort elf note processing quickly
- reduce the number of recursion levels from 20 to 10
- preserve error messages in indirect magic handling
This is tracked as CVE-2014-8116 and CVE-2014-8117
2014-11-12 10:30 Christos Zoulas <[email protected]>
* fix bogus free in the user buffer case.
2014-11-11 12:35 Christos Zoulas <[email protected]>
* fix out of bounds read for pascal strings
* fix memory leak (not freeing the head of each mlist)
2014-11-07 10:25 Christos Zoulas <[email protected]>
* When printing strings from a file, convert them to printable
on a byte by byte basis, so that we don't get issues with
locale's trying to interpret random byte streams as UTF-8 and
having printf error out with EILSEQ.
2014-10-17 11:48 Christos Zoulas <[email protected]>
* fix bounds in note reading (Francisco Alonso / Red Hat)
2014-10-11 15:02 Christos Zoulas <[email protected]>
* fix autoconf glue for setlocale and locale_t; some OS's
have locale_t in xlocale.h
2014-10-10 15:01 Christos Zoulas <[email protected]>
* release 5.20
2014-08-17 10:01 Christos Zoulas <[email protected]>
* recognize encrypted CDF documents
2014-08-04 9:18 Christos Zoulas <[email protected]>
* add magic_load_buffers from Brooks Davis
2014-07-24 16:40 Christos Zoulas <[email protected]>
* add thumbs.db support
2014-06-12 12:28 Christos Zoulas <[email protected]>
* release 5.19
2014-06-09 9:04 Christos Zoulas <[email protected]>
* Misc buffer overruns and missing buffer size tests in cdf parsing
(Francisco Alonso, Jan Kaluza)
2014-06-02 14:50 Christos Zoulas <[email protected]>
* Enforce limit of 8K on regex searches that have no limits
* Allow the l modifier for regex to mean line count. Default
to byte count. If line count is specified, assume a max
of 80 characters per line to limit the byte count.
* Don't allow conversions to be used for dates, allowing
the mask field to be used as an offset.
2014-05-30 12:51 Christos Zoulas <[email protected]>
* Make the range operator limit the length of the
regex search.
2014-05-14 19:23 Christos Zoulas <[email protected]>
* PR/347: Windows fixes
* PR/352: Hangul word processor recognition
* PR/354: Encoding irregularities in text files
2014-05-06 6:12 Christos Zoulas <[email protected]>
* Fix uninitialized title in CDF files (Jan Kaluza)
2014-05-04 14:55 Christos Zoulas <[email protected]>
* PR/351: Fix compilation of empty files
2014-04-30 17:39 Christos Zoulas <[email protected]>
* Fix integer formats: We don't specify 'l' or
'h' and 'hh' specifiers anymore, only 'll' for
quads and nothing for the rest. This is so that
magic writing is simpler.
2014-04-01 15:25 Christos Zoulas <[email protected]>
* PR/341: Jan Kaluza, fix memory leak
* PR/342: Jan Kaluza, fix out of bounds read
2014-03-28 15:25 Christos Zoulas <[email protected]>
* Fix issue with long formats not matching fmtcheck
2014-03-26 11:25 Christos Zoulas <[email protected]>
* release 5.18
2014-03-15 17:45 Christos Zoulas <[email protected]>
* add fmtcheck(3) for those who don't have it
2014-03-14 15:12 Christos Zoulas <[email protected]>
* prevent mime entries from being attached to magic
entries with no descriptions
* adjust magic strength for regex type
* remove superfluous ascmagic with encoding test
2014-03-06 12:01 Christos Zoulas <[email protected]>
* fix regression fix echo -ne "\012\013\014" | file -i -
which printed "binary" instead of "application/octet-stream"
* add size_t overflow check for magic file size
2014-02-27 16:01 Christos Zoulas <[email protected]>
* experimental support for matching with CFD CLSID
2014-02-18 13:04 Kimmo Suominen ([email protected])
* Cache old LC_CTYPE locale before setting it to "C", so
we can use it to restore LC_CTYPE instead of asking
setlocale() to scan the environment variables.
2014-02-12 18:21 Christos Zoulas <[email protected]>
* Count recursion levels through indirect magic
2014-02-11 10:40 Christos Zoulas <[email protected]>
* Prevent infinite recursion on files with indirect offsets of 0
2014-01-30 21:00 Christos Zoulas <[email protected]>
* Add -E flag that makes file print filesystem errors to stderr
and exit.
2014-01-08 17:20 Christos Zoulas <[email protected]>
* mime printing could print results from multiple magic entries
if there were multiple matches.
* in some cases overflow was not detected when computing offsets
in softmagic.
2013-12-05 12:00 Christos Zoulas <[email protected]>
* use strcasestr() to for cdf strings
* reset to the "C" locale while doing regex operations, or case
insensitive comparisons; this is provisional
2013-11-19 20:10 Christos Zoulas <[email protected]>
* always leave magic file loaded, don't unload for magic_check, etc.
* fix default encoding to binary instead of unknown which broke recently
* handle empty and one byte files, less specially so that
--mime-encoding does not break completely.
`
2013-11-06 14:40 Christos Zoulas <[email protected]>
* fix erroneous non-zero exit code from non-existant file and message
2013-10-29 14:25 Christos Zoulas <[email protected]>
* add CDF MSI file detection (Guy Helmer)
2013-09-03 11:56 Christos Zoulas <[email protected]>
* Don't mix errors and regular output if there was an error
* in magic_descriptor() don't close the file and try to restore
its position
2013-05-30 17:25 Christos Zoulas <[email protected]>
* Don't treat magic as an error if offset was past EOF (Christoph Biedl)
2013-05-28 17:25 Christos Zoulas <[email protected]>
* Fix spacing issues in softmagic and elf (Jan Kaluza)
2013-05-02 18:00 Christos Zoulas <[email protected]>
* Fix segmentation fault with multiple magic_load commands.
2013-04-22 11:20 Christos Zoulas <[email protected]>
* The way "default" was implemented was not very useful
because the "if something was printed at that level"
was not easily controlled by the user, and the format
was bound to a string which is too restrictive. Add
a "clear" for that level keyword and make "default"
void. This way one can do:
>>13 clear x
>>13 lelong 1 foo
>>13 lelong 2 bar
>>13 default x
>>>13 lelong x unknown %x
2013-03-25 13:20 Christos Zoulas <[email protected]>
* disallow strength setting in "name" entries
2013-03-06 21:24 Christos Zoulas <[email protected]>
* fix recursive magic separator printing
2013-02-26 19:28 Christos Zoulas <[email protected]>
* limit recursion level for mget
* fix pread() related breakage in cdf
* handle offsets properly in recursive "use"
2013-02-18 10:39 Christos Zoulas <[email protected]>
* add elf reading of debug info to determine if file is stripped
(Jan Kaluza)
* use pread()
2013-01-25 18:05 Christos Zoulas <[email protected]>
* change mime description size from 64 to 80 to accommodate OOXML.
2013-01-11 14:50 Christos Zoulas <[email protected]>
* Warn about inconsistent continuation levels.
* Change fsmagic to add a space after it prints.
2013-01-10 21:00 Christos Zoulas <[email protected]>
* Make getline public so that file can link against it.
Perhaps it is better to rename it, or hide it differently.
Fixes builds on platforms that do not provide it.
2013-01-07 16:30 Christos Zoulas <[email protected]>
* Add SuS d{,1,2,4,8}, u{,1,2,4,8} and document
what long, int, short, etc is (Guy Harris)
2013-01-06 11:20 Christos Zoulas <[email protected]>
* add magic_version function and constant
* Redo memory allocation and de-allocation.
(prevents double frees on non mmap platforms)
* Fix bug with name/use having to do with passing
found state from the parent to the child and back.
2012-12-19 8:47 Christos Zoulas <[email protected]>
* Only print elf capabilities for archs we know (Jan Kaluza)
2012-10-30 19:14 Christos Zoulas <[email protected]>
* Add "name" and "use" file types in order to look
inside mach-o files.
2012-09-06 10:40 Christos Zoulas <[email protected]>
* make --version exit 0 (Matthew Schultz)
* add string/T (Jan Kaluza)
2012-08-09 2:15 Christos Zoulas <[email protected]>
* add z and t modifiers for our own vasprintf
* search for $HOME/.magic.mgc if it is there first
* fix reads from a pipe, and preserve errno
2012-05-15 13:12 Christos Zoulas <[email protected]>
* use ctime_r, asctime_r
2012-04-06 17:18 Christos Zoulas <[email protected]>
* Fixes for indirect offsets to handle apple disk formats
2012-04-03 18:26 Christos Zoulas <[email protected]>
* Add windows date field types
* More info for windows shortcuts (incomplete)
2012-02-20 17:33 Christos Zoulas <[email protected]>
* Fix CDF parsing issues found by CERT's fuzzing tool (Will Dormann)
@@ -851,7 +1187,7 @@
* Identify gnu tar vs. posix tar
* When keep going, don't print spurious newlines (Radek Vokál)
* When keep going, don't print spurious newlines (Radek Vokal)
2006-04-01 12:02 Christos Zoulas <[email protected]>
@@ -875,7 +1211,7 @@
2005-10-31 8:54 Christos Zoulas <[email protected]>
* Fix regression where the core info was not completely processed
(Radek Vokál)
(Radek Vokal)
2005-10-20 11:15 Christos Zoulas <[email protected]>
@@ -892,7 +1228,7 @@
2005-09-20 13:33 Christos Zoulas <[email protected]>
* Don't print SVR4 Style in core files multiple times
(Radek Vokál)
(Radek Vokal)
2005-08-27 04:09 Christos Zoulas <[email protected]>
-14
View File
@@ -1,14 +0,0 @@
#------------------------------------------------------------------------------
# $File: assembler,v 1.1 2011/12/08 12:12:46 rrt Exp $
# make: file(1) magic for assembler source
#
0 regex \^\.asciiz\? assembler source text
!:mime text/x-asm
0 regex \^\.byte assembler source text
!:mime text/x-asm
0 regex \^\.even assembler source text
!:mime text/x-asm
0 regex \^\.globl assembler source text
!:mime text/x-asm
0 regex \^\.text assembler source text
!:mime text/x-asm
-40
View File
@@ -1,40 +0,0 @@
#------------------------------------------------------------------------------
# $File: cafebabe,v 1.8 2009/09/19 16:28:08 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O fat-files have the same magic number, the test
# must be performed in the same "magic" sequence to get both right. The long
# at offset 4 in a mach-O fat file tells the number of architectures; the short at
# offset 4 in a Java bytecode file is the JVM minor version and the
# short at offset 6 is the JVM major version. Since there are only
# only 18 labeled Mach-O architectures at current, and the first released
# Java class format was version 43.0, we can safely choose any number
# between 18 and 39 to test the number of architectures against
# (and use as a hack). Let's not use 18, because the Mach-O people
# might add another one or two as time goes by...
#
0 belong 0xcafebabe
!:mime application/x-java-applet
>4 belong >30 compiled Java class data,
>>6 beshort x version %d.
>>4 beshort x \b%d
# Which is which?
#>>4 belong 0x032d (Java 1.0)
#>>4 belong 0x032d (Java 1.1)
>>4 belong 0x002e (Java 1.2)
>>4 belong 0x002f (Java 1.3)
>>4 belong 0x0030 (Java 1.4)
>>4 belong 0x0031 (Java 1.5)
>>4 belong 0x0032 (Java 1.6)
0 belong 0xcafebabe
>4 belong 1 Mach-O fat file with 1 architecture
>4 belong >1
>>4 belong <20 Mach-O fat file with %ld architectures
0 belong 0xcafed00d JAR compressed with pack200,
>>5 byte x version %d.
>>4 byte x \b%d
!:mime application/x-java-pack200
-295
View File
@@ -1,295 +0,0 @@
#------------------------------------------------------------------------------
# $File: database,v 1.28 2011/09/16 19:40:40 christos Exp $
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford ([email protected])
#
#
# GDBM magic numbers
# Will be maintained as part of the GDBM distribution in the future.
# <[email protected]>
0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
!:mime application/x-gdbm
0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
!:mime application/x-gdbm
0 string GDBM GNU dbm 2.x database
!:mime application/x-gdbm
#
# Berkeley DB
#
# Ian Darwin's file /etc/magic files: big/little-endian version.
#
# Hash 1.85/1.86 databases store metadata in network byte order.
# Btree 1.85/1.86 databases store the metadata in host byte order.
# Hash and Btree 2.X and later databases store the metadata in host byte order.
0 long 0x00061561 Berkeley DB
!:mime application/x-dbm
>8 belong 4321
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, native byte-order)
>8 belong 1234
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, little-endian)
0 belong 0x00061561 Berkeley DB
>8 belong 4321
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, big-endian)
>8 belong 1234
>>4 belong >2 1.86
>>4 belong <3 1.85
>>4 belong >0 (Hash, version %d, native byte-order)
0 long 0x00053162 Berkeley DB 1.85/1.86
>4 long >0 (Btree, version %d, native byte-order)
0 belong 0x00053162 Berkeley DB 1.85/1.86
>4 belong >0 (Btree, version %d, big-endian)
0 lelong 0x00053162 Berkeley DB 1.85/1.86
>4 lelong >0 (Btree, version %d, little-endian)
12 long 0x00061561 Berkeley DB
>16 long >0 (Hash, version %d, native byte-order)
12 belong 0x00061561 Berkeley DB
>16 belong >0 (Hash, version %d, big-endian)
12 lelong 0x00061561 Berkeley DB
>16 lelong >0 (Hash, version %d, little-endian)
12 long 0x00053162 Berkeley DB
>16 long >0 (Btree, version %d, native byte-order)
12 belong 0x00053162 Berkeley DB
>16 belong >0 (Btree, version %d, big-endian)
12 lelong 0x00053162 Berkeley DB
>16 lelong >0 (Btree, version %d, little-endian)
12 long 0x00042253 Berkeley DB
>16 long >0 (Queue, version %d, native byte-order)
12 belong 0x00042253 Berkeley DB
>16 belong >0 (Queue, version %d, big-endian)
12 lelong 0x00042253 Berkeley DB
>16 lelong >0 (Queue, version %d, little-endian)
# From Max Bowsher.
12 long 0x00040988 Berkeley DB
>16 long >0 (Log, version %d, native byte-order)
12 belong 0x00040988 Berkeley DB
>16 belong >0 (Log, version %d, big-endian)
12 lelong 0x00040988 Berkeley DB
>16 lelong >0 (Log, version %d, little-endian)
#
#
# Round Robin Database Tool by Tobias Oetiker <[email protected]>
0 string RRD RRDTool DB
>4 string x version %s
#----------------------------------------------------------------------
# ROOT: file(1) magic for ROOT databases
#
0 string root\0 ROOT file
>4 belong x Version %d
>33 belong x (Compression: %d)
# XXX: Weak magic.
# Alex Ott <[email protected]>
## Paradox file formats
#2 leshort 0x0800 Paradox
#>0x39 byte 3 v. 3.0
#>0x39 byte 4 v. 3.5
#>0x39 byte 9 v. 4.x
#>0x39 byte 10 v. 5.x
#>0x39 byte 11 v. 5.x
#>0x39 byte 12 v. 7.x
#>>0x04 byte 0 indexed .DB data file
#>>0x04 byte 1 primary index .PX file
#>>0x04 byte 2 non-indexed .DB data file
#>>0x04 byte 3 non-incrementing secondary index .Xnn file
#>>0x04 byte 4 secondary index .Ynn file
#>>0x04 byte 5 incrementing secondary index .Xnn file
#>>0x04 byte 6 non-incrementing secondary index .XGn file
#>>0x04 byte 7 secondary index .YGn file
#>>>0x04 byte 8 incrementing secondary index .XGn file
## XBase database files
#0 byte 0x02
#>8 leshort >0
#>>12 leshort 0 FoxBase
#!:mime application/x-dbf
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x03
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x04
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASE IV no memo file
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x05
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASE V no memo file
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x30
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 Visual FoxPro
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x43
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FlagShip with memo var size
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x7b
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBASEIV with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x83
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxBase+, dBaseIII+ with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x8b
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBaseIV with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0x8e
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 dBaseIV with SQL Table
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0xb3
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FlagShip with .dbt memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 byte 0xf5
#!:mime application/x-dbf
#>8 leshort >0
#>>12 leshort 0 FoxPro with memo
#>>>0x04 lelong 0 (no records)
#>>>0x04 lelong >0 (%ld records)
#
#0 leshort 0x0006 DBase 3 index file
# MS Access database
4 string Standard\ Jet\ DB Microsoft Access Database
!:mime application/x-msaccess
# TDB database from Samba et al - Martin Pool <[email protected]>
0 string TDB\ file TDB database
>32 lelong 0x2601196D version 6, little-endian
>>36 lelong x hash size %d bytes
# SE Linux policy database
0 lelong 0xf97cff8c SE Linux policy
>16 lelong x v%d
>20 lelong 1 MLS
>24 lelong x %d symbols
>28 lelong x %d ocons
# ICE authority file data (Wolfram Kleff)
2 string ICE ICE authority data
# X11 Xauthority file (Wolfram Kleff)
10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
# From: Maxime Henrion <[email protected]>
# PostgreSQL's custom dump format, Maxime Henrion <[email protected]>
0 string PGDMP PostgreSQL custom database dump
>5 byte x - v%d
>6 byte x \b.%d
>5 beshort <0x101 \b-0
>5 beshort >0x100
>>7 byte x \b-%d
# Type: Advanced Data Format (ADF) database
# URL: http://www.grc.nasa.gov/WWW/cgns/adf/
# From: Nicolas Chauvat <[email protected]>
0 string @(#)ADF\ Database CGNS Advanced Data Format
# Tokyo Cabinet magic data
# http://tokyocabinet.sourceforge.net/index.html
0 string ToKyO\ CaBiNeT\n Tokyo Cabinet
>14 string x \b (%s)
>32 byte 0 \b, Hash
!:mime application/x-tokyocabinet-hash
>32 byte 1 \b, B+ tree
!:mime application/x-tokyocabinet-btree
>32 byte 2 \b, Fixed-length
!:mime application/x-tokyocabinet-fixed
>32 byte 3 \b, Table
!:mime application/x-tokyocabinet-table
>33 byte &1 \b, [open]
>33 byte &2 \b, [fatal]
>34 byte x \b, apow=%d
>35 byte x \b, fpow=%d
>36 byte &0x01 \b, [large]
>36 byte &0x02 \b, [deflate]
>36 byte &0x04 \b, [bzip]
>36 byte &0x08 \b, [tcbs]
>36 byte &0x10 \b, [excodec]
>40 lequad x \b, bnum=%lld
>48 lequad x \b, rnum=%lld
>56 lequad x \b, fsiz=%lld
# G-IR database made by gobject-introspect toolset,
# http://live.gnome.org/GObjectIntrospection
0 string GOBJ\nMETADATA\r\n\032 G-IR binary database
>16 byte x \b, v%d
>17 byte x \b.%d
>20 leshort x \b, %d entries
>22 leshort x \b/%d local
# Type: QDBM Quick Database Manager
# From: Benoit Sibaud <[email protected]>
0 string \\[depot\\]\n\f Quick Database Manager, little endian
0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian
# Type: TokyoCabinet database
# URL: http://tokyocabinet.sourceforge.net/
# From: Benoit Sibaud <[email protected]>
0 string ToKyO\ CaBiNeT\n TokyoCabinet database
>14 string x (version %s)
# From: Stéphane Blondon http://www.yaal.fr
# Database file for Zope (done by FileStorage)
0 string FS21 Zope Object Database File Storage (data)
# Cache file for the database of Zope (done by ClientStorage)
0 string ZEC3 Zope Object Database Client Cache File (data)
-60
View File
@@ -1,60 +0,0 @@
#------------------------------------------------------------------------------
# $File: dolby,v 1.5 2009/09/19 16:28:08 christos Exp $
# ATSC A/53 aka AC-3 aka Dolby Digital <[email protected]>
# from http://www.atsc.org/standards/a_52a.pdf
# corrections, additions, etc. are always welcome!
#
# syncword
0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream,
# fscod
>4 byte&0xc0 0x00 48 kHz,
>4 byte&0xc0 0x40 44.1 kHz,
>4 byte&0xc0 0x80 32 kHz,
# is this one used for 96 kHz?
>4 byte&0xc0 0xc0 reserved frequency,
#
>5 byte&7 = 0 \b, complete main (CM)
>5 byte&7 = 1 \b, music and effects (ME)
>5 byte&7 = 2 \b, visually impaired (VI)
>5 byte&7 = 3 \b, hearing impaired (HI)
>5 byte&7 = 4 \b, dialogue (D)
>5 byte&7 = 5 \b, commentary (C)
>5 byte&7 = 6 \b, emergency (E)
# acmod
>6 byte&0xe0 0x00 1+1 front,
>6 byte&0xe0 0x20 1 front/0 rear,
>6 byte&0xe0 0x40 2 front/0 rear,
>6 byte&0xe0 0x60 3 front/0 rear,
>6 byte&0xe0 0x80 2 front/1 rear,
>6 byte&0xe0 0xa0 3 front/1 rear,
>6 byte&0xe0 0xc0 2 front/2 rear,
>6 byte&0xe0 0xe0 3 front/2 rear,
# lfeon (these may be incorrect)
>7 byte&0x40 0x00 LFE off,
>7 byte&0x40 0x40 LFE on,
#
>4 byte&0x3e = 0x00 \b, 32 kbit/s
>4 byte&0x3e = 0x02 \b, 40 kbit/s
>4 byte&0x3e = 0x04 \b, 48 kbit/s
>4 byte&0x3e = 0x06 \b, 56 kbit/s
>4 byte&0x3e = 0x08 \b, 64 kbit/s
>4 byte&0x3e = 0x0a \b, 80 kbit/s
>4 byte&0x3e = 0x0c \b, 96 kbit/s
>4 byte&0x3e = 0x0e \b, 112 kbit/s
>4 byte&0x3e = 0x10 \b, 128 kbit/s
>4 byte&0x3e = 0x12 \b, 160 kbit/s
>4 byte&0x3e = 0x14 \b, 192 kbit/s
>4 byte&0x3e = 0x16 \b, 224 kbit/s
>4 byte&0x3e = 0x18 \b, 256 kbit/s
>4 byte&0x3e = 0x1a \b, 320 kbit/s
>4 byte&0x3e = 0x1c \b, 384 kbit/s
>4 byte&0x3e = 0x1e \b, 448 kbit/s
>4 byte&0x3e = 0x20 \b, 512 kbit/s
>4 byte&0x3e = 0x22 \b, 576 kbit/s
>4 byte&0x3e = 0x24 \b, 640 kbit/s
# dsurmod (these may be incorrect)
>6 beshort&0x0180 0x0000 Dolby Surround not indicated
>6 beshort&0x0180 0x0080 not Dolby Surround encoded
>6 beshort&0x0180 0x0100 Dolby Surround encoded
>6 beshort&0x0180 0x0180 reserved Dolby Surround mode
-46
View File
@@ -1,46 +0,0 @@
#------------------------------------------------------------------------------
# $File: dyadic,v 1.5 2010/09/20 18:55:20 rrt Exp $
# Dyadic: file(1) magic for Dyalog APL.
#
0 byte 0xaa
>1 byte <4 Dyalog APL
>>1 byte 0x00 incomplete workspace
>>1 byte 0x01 component file
>>1 byte 0x02 external variable
>>1 byte 0x03 workspace
>>2 byte x version %d
>>3 byte x .%d
0 beshort 0xaa03 Dyalog APL
>2 byte x workspace type %d
>3 byte x subtype %d
>7 byte&0x28 0x00 32-bit
>7 byte&0x28 0x20 64-bit
>7 byte&0x0c 0x00 classic
>7 byte&0x0c 0x04 unicode
>7 byte&0x88 0x00 big-endian
>7 byte&0x88 0x80 little-endian
0 byte 0xaa Dyalog APL
>1 byte 0x00 aplcore
>1 byte 0x01 component file 32-bit non-journaled non-checksummed
>1 byte 0x02 external variable exclusive
>1 byte 0x06 external variable shared
>1 byte 0x07 session
>1 byte 0x08 mapped file 32-bit
>1 byte 0x09 component file 64-bit non-journaled non-checksummed
>1 byte 0x0a mapped file 64-bit
>1 byte 0x0b component file 32-bit level 1 journaled non-checksummed
>1 byte 0x0c component file 64-bit level 1 journaled non-checksummed
>1 byte 0x0d component file 32-bit level 1 journaled checksummed
>1 byte 0x0e component file 64-bit level 1 journaled checksummed
>1 byte 0x0f component file 32-bit level 2 journaled checksummed
>1 byte 0x10 component file 64-bit level 2 journaled checksummed
>1 byte 0x11 component file 32-bit level 3 journaled checksummed
>1 byte 0x12 component file 64-bit level 3 journaled checksummed
>1 byte 0x13 component file 32-bit non-journaled checksummed
>1 byte 0x14 component file 64-bit non-journaled checksummed
>1 byte 0x80 DDB
0 short 0x6060 Dyalog APL transfer
-295
View File
@@ -1,295 +0,0 @@
#------------------------------------------------------------------------------
# $File: elf,v 1.54 2011/12/17 17:16:29 christos Exp $
# elf: file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
# other stuff in the header is in.
#
# What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
#
# Created by: unknown
# Modified by (1): Daniel Quinlan <[email protected]>
# Modified by (2): Peter Tobias <[email protected]> (core support)
# Modified by (3): Christian 'Dr. Disk' Hechelmann <[email protected]> (fix of core support)
# Modified by (4): <[email protected]> (VMS Itanium)
# Modified by (5): Matthias Urlichs <[email protected]> (Listing of many architectures)
0 string \177ELF ELF
>4 byte 0 invalid class
>4 byte 1 32-bit
>4 byte 2 64-bit
>5 byte 0 invalid byte order
>5 byte 1 LSB
>>16 leshort 0 no file type,
!:strength *2
!:mime application/octet-stream
>>16 leshort 1 relocatable,
!:mime application/x-object
>>16 leshort 2 executable,
!:mime application/x-executable
>>16 leshort 3 shared object,
!:mime application/x-sharedlib
>>16 leshort 4 core file
!:mime application/x-coredump
# Core file detection is not reliable.
#>>>(0x38+0xcc) string >\0 of '%s'
#>>>(0x38+0x10) lelong >0 (signal %d),
>>16 leshort &0xff00 processor-specific,
>>18 leshort 0 no machine,
>>18 leshort 1 AT&T WE32100 - invalid byte order,
>>18 leshort 2 SPARC - invalid byte order,
>>18 leshort 3 Intel 80386,
>>18 leshort 4 Motorola
>>>36 lelong &0x01000000 68000 - invalid byte order,
>>>36 lelong &0x00810000 CPU32 - invalid byte order,
>>>36 lelong 0 68020 - invalid byte order,
>>18 leshort 5 Motorola 88000 - invalid byte order,
>>18 leshort 6 Intel 80486,
>>18 leshort 7 Intel 80860,
# The official e_machine number for MIPS is now #8, regardless of endianness.
# The second number (#10) will be deprecated later. For now, we still
# say something if #10 is encountered, but only gory details for #8.
>>18 leshort 8 MIPS,
>>>36 lelong &0x20 N32
>>18 leshort 10 MIPS,
>>>36 lelong &0x20 N32
>>18 leshort 8
# only for 32-bit
>>>4 byte 1
>>>>36 lelong&0xf0000000 0x00000000 MIPS-I
>>>>36 lelong&0xf0000000 0x10000000 MIPS-II
>>>>36 lelong&0xf0000000 0x20000000 MIPS-III
>>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
>>>>36 lelong&0xf0000000 0x40000000 MIPS-V
>>>>36 lelong&0xf0000000 0x50000000 MIPS32
>>>>36 lelong&0xf0000000 0x60000000 MIPS64
>>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
>>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
>>>>48 lelong&0xf0000000 0x00000000 MIPS-I
>>>>48 lelong&0xf0000000 0x10000000 MIPS-II
>>>>48 lelong&0xf0000000 0x20000000 MIPS-III
>>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
>>>>48 lelong&0xf0000000 0x40000000 MIPS-V
>>>>48 lelong&0xf0000000 0x50000000 MIPS32
>>>>48 lelong&0xf0000000 0x60000000 MIPS64
>>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
>>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
>>18 leshort 9 Amdahl - invalid byte order,
>>18 leshort 10 MIPS (deprecated),
>>18 leshort 11 RS6000 - invalid byte order,
>>18 leshort 15 PA-RISC - invalid byte order,
>>>50 leshort 0x0214 2.0
>>>48 leshort &0x0008 (LP64),
>>18 leshort 16 nCUBE,
>>18 leshort 17 Fujitsu VPP500,
>>18 leshort 18 SPARC32PLUS - invalid byte order,
>>18 leshort 20 PowerPC,
>>18 leshort 22 IBM S/390,
>>18 leshort 36 NEC V800,
>>18 leshort 37 Fujitsu FR20,
>>18 leshort 38 TRW RH-32,
>>18 leshort 39 Motorola RCE,
>>18 leshort 40 ARM,
>>18 leshort 41 Alpha,
>>18 leshort 0xa390 IBM S/390 (obsolete),
>>18 leshort 42 Renesas SH,
>>18 leshort 43 SPARC V9 - invalid byte order,
>>18 leshort 44 Siemens Tricore Embedded Processor,
>>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>>18 leshort 46 Renesas H8/300,
>>18 leshort 47 Renesas H8/300H,
>>18 leshort 48 Renesas H8S,
>>18 leshort 49 Renesas H8/500,
>>18 leshort 50 IA-64,
>>18 leshort 51 Stanford MIPS-X,
>>18 leshort 52 Motorola Coldfire,
>>18 leshort 53 Motorola M68HC12,
>>18 leshort 54 Fujitsu MMA,
>>18 leshort 55 Siemens PCP,
>>18 leshort 56 Sony nCPU,
>>18 leshort 57 Denso NDR1,
>>18 leshort 58 Start*Core,
>>18 leshort 59 Toyota ME16,
>>18 leshort 60 ST100,
>>18 leshort 61 Tinyj emb.,
>>18 leshort 62 x86-64,
>>18 leshort 63 Sony DSP,
>>18 leshort 66 FX66,
>>18 leshort 67 ST9+ 8/16 bit,
>>18 leshort 68 ST7 8 bit,
>>18 leshort 69 MC68HC16,
>>18 leshort 70 MC68HC11,
>>18 leshort 71 MC68HC08,
>>18 leshort 72 MC68HC05,
>>18 leshort 73 SGI SVx,
>>18 leshort 74 ST19 8 bit,
>>18 leshort 75 Digital VAX,
>>18 leshort 76 Axis cris,
>>18 leshort 77 Infineon 32-bit embedded,
>>18 leshort 78 Element 14 64-bit DSP,
>>18 leshort 79 LSI Logic 16-bit DSP,
>>18 leshort 80 MMIX,
>>18 leshort 81 Harvard machine-independent,
>>18 leshort 82 SiTera Prism,
>>18 leshort 83 Atmel AVR 8-bit,
>>18 leshort 84 Fujitsu FR30,
>>18 leshort 85 Mitsubishi D10V,
>>18 leshort 86 Mitsubishi D30V,
>>18 leshort 87 NEC v850,
>>18 leshort 88 Renesas M32R,
>>18 leshort 89 Matsushita MN10300,
>>18 leshort 90 Matsushita MN10200,
>>18 leshort 91 picoJava,
>>18 leshort 92 OpenRISC,
>>18 leshort 93 ARC Cores Tangent-A5,
>>18 leshort 94 Tensilica Xtensa,
>>18 leshort 97 NatSemi 32k,
>>18 leshort 106 Analog Devices Blackfin,
>>18 leshort 113 Altera Nios II,
>>18 leshort 0xae META,
>>18 leshort 187 Tilera TILE64,
>>18 leshort 188 Tilera TILEPro,
>>18 leshort 191 Tilera TILE-Gx,
>>18 leshort 0x3426 OpenRISC (obsolete),
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 leshort 0x9026 Alpha (unofficial),
>>20 lelong 0 invalid version
>>20 lelong 1 version 1
>>36 lelong 1 MathCoPro/FPU/MAU Required
>5 byte 2 MSB
>>16 beshort 0 no file type,
!:mime application/octet-stream
>>16 beshort 1 relocatable,
!:mime application/x-object
>>16 beshort 2 executable,
!:mime application/x-executable
>>16 beshort 3 shared object,
!:mime application/x-sharedlib
>>16 beshort 4 core file,
!:mime application/x-coredump
#>>>(0x38+0xcc) string >\0 of '%s'
#>>>(0x38+0x10) belong >0 (signal %d),
>>16 beshort &0xff00 processor-specific,
>>18 beshort 0 no machine,
>>18 beshort 1 AT&T WE32100,
>>18 beshort 2 SPARC,
>>18 beshort 3 Intel 80386 - invalid byte order,
>>18 beshort 4 Motorola
>>>36 belong &0x01000000 68000,
>>>36 belong &0x00810000 CPU32,
>>>36 belong 0 68020,
>>18 beshort 5 Motorola 88000,
>>18 beshort 6 Intel 80486 - invalid byte order,
>>18 beshort 7 Intel 80860,
# only for MIPS - see comment in little-endian section above.
>>18 beshort 8 MIPS,
>>>36 belong &0x20 N32
>>18 beshort 10 MIPS,
>>>36 belong &0x20 N32
>>18 beshort 8
# only for 32-bit
>>>4 byte 1
>>>>36 belong&0xf0000000 0x00000000 MIPS-I
>>>>36 belong&0xf0000000 0x10000000 MIPS-II
>>>>36 belong&0xf0000000 0x20000000 MIPS-III
>>>>36 belong&0xf0000000 0x30000000 MIPS-IV
>>>>36 belong&0xf0000000 0x40000000 MIPS-V
>>>>36 belong&0xf0000000 0x50000000 MIPS32
>>>>36 belong&0xf0000000 0x60000000 MIPS64
>>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
>>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
# only for 64-bit
>>>4 byte 2
>>>>48 belong&0xf0000000 0x00000000 MIPS-I
>>>>48 belong&0xf0000000 0x10000000 MIPS-II
>>>>48 belong&0xf0000000 0x20000000 MIPS-III
>>>>48 belong&0xf0000000 0x30000000 MIPS-IV
>>>>48 belong&0xf0000000 0x40000000 MIPS-V
>>>>48 belong&0xf0000000 0x50000000 MIPS32
>>>>48 belong&0xf0000000 0x60000000 MIPS64
>>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
>>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
>>18 beshort 9 Amdahl,
>>18 beshort 10 MIPS (deprecated),
>>18 beshort 11 RS6000,
>>18 beshort 15 PA-RISC
>>>50 beshort 0x0214 2.0
>>>48 beshort &0x0008 (LP64)
>>18 beshort 16 nCUBE,
>>18 beshort 17 Fujitsu VPP500,
>>18 beshort 18 SPARC32PLUS,
>>>36 belong&0xffff00 0x000100 V8+ Required,
>>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>18 beshort 20 PowerPC or cisco 4500,
>>18 beshort 21 64-bit PowerPC or cisco 7500,
>>18 beshort 22 IBM S/390,
>>18 beshort 23 Cell SPU,
>>18 beshort 24 cisco SVIP,
>>18 beshort 25 cisco 7200,
>>18 beshort 36 NEC V800 or cisco 12000,
>>18 beshort 37 Fujitsu FR20,
>>18 beshort 38 TRW RH-32,
>>18 beshort 39 Motorola RCE,
>>18 beshort 40 ARM,
>>18 beshort 41 Alpha,
>>18 beshort 42 Renesas SH,
>>18 beshort 43 SPARC V9,
>>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>>48 belong&0x3 0 total store ordering,
>>>48 belong&0x3 1 partial store ordering,
>>>48 belong&0x3 2 relaxed memory ordering,
>>18 beshort 44 Siemens Tricore Embedded Processor,
>>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>>18 beshort 46 Renesas H8/300,
>>18 beshort 47 Renesas H8/300H,
>>18 beshort 48 Renesas H8S,
>>18 beshort 49 Renesas H8/500,
>>18 beshort 50 IA-64,
>>18 beshort 51 Stanford MIPS-X,
>>18 beshort 52 Motorola Coldfire,
>>18 beshort 53 Motorola M68HC12,
>>18 beshort 73 Cray NV1,
>>18 beshort 75 Digital VAX,
>>18 beshort 88 Renesas M32R,
>>18 leshort 92 OpenRISC,
>>18 leshort 0x3426 OpenRISC (obsolete),
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 beshort 94 Tensilica Xtensa,
>>18 beshort 97 NatSemi 32k,
>>18 beshort 187 Tilera TILE64,
>>18 beshort 188 Tilera TILEPro,
>>18 beshort 191 Tilera TILE-Gx,
>>18 beshort 0x18ad AVR32 (unofficial),
>>18 beshort 0x9026 Alpha (unofficial),
>>18 beshort 0xa390 IBM S/390 (obsolete),
>>20 belong 0 invalid version
>>20 belong 1 version 1
>>36 belong 1 MathCoPro/FPU/MAU Required
# Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
# like proper ELF, but extracting the string had bad results.
>4 byte <0x80
>>8 string >\0 (%s)
>8 string \0
>>7 byte 0 (SYSV)
>>7 byte 1 (HP-UX)
>>7 byte 2 (NetBSD)
>>7 byte 3 (GNU/Linux)
>>7 byte 4 (GNU/Hurd)
>>7 byte 5 (86Open)
>>7 byte 6 (Solaris)
>>7 byte 7 (Monterey)
>>7 byte 8 (IRIX)
>>7 byte 9 (FreeBSD)
>>7 byte 10 (Tru64)
>>7 byte 11 (Novell Modesto)
>>7 byte 12 (OpenBSD)
>8 string \2
>>7 byte 13 (OpenVMS)
>>7 byte 97 (ARM)
>>7 byte 255 (embedded)
File diff suppressed because it is too large. Load diff
-25
View File
@@ -1,25 +0,0 @@
#------------------------------------------------------------------------------
# $File: flash,v 1.9 2009/11/08 01:30:01 christos Exp $
# flash: file(1) magic for Macromedia Flash file format
#
# See
#
# http://www.macromedia.com/software/flash/open/
#
0 string FWS Macromedia Flash data,
>3 byte x version %d
!:mime application/x-shockwave-flash
0 string CWS Macromedia Flash data (compressed),
!:mime application/x-shockwave-flash
>3 byte x version %d
# From: Cal Peake <[email protected]>
0 string FLV Macromedia Flash Video
!:mime video/x-flv
#
# Yosu Gomez
0 string AGD2\xbe\xb8\xbb\xcd\x00 Macromedia Freehand 7 Document
0 string AGD3\xbe\xb8\xbb\xcc\x00 Macromedia Freehand 8 Document
# From Dave Wilson
0 string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document
-26
View File
@@ -1,26 +0,0 @@
#------------------------------------------------------------------------------
# $File: gnome-keyring,v 1.2 2009/09/19 16:28:09 christos Exp $
# GNOME keyring
# Contributed by Josh Triplett
# FIXME: Could be simplified if pstring supported two-byte counts
0 string GnomeKeyring\n\r\0\n GNOME keyring
>&0 ubyte 0 \b, major version 0
>>&0 ubyte 0 \b, minor version 0
>>>&0 ubyte 0 \b, crypto type 0 (AEL)
>>>&0 ubyte >0 \b, crypto type %hhu (unknown)
>>>&1 ubyte 0 \b, hash type 0 (MD5)
>>>&1 ubyte >0 \b, hash type %hhu (unknown)
>>>&2 ubelong 0xFFFFFFFF \b, name NULL
>>>&2 ubelong !0xFFFFFFFF
>>>>&-4 ubelong >255 \b, name too long for file's pstring type
>>>>&-4 ubelong <256
>>>>>&-1 pstring x \b, name "%s"
>>>>>>&0 ubeqdate x \b, last modified %s
>>>>>>&8 ubeqdate x \b, created %s
>>>>>>&16 ubelong &1
>>>>>>>&0 ubelong x \b, locked if idle for %u seconds
>>>>>>&16 ubelong ^1 \b, not locked if idle
>>>>>>&24 ubelong x \b, hash iterations %u
>>>>>>&28 ubequad x \b, salt %llu
>>>>>>&52 ubelong x \b, %u item(s)
-161
View File
@@ -1,161 +0,0 @@
#------------------------------------------------------------------------------
# $File: jpeg,v 1.16 2011/01/04 19:29:32 rrt Exp $
# JPEG images
# SunOS 5.5.1 had
#
# 0 string \377\330\377\340 JPEG file
# 0 string \377\330\377\356 JPG file
#
# both of which turn into "JPEG image data" here.
#
0 beshort 0xffd8 JPEG image data
!:mime image/jpeg
!:apple 8BIMJPEG
!:strength +1
>6 string JFIF \b, JFIF standard
# The following added by Erik Rossen <[email protected]> 1999-09-06
# in a vain attempt to add image size reporting for JFIF. Note that these
# tests are not fool-proof since some perfectly valid JPEGs are currently
# impossible to specify in magic(4) format.
# First, a little JFIF version info:
>>11 byte x \b %d.
>>12 byte x \b%02d
# Next, the resolution or aspect ratio of the image:
#>>13 byte 0 \b, aspect ratio
#>>13 byte 1 \b, resolution (DPI)
#>>13 byte 2 \b, resolution (DPCM)
#>>4 beshort x \b, segment length %d
# Next, show thumbnail info, if it exists:
>>18 byte !0 \b, thumbnail %dx
>>>19 byte x \b%d
# EXIF moved down here to avoid reporting a bogus version number,
# and EXIF version number printing added.
# - Patrik R=E5dman <[email protected]>
>6 string Exif \b, EXIF standard
# Look for EXIF IFD offset in IFD 0, and then look for EXIF version tag in EXIF IFD.
# All possible combinations of entries have to be enumerated, since no looping
# is possible. And both endians are possible...
# The combinations included below are from real-world JPEGs.
# Little-endian
>>12 string II
# IFD 0 Entry #5:
>>>70 leshort 0x8769
# EXIF IFD Entry #1:
>>>>(78.l+14) leshort 0x9000
>>>>>(78.l+23) byte x %c
>>>>>(78.l+24) byte x \b.%c
>>>>>(78.l+25) byte !0x30 \b%c
# IFD 0 Entry #9:
>>>118 leshort 0x8769
# EXIF IFD Entry #3:
>>>>(126.l+38) leshort 0x9000
>>>>>(126.l+47) byte x %c
>>>>>(126.l+48) byte x \b.%c
>>>>>(126.l+49) byte !0x30 \b%c
# IFD 0 Entry #10
>>>130 leshort 0x8769
# EXIF IFD Entry #3:
>>>>(138.l+38) leshort 0x9000
>>>>>(138.l+47) byte x %c
>>>>>(138.l+48) byte x \b.%c
>>>>>(138.l+49) byte !0x30 \b%c
# EXIF IFD Entry #4:
>>>>(138.l+50) leshort 0x9000
>>>>>(138.l+59) byte x %c
>>>>>(138.l+60) byte x \b.%c
>>>>>(138.l+61) byte !0x30 \b%c
# EXIF IFD Entry #5:
>>>>(138.l+62) leshort 0x9000
>>>>>(138.l+71) byte x %c
>>>>>(138.l+72) byte x \b.%c
>>>>>(138.l+73) byte !0x30 \b%c
# IFD 0 Entry #11
>>>142 leshort 0x8769
# EXIF IFD Entry #3:
>>>>(150.l+38) leshort 0x9000
>>>>>(150.l+47) byte x %c
>>>>>(150.l+48) byte x \b.%c
>>>>>(150.l+49) byte !0x30 \b%c
# EXIF IFD Entry #4:
>>>>(150.l+50) leshort 0x9000
>>>>>(150.l+59) byte x %c
>>>>>(150.l+60) byte x \b.%c
>>>>>(150.l+61) byte !0x30 \b%c
# EXIF IFD Entry #5:
>>>>(150.l+62) leshort 0x9000
>>>>>(150.l+71) byte x %c
>>>>>(150.l+72) byte x \b.%c
>>>>>(150.l+73) byte !0x30 \b%c
# Big-endian
>>12 string MM
# IFD 0 Entry #9:
>>>118 beshort 0x8769
# EXIF IFD Entry #1:
>>>>(126.L+14) beshort 0x9000
>>>>>(126.L+23) byte x %c
>>>>>(126.L+24) byte x \b.%c
>>>>>(126.L+25) byte !0x30 \b%c
# EXIF IFD Entry #3:
>>>>(126.L+38) beshort 0x9000
>>>>>(126.L+47) byte x %c
>>>>>(126.L+48) byte x \b.%c
>>>>>(126.L+49) byte !0x30 \b%c
# IFD 0 Entry #10
>>>130 beshort 0x8769
# EXIF IFD Entry #3:
>>>>(138.L+38) beshort 0x9000
>>>>>(138.L+47) byte x %c
>>>>>(138.L+48) byte x \b.%c
>>>>>(138.L+49) byte !0x30 \b%c
# EXIF IFD Entry #5:
>>>>(138.L+62) beshort 0x9000
>>>>>(138.L+71) byte x %c
>>>>>(138.L+72) byte x \b.%c
>>>>>(138.L+73) byte !0x30 \b%c
# IFD 0 Entry #11
>>>142 beshort 0x8769
# EXIF IFD Entry #4:
>>>>(150.L+50) beshort 0x9000
>>>>>(150.L+59) byte x %c
>>>>>(150.L+60) byte x \b.%c
>>>>>(150.L+61) byte !0x30 \b%c
# Here things get sticky. We can do ONE MORE marker segment with
# indirect addressing, and that's all. It would be great if we could
# do pointer arithemetic like in an assembler language. Christos?
# And if there was some sort of looping construct to do searches, plus a few
# named accumulators, it would be even more effective...
# At least we can show a comment if no other segments got inserted before:
>(4.S+5) byte 0xFE \b, comment:
>>(4.S+6) pstring/HJ x "%s"
# Or, we can show the encoding type (I've included only the three most common)
# and image dimensions if we are lucky and the SOFn (image segment) is here:
>(4.S+5) byte 0xC0 \b, baseline
>>(4.S+6) byte x \b, precision %d
>>(4.S+7) beshort x \b, %dx
>>(4.S+9) beshort x \b%d
>(4.S+5) byte 0xC1 \b, extended sequential
>>(4.S+6) byte x \b, precision %d
>>(4.S+7) beshort x \b, %dx
>>(4.S+9) beshort x \b%d
>(4.S+5) byte 0xC2 \b, progressive
>>(4.S+6) byte x \b, precision %d
>>(4.S+7) beshort x \b, %dx
>>(4.S+9) beshort x \b%d
# I've commented-out quantisation table reporting. I doubt anyone cares yet.
#>(4.S+5) byte 0xDB \b, quantisation table
#>>(4.S+6) beshort x \b length=%d
#>14 beshort x \b, %d x
#>16 beshort x \b %d
# HSI is Handmade Software's proprietary JPEG encoding scheme
0 string hsi1 JPEG image data, HSI proprietary
# From: David Santinoli <[email protected]>
0 string \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A JPEG 2000 image data
# Type: JPEG 2000 codesream
# From: Mathieu Malaterre <[email protected]>
0 belong 0xff4fff51 JPEG 2000 codestream
45 beshort 0xff52
-86
View File
@@ -1,86 +0,0 @@
#------------------------------------------------------------
# $File: mach,v 1.9 2009/09/19 16:28:10 christos Exp $
# Mach has two magic numbers, 0xcafebabe and 0xfeedface.
# Unfortunately the first, cafebabe, is shared with
# Java ByteCode, so they are both handled in the file "cafebabe".
# The "feedface" ones are handled herein.
#------------------------------------------------------------
0 lelong&0xfffffffe 0xfeedface Mach-O
>0 byte 0xcf 64-bit
>12 lelong 1 object
>12 lelong 2 executable
>12 lelong 3 fixed virtual memory shared library
>12 lelong 4 core
>12 lelong 5 preload executable
>12 lelong 6 dynamically linked shared library
>12 lelong 7 dynamic linker
>12 lelong 8 bundle
>12 lelong 9 dynamically linked shared library stub
>12 lelong >9
>>12 lelong x filetype=%ld
>4 lelong <0
>>4 lelong x architecture=%ld
>4 lelong 1 vax
>4 lelong 2 romp
>4 lelong 3 architecture=3
>4 lelong 4 ns32032
>4 lelong 5 ns32332
>4 lelong 6 m68k
>4 lelong 7 i386
>4 lelong 8 mips
>4 lelong 9 ns32532
>4 lelong 10 architecture=10
>4 lelong 11 hppa
>4 lelong 12 acorn
>4 lelong 13 m88k
>4 lelong 14 sparc
>4 lelong 15 i860-big
>4 lelong 16 i860
>4 lelong 17 rs6000
>4 lelong 18 ppc
>4 lelong 16777234 ppc64
>4 lelong >16777234
>>4 lelong x architecture=%ld
#
0 belong&0xfffffffe 0xfeedface Mach-O
>3 byte 0xcf 64-bit
>12 belong 1 object
>12 belong 2 executable
>12 belong 3 fixed virtual memory shared library
>12 belong 4 core
>12 belong 5 preload executable
>12 belong 6 dynamically linked shared library
>12 belong 7 dynamic linker
>12 belong 8 bundle
>12 belong 9 dynamically linked shared library stub
>12 belong >9
>>12 belong x filetype=%ld
>4 belong <0
>>4 belong x architecture=%ld
>4 belong 1 vax
>4 belong 2 romp
>4 belong 3 architecture=3
>4 belong 4 ns32032
>4 belong 5 ns32332
>4 belong 6 for m68k architecture
# from NeXTstep 3.0 <mach/machine.h>
# i.e. mc680x0_all, ignore
# >>8 belong 1 (mc68030)
>>8 belong 2 (mc68040)
>>8 belong 3 (mc68030 only)
>4 belong 7 i386
>4 belong 8 mips
>4 belong 9 ns32532
>4 belong 10 architecture=10
>4 belong 11 hppa
>4 belong 12 acorn
>4 belong 13 m88k
>4 belong 14 sparc
>4 belong 15 i860-big
>4 belong 16 i860
>4 belong 17 rs6000
>4 belong 18 ppc
>4 belong 16777234 ppc64
>4 belong >16777234
>>4 belong x architecture=%ld
-182
View File
@@ -1,182 +0,0 @@
#------------------------------------------------------------------------------
# $File: mips,v 1.7 2011/05/03 01:44:17 christos Exp $
# mips: file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
# Dec Ultrix (MIPS)
# all of SGI's *current* machines and OSes run in big-endian mode on the
# MIPS machines, as far as I know.
#
# XXX - what is the blank "-" line?
#
# kbd file definitions
0 string kbd!map kbd map file
>8 byte >0 Ver %d:
>10 short >0 with %d table(s)
0 belong 0407 old SGI 68020 executable
0 belong 0410 old SGI 68020 pure executable
0 beshort 0x8765 disk quotas file
0 beshort 0x0506 IRIS Showcase file
>2 byte 0x49 -
>3 byte x - version %ld
0 beshort 0x0226 IRIS Showcase template
>2 byte 0x63 -
>3 byte x - version %ld
0 belong 0x5343464d IRIS Showcase file
>4 byte x - version %ld
0 belong 0x5443464d IRIS Showcase template
>4 byte x - version %ld
0 belong 0xdeadbabe IRIX Parallel Arena
>8 belong >0 - version %ld
#
0 beshort 0x0160 MIPSEB ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>22 byte x - version %ld
>23 byte x \b.%ld
#
0 beshort 0x0162 MIPSEL-BE ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %d
>22 byte x \b.%ld
#
0 beshort 0x6001 MIPSEB-LE ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %d
>22 byte x \b.%ld
#
0 beshort 0x6201 MIPSEL ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %ld
>22 byte x \b.%ld
#
# MIPS 2 additions
#
0 beshort 0x0163 MIPSEB MIPS-II ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>22 byte x - version %ld
>23 byte x \b.%ld
#
0 beshort 0x0166 MIPSEL-BE MIPS-II ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>22 byte x - version %ld
>23 byte x \b.%ld
#
0 beshort 0x6301 MIPSEB-LE MIPS-II ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %ld
>22 byte x \b.%ld
#
0 beshort 0x6601 MIPSEL MIPS-II ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %ld
>22 byte x \b.%ld
#
# MIPS 3 additions
#
0 beshort 0x0140 MIPSEB MIPS-III ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>22 byte x - version %ld
>23 byte x \b.%ld
#
0 beshort 0x0142 MIPSEL-BE MIPS-III ECOFF executable
>20 beshort 0407 (impure)
>20 beshort 0410 (swapped)
>20 beshort 0413 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>22 byte x - version %ld
>23 byte x \b.%ld
#
0 beshort 0x4001 MIPSEB-LE MIPS-III ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %ld
>22 byte x \b.%ld
#
0 beshort 0x4201 MIPSEL MIPS-III ECOFF executable
>20 beshort 03401 (impure)
>20 beshort 04001 (swapped)
>20 beshort 05401 (paged)
>8 belong >0 not stripped
>8 belong 0 stripped
>23 byte x - version %ld
>22 byte x \b.%ld
#
0 beshort 0x180 MIPSEB Ucode
0 beshort 0x182 MIPSEL-BE Ucode
# 32bit core file
0 belong 0xdeadadb0 IRIX core dump
>4 belong 1 of
>16 string >\0 '%s'
# 64bit core file
0 belong 0xdeadad40 IRIX 64-bit core dump
>4 belong 1 of
>16 string >\0 '%s'
# N32bit core file
0 belong 0xbabec0bb IRIX N32 core dump
>4 belong 1 of
>16 string >\0 '%s'
# New style crash dump file
0 string \x43\x72\x73\x68\x44\x75\x6d\x70 IRIX vmcore dump of
>36 string >\0 '%s'
# Trusted IRIX info
0 string SGIAUDIT SGI Audit file
>8 byte x - version %d
>9 byte x \b.%ld
#
0 string WNGZWZSC Wingz compiled script
0 string WNGZWZSS Wingz spreadsheet
0 string WNGZWZHP Wingz help file
#
0 string #Inventor V IRIS Inventor 1.0 file
0 string #Inventor V2 Open Inventor 2.0 file
# GLF is OpenGL stream encoding
0 string glfHeadMagic(); GLF_TEXT
4 belong 0x7d000000 GLF_BINARY_LSB_FIRST
!:strength -30
4 belong 0x0000007d GLF_BINARY_MSB_FIRST
!:strength -30
# GLS is OpenGL stream encoding; GLS is the successor of GLF
0 string glsBeginGLS( GLS_TEXT
4 belong 0x10000000 GLS_BINARY_LSB_FIRST
!:strength -30
4 belong 0x00000010 GLS_BINARY_MSB_FIRST
!:strength -30
-33
View File
@@ -1,33 +0,0 @@
#------------------------------------------------------------------------------
# $File: msooxml,v 1.1 2011/01/25 18:36:19 christos Exp $
# msooxml: file(1) magic for Microsoft Office XML
# From: Ralf Brown <[email protected]>
# .docx, .pptx, and .xlsx are XML plus other files inside a ZIP
# archive. The first member file is normally "[Content_Types].xml".
# Since MSOOXML doesn't have anything like the uncompressed "mimetype"
# file of ePub or OpenDocument, we'll have to scan for a filename
# which can distinguish between the three types
# start by checking for ZIP local file header signature
0 string PK\003\004
# make sure the first file is correct
>0x1E string [Content_Types].xml
# skip to the second local file header
# since some documents include a 520-byte extra field following the file
# header, we need to scan for the next header
>>(18.l+49) search/2000 PK\003\004
# now skip to the *third* local file header; again, we need to scan due to a
# 520-byte extra field following the file header
>>>&26 search/1000 PK\003\004
# and check the subdirectory name to determine which type of OOXML
# file we have
>>>>&26 string word/ Microsoft Word 2007+
!:mime application/msword
>>>>&26 string ppt/ Microsoft PowerPoint 2007+
!:mime application/vnd.ms-powerpoint
>>>>&26 string xl/ Microsoft Excel 2007+
!:mime application/vnd.ms-excel
>>>>&26 default x Microsoft OOXML
!:strength +10
-27
View File
@@ -1,27 +0,0 @@
#------------------------------------------------------------------------------
# $File: pgp,v 1.9 2009/09/19 16:28:11 christos Exp $
# pgp: file(1) magic for Pretty Good Privacy
# see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
#
0 beshort 0x9900 PGP key public ring
!:mime application/x-pgp-keyring
0 beshort 0x9501 PGP key security ring
!:mime application/x-pgp-keyring
0 beshort 0x9500 PGP key security ring
!:mime application/x-pgp-keyring
0 beshort 0xa600 PGP encrypted data
#!:mime application/pgp-encrypted
#0 string -----BEGIN\040PGP text/PGP armored data
!:mime text/PGP # encoding: armored data
#>15 string PUBLIC\040KEY\040BLOCK- public key block
#>15 string MESSAGE- message
#>15 string SIGNED\040MESSAGE- signed message
#>15 string PGP\040SIGNATURE- signature
2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- PGP public key block
!:mime application/pgp-keys
0 string -----BEGIN\040PGP\40MESSAGE- PGP message
!:mime application/pgp
0 string -----BEGIN\040PGP\40SIGNATURE- PGP signature
!:mime application/pgp-signature
-71
View File
@@ -1,71 +0,0 @@
#------------------------------------------------------------------------------
# $File: sgi,v 1.18 2010/11/25 15:00:12 christos Exp $
# sgi: file(1) magic for Silicon Graphics applications
#
#
# Performance Co-Pilot file types
0 string PmNs PCP compiled namespace (V.0)
0 string PmN PCP compiled namespace
>3 string >\0 (V.%1.1s)
#3 lelong 0x84500526 PCP archive
3 belong 0x84500526 PCP archive
>7 byte x (V.%d)
#>20 lelong -2 temporal index
#>20 lelong -1 metadata
#>20 lelong 0 log volume #0
#>20 lelong >0 log volume #%ld
>20 belong -2 temporal index
>20 belong -1 metadata
>20 belong 0 log volume #0
>20 belong >0 log volume #%ld
>24 string >\0 host: %s
0 string PCPFolio PCP
>9 string Version: Archive Folio
>18 string >\0 (V.%s)
0 string #pmchart PCP pmchart view
>9 string Version
>17 string >\0 (V%-3.3s)
0 string #kmchart PCP kmchart view
>9 string Version
>17 string >\0 (V.%s)
0 string pmview PCP pmview config
>7 string Version
>15 string >\0 (V%-3.3s)
0 string #pmlogger PCP pmlogger config
>10 string Version
>18 string >\0 (V%1.1s)
0 string #pmdahotproc PCP pmdahotproc config
>13 string Version
>21 string >\0 (V%-3.3s)
0 string PcPh PCP Help
>4 string 1 Index
>4 string 2 Text
>5 string >\0 (V.%1.1s)
0 string #pmieconf-rules PCP pmieconf rules
>16 string >\0 (V.%1.1s)
3 string pmieconf-pmie PCP pmie config
>17 string >\0 (V.%1.1s)
# SpeedShop data files
0 lelong 0x13130303 SpeedShop data file
# mdbm files
0 lelong 0x01023962 mdbm file, version 0 (obsolete)
0 string mdbm mdbm file,
>5 byte x version %d,
>6 byte x 2^%d pages,
>7 byte x pagesize 2^%d,
>17 byte x hash %d,
>11 byte x dataformat %d
# Alias Maya files
0 string/t //Maya ASCII Alias Maya Ascii File,
>13 string >\0 version %s
8 string MAYAFOR4 Alias Maya Binary File,
>32 string >\0 version %s scene
8 string MayaFOR4 Alias Maya Binary File,
>32 string >\0 version %s scene
8 string CIMG Alias Maya Image File
8 string DEEP Alias Maya Image File
-46
View File
@@ -1,46 +0,0 @@
#------------------------------------------------------------------------------
# $File: sql,v 1.6 2009/09/19 16:28:12 christos Exp $
# sql: file(1) magic for SQL files
#
# From: "Marty Leisner" <[email protected]>
# Recognize some MySQL files.
#
0 beshort 0xfe01 MySQL table definition file
>2 byte x Version %d
0 belong&0xffffff00 0xfefe0300 MySQL MISAM index file
>3 byte x Version %d
0 belong&0xffffff00 0xfefe0700 MySQL MISAM compressed data file
>3 byte x Version %d
0 belong&0xffffff00 0xfefe0500 MySQL ISAM index file
>3 byte x Version %d
0 belong&0xffffff00 0xfefe0600 MySQL ISAM compressed data file
>3 byte x Version %d
0 string \376bin MySQL replication log
#------------------------------------------------------------------------------
# iRiver H Series database file
# From Ken Guest <[email protected]>
# As observed from iRivNavi.iDB and unencoded firmware
#
0 string iRivDB iRiver Database file
>11 string >\0 Version %s
>39 string iHP-100 [H Series]
#------------------------------------------------------------------------------
# SQLite database files
# Ken Guest <[email protected]>, Ty Sarna, Zack Weinberg
#
# Version 1 used GDBM internally; its files cannot be distinguished
# from other GDBM files.
#
# Version 2 used this format:
0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
# Version 3 of SQLite allows applications to embed their own "user version"
# number in the database. Detect this and distinguish those files.
0 string SQLite\ format\ 3
>60 string _MTN Monotone source repository
>60 belong !0 SQLite 3.x database, user version %u
>60 belong 0 SQLite 3.x database
-8
View File
@@ -1,8 +0,0 @@
# Type: OpenSSH key files
# From: Nicolas Collignon <[email protected]>
0 string SSH\ PRIVATE\ KEY OpenSSH RSA1 private key,
>28 string >\0 version %s
0 string ssh-dss\ OpenSSH DSA public key
0 string ssh-rsa\ OpenSSH RSA public key
-35
View File
@@ -1,35 +0,0 @@
#------------------------------------------------------------------------------
# $File: unknown,v 1.7 2009/09/19 16:28:13 christos Exp $
# unknown: file(1) magic for unknown machines
#
# XXX - this probably should be pruned, as it'll match PDP-11 and
# VAX image formats.
#
# 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
# respectively).
#
# 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
# have the "version %ld", which may be a bogus COFFism (I don't think
# there ever was COFF for the PDP-11).
#
# 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
# long, as it would be on a VAX.
#
# 0x10C is 0414 and 0x10E is 416; those *are* unknown.
#
0 short 0x107 unknown machine executable
>8 short >0 not stripped
>15 byte >0 - version %ld
0 short 0x108 unknown pure executable
>8 short >0 not stripped
>15 byte >0 - version %ld
0 short 0x109 PDP-11 separate I&D
>8 short >0 not stripped
>15 byte >0 - version %ld
0 short 0x10b unknown pure executable
>8 short >0 not stripped
>15 byte >0 - version %ld
0 long 0x10c unknown demand paged pure executable
>16 long >0 not stripped
0 long 0x10e unknown readable demand paged pure executable
-17
View File
@@ -1,17 +0,0 @@
#------------------------------------------------------------------------------
# $File: virtual,v 1.2 2011/11/22 13:30:05 christos Exp $
# From: James Nobis <[email protected]>
# Microsoft hard disk images for:
# Virtual Server
# Virtual PC
# http://technet.microsoft.com/en-us/virtualserver/bb676673.aspx
# .vhd
0 string conectix Microsoft Disk Image, Virtual Server or Virtual PC
# Sun xVM VirtualBox Disk Image
# From: Richard W.M. Jones <[email protected]>
# VirtualBox Disk Image
0x40 ulelong 0xbeda107f VirtualBox Disk Image
>0x44 uleshort >0 \b, major %u
>0x46 uleshort >0 \b, minor %u
-122
View File
@@ -1,122 +0,0 @@
#------------------------------------------------------------------------------
# $File: windows,v 1.4 2009/09/19 16:28:13 christos Exp $
# windows: file(1) magic for Microsoft Windows
#
# This file is mainly reserved for files where programs
# using them are run almost always on MS Windows 3.x or
# above, or files only used exclusively in Windows OS,
# where there is no better category to allocate for.
# For example, even though WinZIP almost run on Windows
# only, it is better to treat them as "archive" instead.
# For format usable in DOS, such as generic executable
# format, please specify under "msdos" file.
#
# Summary: Outlook Express DBX file
# Extension: .dbx
# Created by: Christophe Monniez
0 string \xCF\xAD\x12\xFE MS Outlook Express DBX file
>4 byte =0xC5 \b, message database
>4 byte =0xC6 \b, folder database
>4 byte =0xC7 \b, account information
>4 byte =0x30 \b, offline database
# Summary: Windows crash dump
# Extension: .dmp
# Created by: Andreas Schuster (http://computer.forensikblog.de/)
# Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
# Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
0 string PAGE
>4 string DUMP MS Windows 32bit crash dump
>>0x05c byte 0 \b, no PAE
>>0x05c byte 1 \b, PAE
>>0xf88 lelong 1 \b, full dump
>>0xf88 lelong 2 \b, kernel dump
>>0xf88 lelong 3 \b, small dump
>>0x068 lelong x \b, %ld pages
>4 string DU64 MS Windows 64bit crash dump
>>0xf98 lelong 1 \b, full dump
>>0xf98 lelong 2 \b, kernel dump
>>0xf98 lelong 3 \b, small dump
>>0x090 lequad x \b, %lld pages
# Summary: Vista Event Log
# Extension: .evtx
# Created by: Andreas Schuster (http://computer.forensikblog.de/)
# Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
0 string ElfFile\0 MS Windows Vista Event Log
>0x2a leshort x \b, %d chunks
>>0x10 lelong x \b (no. %d in use)
>0x18 lelong >1 \b, next record no. %d
>0x18 lelong =1 \b, empty
>0x78 lelong &1 \b, DIRTY
>0x78 lelong &2 \b, FULL
# Summary: Windows 3.1 group files
# Extension: .grp
# Created by: unknown
0 string \120\115\103\103 MS Windows 3.1 group files
# Summary: Old format help files
# Extension: .hlp
# Created by: Dirk Jagdmann <[email protected]>
0 lelong 0x00035f3f MS Windows 3.x help file
# Summary: Hyper terminal
# Extension: .ht
# Created by: unknown
0 string HyperTerminal\
>15 string 1.0\ --\ HyperTerminal\ data\ file MS Windows HyperTerminal profile
# Summary: Windows shortcut
# Extension: .lnk
# Created by: unknown
0 string \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106 MS Windows shortcut
# Summary: Outlook Personal Folders
# Created by: unknown
0 lelong 0x4E444221 Microsoft Outlook email folder
>10 leshort 0x0e (<=2002)
>10 leshort 0x17 (>=2003)
# Summary: Windows help cache
# Created by: unknown
0 string \164\146\115\122\012\000\000\000\001\000\000\000 MS Windows help cache
# Summary: IE cache file
# Created by: Christophe Monniez
0 string Client\ UrlCache\ MMF Internet Explorer cache file
>20 string >\0 version %s
# Summary: Registry files
# Created by: unknown
# Modified by (1): Joerg Jenderek
0 string regf MS Windows registry file, NT/2000 or above
0 string CREG MS Windows 95/98/ME registry file
0 string SHCC3 MS Windows 3.1 registry file
# Summary: Windows Registry text
# Extension: .reg
# Submitted by: Abel Cheung <[email protected]>
0 string REGEDIT4\r\n\r\n Windows Registry text (Win95 or above)
0 string Windows\ Registry\ Editor\
>&0 string Version\ 5.00\r\n\r\n Windows Registry text (Win2K or above)
# From: Pal Tamas <[email protected]>
# Autorun File
0 string/c [autorun]\r\n Microsoft Windows Autorun file.
!:mime application/x-setupscript.
-35
View File
@@ -1,35 +0,0 @@
#------------------------------------------------------------------------------
# $File: xilinx,v 1.4 2009/09/19 16:28:13 christos Exp $
# This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
# [email protected]
# Got the info from FPGA-FAQ 0026
#
# First there is the sync header and its length
0 beshort 0x0009
>2 belong =0x0ff00ff0
>>&0 belong =0x0ff00ff0
>>>&0 beshort =0x0000
>>>>&0 pstring a Xilinx BIT data
# Next is a Pascal-style string with the NCD name. We want to capture that.
>>>>0x0F pstring x - from %s
# It is followed by a NUL
>>>>>&1 byte 0x00
# And then 'b'
>>>>>&2 string b
# With the part number:
#>>>>>&5 string 4v (Virtex4)
#>>>>>&5 string 2v (Virtex II
#>>>>>>&0 string !p \b)
#>>>>>>&0 string p Pro)
>>>>>&4 pstring x - for %s
# And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
>>>>>>&1 byte 0x00
>>>>>>&2 string c
>>>>>>&4 pstring x - built %s
>>>>>>>&1 byte 0x00
>>>>>>>&2 string d
>>>>>>>&4 pstring x \b(%s)
>>>>>>>>&1 byte 0x00
>>>>>>>>&2 string e
>>>>>>>>&4 belong x - data length 0x%lx
+3 -278
View File
@@ -1,280 +1,5 @@
#
# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $
#
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
MAGIC_FRAGMENT_DIR = $(MAGIC_DIR)/$(MAGIC_FRAGMENT_BASE)
ACLOCAL_AMFLAGS = -I m4
pkgdata_DATA = magic.mgc
EXTRA_DIST = MAINT
EXTRA_DIST = \
$(MAGIC_DIR)/Header \
$(MAGIC_DIR)/Localstuff \
$(MAGIC_FRAGMENT_DIR)/acorn \
$(MAGIC_FRAGMENT_DIR)/adi \
$(MAGIC_FRAGMENT_DIR)/adventure \
$(MAGIC_FRAGMENT_DIR)/allegro \
$(MAGIC_FRAGMENT_DIR)/alliant \
$(MAGIC_FRAGMENT_DIR)/amanda \
$(MAGIC_FRAGMENT_DIR)/amigaos \
$(MAGIC_FRAGMENT_DIR)/animation \
$(MAGIC_FRAGMENT_DIR)/apl \
$(MAGIC_FRAGMENT_DIR)/apple \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
$(MAGIC_FRAGMENT_DIR)/asterix \
$(MAGIC_FRAGMENT_DIR)/att3b \
$(MAGIC_FRAGMENT_DIR)/audio \
$(MAGIC_FRAGMENT_DIR)/basis \
$(MAGIC_FRAGMENT_DIR)/bflt \
$(MAGIC_FRAGMENT_DIR)/blcr \
$(MAGIC_FRAGMENT_DIR)/blender \
$(MAGIC_FRAGMENT_DIR)/blit \
$(MAGIC_FRAGMENT_DIR)/bout \
$(MAGIC_FRAGMENT_DIR)/bsdi \
$(MAGIC_FRAGMENT_DIR)/bsi \
$(MAGIC_FRAGMENT_DIR)/btsnoop \
$(MAGIC_FRAGMENT_DIR)/c-lang \
$(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
$(MAGIC_FRAGMENT_DIR)/citrus \
$(MAGIC_FRAGMENT_DIR)/clarion \
$(MAGIC_FRAGMENT_DIR)/claris \
$(MAGIC_FRAGMENT_DIR)/clipper \
$(MAGIC_FRAGMENT_DIR)/commands \
$(MAGIC_FRAGMENT_DIR)/communications \
$(MAGIC_FRAGMENT_DIR)/compress \
$(MAGIC_FRAGMENT_DIR)/console \
$(MAGIC_FRAGMENT_DIR)/convex \
$(MAGIC_FRAGMENT_DIR)/cracklib \
$(MAGIC_FRAGMENT_DIR)/ctags \
$(MAGIC_FRAGMENT_DIR)/cups \
$(MAGIC_FRAGMENT_DIR)/dact \
$(MAGIC_FRAGMENT_DIR)/database \
$(MAGIC_FRAGMENT_DIR)/diamond \
$(MAGIC_FRAGMENT_DIR)/diff \
$(MAGIC_FRAGMENT_DIR)/digital \
$(MAGIC_FRAGMENT_DIR)/dolby \
$(MAGIC_FRAGMENT_DIR)/dump \
$(MAGIC_FRAGMENT_DIR)/dyadic \
$(MAGIC_FRAGMENT_DIR)/ebml \
$(MAGIC_FRAGMENT_DIR)/editors \
$(MAGIC_FRAGMENT_DIR)/efi \
$(MAGIC_FRAGMENT_DIR)/elf \
$(MAGIC_FRAGMENT_DIR)/encore \
$(MAGIC_FRAGMENT_DIR)/epoc \
$(MAGIC_FRAGMENT_DIR)/erlang \
$(MAGIC_FRAGMENT_DIR)/esri \
$(MAGIC_FRAGMENT_DIR)/fcs \
$(MAGIC_FRAGMENT_DIR)/filesystems \
$(MAGIC_FRAGMENT_DIR)/flash \
$(MAGIC_FRAGMENT_DIR)/fonts \
$(MAGIC_FRAGMENT_DIR)/fortran \
$(MAGIC_FRAGMENT_DIR)/frame \
$(MAGIC_FRAGMENT_DIR)/freebsd \
$(MAGIC_FRAGMENT_DIR)/fsav \
$(MAGIC_FRAGMENT_DIR)/fusecompress \
$(MAGIC_FRAGMENT_DIR)/games \
$(MAGIC_FRAGMENT_DIR)/gcc \
$(MAGIC_FRAGMENT_DIR)/geo \
$(MAGIC_FRAGMENT_DIR)/geos \
$(MAGIC_FRAGMENT_DIR)/gimp \
$(MAGIC_FRAGMENT_DIR)/gnome-keyring \
$(MAGIC_FRAGMENT_DIR)/gnu \
$(MAGIC_FRAGMENT_DIR)/gnumeric \
$(MAGIC_FRAGMENT_DIR)/grace \
$(MAGIC_FRAGMENT_DIR)/graphviz \
$(MAGIC_FRAGMENT_DIR)/gringotts \
$(MAGIC_FRAGMENT_DIR)/guile \
$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
$(MAGIC_FRAGMENT_DIR)/hp \
$(MAGIC_FRAGMENT_DIR)/human68k \
$(MAGIC_FRAGMENT_DIR)/ibm370 \
$(MAGIC_FRAGMENT_DIR)/ibm6000 \
$(MAGIC_FRAGMENT_DIR)/iff \
$(MAGIC_FRAGMENT_DIR)/images \
$(MAGIC_FRAGMENT_DIR)/inform \
$(MAGIC_FRAGMENT_DIR)/intel \
$(MAGIC_FRAGMENT_DIR)/interleaf \
$(MAGIC_FRAGMENT_DIR)/island \
$(MAGIC_FRAGMENT_DIR)/ispell \
$(MAGIC_FRAGMENT_DIR)/isz \
$(MAGIC_FRAGMENT_DIR)/java \
$(MAGIC_FRAGMENT_DIR)/jpeg \
$(MAGIC_FRAGMENT_DIR)/karma \
$(MAGIC_FRAGMENT_DIR)/kde \
$(MAGIC_FRAGMENT_DIR)/kml \
$(MAGIC_FRAGMENT_DIR)/lecter \
$(MAGIC_FRAGMENT_DIR)/lex \
$(MAGIC_FRAGMENT_DIR)/lif \
$(MAGIC_FRAGMENT_DIR)/linux \
$(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
$(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macintosh \
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
$(MAGIC_FRAGMENT_DIR)/maple \
$(MAGIC_FRAGMENT_DIR)/marc21 \
$(MAGIC_FRAGMENT_DIR)/mathcad \
$(MAGIC_FRAGMENT_DIR)/mathematica \
$(MAGIC_FRAGMENT_DIR)/matroska \
$(MAGIC_FRAGMENT_DIR)/mcrypt \
$(MAGIC_FRAGMENT_DIR)/mercurial \
$(MAGIC_FRAGMENT_DIR)/metastore \
$(MAGIC_FRAGMENT_DIR)/mime \
$(MAGIC_FRAGMENT_DIR)/mips \
$(MAGIC_FRAGMENT_DIR)/mirage \
$(MAGIC_FRAGMENT_DIR)/misctools \
$(MAGIC_FRAGMENT_DIR)/mkid \
$(MAGIC_FRAGMENT_DIR)/mlssa \
$(MAGIC_FRAGMENT_DIR)/mmdf \
$(MAGIC_FRAGMENT_DIR)/modem \
$(MAGIC_FRAGMENT_DIR)/motorola \
$(MAGIC_FRAGMENT_DIR)/mozilla \
$(MAGIC_FRAGMENT_DIR)/msdos \
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/music \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/netbsd \
$(MAGIC_FRAGMENT_DIR)/netscape \
$(MAGIC_FRAGMENT_DIR)/netware \
$(MAGIC_FRAGMENT_DIR)/news \
$(MAGIC_FRAGMENT_DIR)/nitpicker \
$(MAGIC_FRAGMENT_DIR)/oasis \
$(MAGIC_FRAGMENT_DIR)/ocaml \
$(MAGIC_FRAGMENT_DIR)/octave \
$(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
$(MAGIC_FRAGMENT_DIR)/olf \
$(MAGIC_FRAGMENT_DIR)/os2 \
$(MAGIC_FRAGMENT_DIR)/os400 \
$(MAGIC_FRAGMENT_DIR)/os9 \
$(MAGIC_FRAGMENT_DIR)/osf1 \
$(MAGIC_FRAGMENT_DIR)/palm \
$(MAGIC_FRAGMENT_DIR)/parix \
$(MAGIC_FRAGMENT_DIR)/parrot \
$(MAGIC_FRAGMENT_DIR)/pascal \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
$(MAGIC_FRAGMENT_DIR)/perl \
$(MAGIC_FRAGMENT_DIR)/pgp \
$(MAGIC_FRAGMENT_DIR)/pkgadd \
$(MAGIC_FRAGMENT_DIR)/plan9 \
$(MAGIC_FRAGMENT_DIR)/plus5 \
$(MAGIC_FRAGMENT_DIR)/printer \
$(MAGIC_FRAGMENT_DIR)/project \
$(MAGIC_FRAGMENT_DIR)/psdbms \
$(MAGIC_FRAGMENT_DIR)/pulsar \
$(MAGIC_FRAGMENT_DIR)/pyramid \
$(MAGIC_FRAGMENT_DIR)/python \
$(MAGIC_FRAGMENT_DIR)/revision \
$(MAGIC_FRAGMENT_DIR)/riff \
$(MAGIC_FRAGMENT_DIR)/rinex \
$(MAGIC_FRAGMENT_DIR)/rpm \
$(MAGIC_FRAGMENT_DIR)/rtf \
$(MAGIC_FRAGMENT_DIR)/ruby \
$(MAGIC_FRAGMENT_DIR)/sc \
$(MAGIC_FRAGMENT_DIR)/sccs \
$(MAGIC_FRAGMENT_DIR)/scientific \
$(MAGIC_FRAGMENT_DIR)/securitycerts \
$(MAGIC_FRAGMENT_DIR)/selinux \
$(MAGIC_FRAGMENT_DIR)/sendmail \
$(MAGIC_FRAGMENT_DIR)/sequent \
$(MAGIC_FRAGMENT_DIR)/sgi \
$(MAGIC_FRAGMENT_DIR)/sgml \
$(MAGIC_FRAGMENT_DIR)/sharc \
$(MAGIC_FRAGMENT_DIR)/sinclair \
$(MAGIC_FRAGMENT_DIR)/sisu \
$(MAGIC_FRAGMENT_DIR)/sketch \
$(MAGIC_FRAGMENT_DIR)/smalltalk \
$(MAGIC_FRAGMENT_DIR)/smile \
$(MAGIC_FRAGMENT_DIR)/sniffer \
$(MAGIC_FRAGMENT_DIR)/softquad \
$(MAGIC_FRAGMENT_DIR)/spec \
$(MAGIC_FRAGMENT_DIR)/spectrum \
$(MAGIC_FRAGMENT_DIR)/sql \
$(MAGIC_FRAGMENT_DIR)/ssh \
$(MAGIC_FRAGMENT_DIR)/ssl \
$(MAGIC_FRAGMENT_DIR)/sun \
$(MAGIC_FRAGMENT_DIR)/sysex \
$(MAGIC_FRAGMENT_DIR)/tcl \
$(MAGIC_FRAGMENT_DIR)/teapot \
$(MAGIC_FRAGMENT_DIR)/terminfo \
$(MAGIC_FRAGMENT_DIR)/tex \
$(MAGIC_FRAGMENT_DIR)/tgif \
$(MAGIC_FRAGMENT_DIR)/ti-8x \
$(MAGIC_FRAGMENT_DIR)/timezone \
$(MAGIC_FRAGMENT_DIR)/troff \
$(MAGIC_FRAGMENT_DIR)/tuxedo \
$(MAGIC_FRAGMENT_DIR)/typeset \
$(MAGIC_FRAGMENT_DIR)/unicode \
$(MAGIC_FRAGMENT_DIR)/unknown \
$(MAGIC_FRAGMENT_DIR)/uuencode \
$(MAGIC_FRAGMENT_DIR)/varied.out \
$(MAGIC_FRAGMENT_DIR)/varied.script \
$(MAGIC_FRAGMENT_DIR)/vax \
$(MAGIC_FRAGMENT_DIR)/vicar \
$(MAGIC_FRAGMENT_DIR)/virtual \
$(MAGIC_FRAGMENT_DIR)/virtutech \
$(MAGIC_FRAGMENT_DIR)/visx \
$(MAGIC_FRAGMENT_DIR)/vms \
$(MAGIC_FRAGMENT_DIR)/vmware \
$(MAGIC_FRAGMENT_DIR)/vorbis \
$(MAGIC_FRAGMENT_DIR)/vxl \
$(MAGIC_FRAGMENT_DIR)/warc \
$(MAGIC_FRAGMENT_DIR)/weak \
$(MAGIC_FRAGMENT_DIR)/windows \
$(MAGIC_FRAGMENT_DIR)/wireless \
$(MAGIC_FRAGMENT_DIR)/wordprocessors \
$(MAGIC_FRAGMENT_DIR)/wsdl \
$(MAGIC_FRAGMENT_DIR)/xdelta \
$(MAGIC_FRAGMENT_DIR)/xenix \
$(MAGIC_FRAGMENT_DIR)/xilinx \
$(MAGIC_FRAGMENT_DIR)/xo65 \
$(MAGIC_FRAGMENT_DIR)/xwindows \
$(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel
MAGIC = magic.mgc
CLEANFILES = ${MAGIC} $(MAGIC_FRAGMENT_DIR)/Localstuff
# FIXME: Build file natively as well so that it can be used to compile
# the target's magic file; for now we bail if the local version does not match
if IS_CROSS_COMPILE
FILE_COMPILE = file
FILE_COMPILE_DEP =
else
FILE_COMPILE = $(top_builddir)/src/file
FILE_COMPILE_DEP = $(FILE_COMPILE)
endif
${MAGIC}: $(EXTRA_DIST) $(FILE_COMPILE_DEP)
@rm -fr magic
@mkdir magic && cp -p $(EXTRA_DIST) magic
@(if expr "${FILE_COMPILE}" : '.*/.*' > /dev/null; then \
echo "Using ${FILE_COMPILE} to generate ${MAGIC}" > /dev/null; \
else \
v=$$(file --version | sed -e s/file-// -e q); \
if [ "$$v" != "${PACKAGE_VERSION}" ]; then \
echo "Cannot use the installed version of file ($$v) to"; \
echo "cross-compile file ${PACKAGE_VERSION}"; \
echo "Please install file ${PACKAGE_VERSION} locally first"; \
exit 1; \
fi; \
fi)
$(FILE_COMPILE) -C -m magic
@rm -fr magic
SUBDIRS = src magic tests doc python
+510 -392
View File
File diff suppressed because it is too large. Load diff
+55 -39
View File
@@ -1,10 +1,14 @@
** README for file(1) Command **
@(#) $File: README,v 1.44 2011/03/24 13:03:39 rrt Exp $
## README for file(1) Command ##
Mailing List: [email protected]
Bug tracker: http://bugs.gw.com/
@(#) $File: README,v 1.49 2015/01/02 20:23:04 christos Exp $
Mailing List: [email protected]
Mailing List archives: http://mx.gw.com/pipermail/file/
Bug tracker: http://bugs.gw.com/
E-mail: [email protected]
[![Build Status](https://travis-ci.org/file/file.png?branch=master)](https://travis-ci.org/file/file)
Phone: Do not even think of telephoning me about this program. Send cash first!
This is Release 5.x of Ian Darwin's (copyright but distributable)
@@ -13,22 +17,22 @@ It knows the 'magic number' of several thousands of file types.
This version is the standard "file" command for Linux,
*BSD, and other systems. (See "patchlevel.h" for the exact release number).
You can download the latest version of file from:
You can download the latest version of the original sources for file from:
ftp://ftp.astron.com/pub/file/
A public read-only git repository is available at:
A public read-only git repository of the same sources is available at:
https://github.com/glensc/file
https://github.com/file/file
The major changes for 5.x are CDF file parsing, indirect magic, and
overhaul in mime and ascii encoding handling.
The major changes for 5.x are CDF file parsing, indirect magic, name/use
(recursion) and overhaul in mime and ascii encoding handling.
The major feature of 4.x is the refactoring of the code into a library,
and the re-write of the file command in terms of that library. The library
itself, libmagic can be used by 3rd party programs that wish to identify
file types without having to fork() and exec() file. The prime contributor
for 4.0 was M\xe5ns Rullg\xe5rd.
for 4.0 was Mans Rullgard.
UNIX is a trademark of UNIX System Laboratories.
@@ -60,38 +64,50 @@ magic numbers assigned to all sorts of data files that
are in reasonable circulation. Send your magic numbers,
in magic(5) format please, to the maintainer, Christos Zoulas.
COPYING - read this first.
README - read this second (you are currently reading this file).
COPYING - read this first.
README - read this second (you are currently reading this file).
INSTALL - read on how to install
src/apprentice.c - parses /etc/magic to learn magic
src/apptype.c - used for OS/2 specific application type magic
src/asprintf.c - replacement for OS's that don't have it.
src/ascmagic.c - third & last set of tests, based on hardwired assumptions.
src/cdf.c - parser for Microsoft Compound Document Files
src/cdf_time.c - time converter for CDF.
src/compress.c - handles decompressing files to look inside.
src/encoding.c - handles unicode encodings
src/file.c - the main program
src/file.h - header file
src/fsmagic.c - first set of tests the program runs, based on filesystem info
src/funcs.c - utilility functions
src/getopt_long.c - used for OS/2 specific application type magic
src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore).
src/names.h - header file for ascmagic.c
src/magic.c - the libmagic api
src/print.c - print results, errors, warnings.
src/readcdf.c - CDF wrapper.
src/readelf.[ch] - Stand-alone elf parsing code.
src/softmagic.c - 2nd set of tests, based on /etc/magic
src/strlcat.c - used for OS/2 specific application type magic
src/strlcpy.c - used for OS/2 specific application type magic
src/vasprintf.c - used for OS/2 specific application type magic
doc/file.1 - man page for the command
doc/magic.4 - man page for the magic file, courtesy Guy Harris.
src/apprentice.c - parses /etc/magic to learn magic
src/asctime_r.c - replacement for OS's that don't have it.
src/apptype.c - used for OS/2 specific application type magic
src/asprintf.c - replacement for OS's that don't have it.
src/ascmagic.c - third & last set of tests, based on hardwired assumptions.
src/asctime_r.c - replacement for OS's that don't have it.
src/asprintf.c - replacement for OS's that don't have it.
src/cdf.[ch] - parser for Microsoft Compound Document Files
src/cdf_time.c - time converter for CDF.
src/compress.c - handles decompressing files to look inside.
src/ctime_r.c - replacement for OS's that don't have it.
src/elfclass.h - common code for elf 32/64.
src/encoding.c - handles unicode encodings
src/file.c - the main program
src/file.h - header file
src/file_opts.h - list of options
src/fmtcheck.c - replacement for OS's that don't have it.
src/fsmagic.c - first set of tests the program runs, based on filesystem info
src/funcs.c - utilility functions
src/getline.c - replacement for OS's that don't have it.
src/getopt_long.c - replacement for OS's that don't have it.
src/is_tar.c, tar.h - knows about tarchives (courtesy John Gilmore).
src/names.h - header file for ascmagic.c
src/magic.h.in - source file for magic.h
src/magic.c - the libmagic api
src/pread.c - replacement for OS's that don't have it.
src/print.c - print results, errors, warnings.
src/readcdf.c - CDF wrapper.
src/readelf.[ch] - Stand-alone elf parsing code.
src/softmagic.c - 2nd set of tests, based on /etc/magic
src/mygetopt.h - replacement for OS's that don't have it.
src/strcasestr.c - replacement for OS's that don't have it.
src/strlcat.c - replacement for OS's that don't have it.
src/strlcpy.c - replacement for OS's that don't have it.
src/tar.h - tar file definitions
src/vasprintf.c - for systems that don't have it.
doc/file.man - man page for the command
doc/magic.man - man page for the magic file, courtesy Guy Harris.
Install as magic.4 on USG and magic.5 on V7 or Berkeley; cf Makefile.
Magdir - directory of /etc/magic pieces
Magdir - directory of /etc/magic pieces
------------------------------------------------------------------------------
If you submit a new magic entry please make sure you read the following
+16 -3
View File
@@ -1,6 +1,19 @@
TODOs live in the TODO section of doc/file.man (i.e. file(1)). They
are more visible there, so please add any further TODOs to that file,
not here.
Most TODOs live in the TODO section of doc/file.man (i.e. file(1)).
They are more visible there, so please add any further TODOs to that
file, not here. More speculative material can live here.
(This change was made when Reuben Thomas noticed that all the bugs
listed in the BUGS section of the man page had been fixed!)
---
It would be nice to simplify file considerably. For example,
reimplement the apprentice and non-pattern magic methods in Python,
and compile the magic patterns to a giant regex (or something similar;
maybe using Ragel (http://www.complang.org/ragel/)) so that only a
small amount of C is needed (because fast execution is typically only
required for soft magic, not the more detailed information given by
hard-wired routines). In this regard, note that hplip, which is
BSD-licensed, has a magic reimplementation in Python.
Read the kerberos magic entry for more ideas.
+506 -304
View File
File diff suppressed because it is too large. Load diff
+218 -14
View File
@@ -1,10 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand `-c -o'.
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2009-10-06.20; # UTC
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009 Free Software
# Foundation, Inc.
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <[email protected]>.
#
# This program is free software; you can redistribute it and/or modify
@@ -29,21 +28,224 @@ scriptversion=2009-10-06.20; # UTC
# bugs to <[email protected]> or send patches to
# <[email protected]>.
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
for arg
do
if test -n "$eat"; then
eat=
else
case $1 in
-o)
# configure might choose to run compile as 'compile cc -o foo foo.c'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
case $1 in
'')
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: compile [--help] [--version] PROGRAM [ARGS]
Wrapper for compilers which do not understand `-c -o'.
Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
Wrapper for compilers which do not understand '-c -o'.
Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
arguments, and rename the output as expected.
If you are trying to build a whole package this is not the
right script to run: please start by reading the file `INSTALL'.
right script to run: please start by reading the file 'INSTALL'.
Report bugs to <[email protected]>.
EOF
@@ -53,11 +255,13 @@ EOF
echo "compile $scriptversion"
exit $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
eat=
for arg
do
@@ -66,8 +270,8 @@ do
else
case $1 in
-o)
# configure might choose to run compile as `compile cc -o foo foo.c'.
# So we strip `-o arg' only if arg is an object.
# configure might choose to run compile as 'compile cc -o foo foo.c'.
# So we strip '-o arg' only if arg is an object.
eat=1
case $2 in
*.o | *.obj)
@@ -94,10 +298,10 @@ do
done
if test -z "$ofile" || test -z "$cfile"; then
# If no `-o' option was seen then we might have been invoked from a
# If no '-o' option was seen then we might have been invoked from a
# pattern rule where we don't need one. That is ok -- this is a
# normal compilation that the losing compiler can handle. If no
# `.c' file was seen then we are probably linking. That is also
# '.c' file was seen then we are probably linking. That is also
# ok.
exec "$@"
fi
@@ -106,7 +310,7 @@ fi
cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
# Create the lock directory.
# Note: use `[/\\:.-]' here to ensure that we don't use the same name
# Note: use '[/\\:.-]' here to ensure that we don't use the same name
# that we are using for the .o file. Also, base the name on the expected
# object file name, since that is what matters with a parallel build.
lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
Vendored Executable
+1530
View File
File diff suppressed because it is too large. Load diff
+132 -51
View File
@@ -1,14 +1,23 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define in built-in ELF support is used */
#undef BUILTIN_ELF
/* Define for ELF core file support */
#undef ELFCORE
/* Define to 1 if you have the `asctime_r' function. */
#undef HAVE_ASCTIME_R
/* Define to 1 if you have the `asprintf' function. */
#undef HAVE_ASPRINTF
/* Define to 1 if you have the `ctime_r' function. */
#undef HAVE_CTIME_R
/* HAVE_DAYLIGHT */
#undef HAVE_DAYLIGHT
@@ -29,9 +38,15 @@
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fmtcheck' function. */
#undef HAVE_FMTCHECK
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the `freelocale' function. */
#undef HAVE_FREELOCALE
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
@@ -44,11 +59,11 @@
/* Define to 1 if you have the `getopt_long' function. */
#undef HAVE_GETOPT_LONG
/* Define to 1 if the system has the type `int32_t'. */
#undef HAVE_INT32_T
/* Define to 1 if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
/* Define to 1 if the system has the type `int64_t'. */
#undef HAVE_INT64_T
/* Define to 1 if the system has the type `intptr_t'. */
#undef HAVE_INTPTR_T
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -65,7 +80,7 @@
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the `mbrtowc' function. */
/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
#undef HAVE_MBRTOWC
/* Define to 1 if <wchar.h> declares mbstate_t. */
@@ -74,14 +89,26 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `mkostemp' function. */
#undef HAVE_MKOSTEMP
/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
/* Define to 1 if you have the `mmap' function. */
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if the system has the type `pid_t'. */
#undef HAVE_PID_T
/* Define to 1 if you have the `newlocale' function. */
#undef HAVE_NEWLOCALE
/* Define to 1 if you have the `pread' function. */
#undef HAVE_PREAD
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
/* Define to 1 if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -89,6 +116,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasestr' function. */
#undef HAVE_STRCASESTR
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
@@ -128,6 +158,9 @@
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -152,21 +185,15 @@
/* HAVE_TZNAME */
#undef HAVE_TZNAME
/* Define to 1 if the system has the type `uint16_t'. */
#undef HAVE_UINT16_T
/* Define to 1 if the system has the type `uint32_t'. */
#undef HAVE_UINT32_T
/* Define to 1 if the system has the type `uint64_t'. */
#undef HAVE_UINT64_T
/* Define to 1 if the system has the type `uint8_t'. */
#undef HAVE_UINT8_T
/* Define to 1 if the system has the type `uintptr_t'. */
#undef HAVE_UINTPTR_T
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `uselocale' function. */
#undef HAVE_USELOCALE
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME
@@ -179,6 +206,16 @@
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 or 0, depending whether the compiler supports simple visibility
declarations. */
#undef HAVE_VISIBILITY
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
@@ -188,6 +225,15 @@
/* Define to 1 if you have the `wcwidth' function. */
#undef HAVE_WCWIDTH
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Define to 1 if you have the <xlocale.h> header file. */
#undef HAVE_XLOCALE_H
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
@@ -203,9 +249,6 @@
<sysmacros.h>. */
#undef MAJOR_IN_SYSMACROS
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Name of package */
#undef PACKAGE
@@ -227,9 +270,6 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `long long', as computed by sizeof. */
#undef SIZEOF_LONG_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
@@ -261,6 +301,23 @@
/* Version number of package */
#undef VERSION
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@@ -280,43 +337,67 @@
/* Define to 1 if you need to in order for `stat' and other things to work. */
#undef _POSIX_SOURCE
/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT32_T
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT64_T
/* Define for Solaris 2.5.1 so the uint8_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
#define below would cause a syntax error. */
#undef _UINT8_T
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to the type of a signed integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef int32_t
/* Define to the type of a signed integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef int64_t
/* Define to the type of a signed integer type wide enough to hold a pointer,
if such a type exists, and if the system does not define it. */
#undef intptr_t
/* Define to a type if <wchar.h> does not define. */
#undef mbstate_t
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t
#ifndef HAVE_UINT8_T
typedef unsigned char uint8_t;
#endif
#ifndef HAVE_UINT16_T
typedef unsigned short uint16_t;
#endif
#ifndef HAVE_UINT32_T
typedef unsigned int uint32_t;
#endif
#ifndef HAVE_INT32_T
typedef int int32_t;
#endif
#ifndef HAVE_UINT64_T
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
#else
typedef unsigned long uint64_t;
#endif
#endif
#ifndef HAVE_INT64_T
#if SIZEOF_LONG_LONG == 8
typedef long long int64_t;
#else
typedef long int64_t;
#endif
#endif
/* Define to the type of an unsigned integer type of width exactly 32 bits if
such a type exists and the standard includes do not define it. */
#undef uint32_t
/* Define to the type of an unsigned integer type of width exactly 64 bits if
such a type exists and the standard includes do not define it. */
#undef uint64_t
/* Define to the type of an unsigned integer type of width exactly 8 bits if
such a type exists and the standard includes do not define it. */
#undef uint8_t
/* Define to the type of an unsigned integer type wide enough to hold a
pointer, if such a type exists, and if the system does not define it. */
#undef uintptr_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork
Vendored Executable
+1779
View File
File diff suppressed because it is too large. Load diff
+3499 -2041
View File
File diff suppressed because it is too large. Load diff
+26 -44
View File
@@ -1,9 +1,9 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(file, 5.11, [email protected])
AM_INIT_AUTOMAKE()
AC_INIT([file],[5.22],[[email protected]])
AM_INIT_AUTOMAKE([subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_MSG_CHECKING(for builtin ELF support)
@@ -66,22 +66,23 @@ AC_SUBST(fsect)
AM_CONDITIONAL(FSECT5, test x$fsect = x5)
AC_SUBST(WARNINGS)
AC_GNU_SOURCE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
AM_PROG_CC_C_O
AC_C_BIGENDIAN
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_LIBTOOL
LT_INIT([disable-static pic-only])
gl_VISIBILITY
dnl Checks for headers
AC_HEADER_STDC
AC_HEADER_MAJOR
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(stdint.h fcntl.h locale.h stdint.h inttypes.h unistd.h)
AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
AC_CHECK_HEADERS(getopt.h err.h)
AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
AC_CHECK_HEADERS(zlib.h)
@@ -91,45 +92,26 @@ AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_STRUCT_TM
AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct tm.tm_zone])
AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
AC_STRUCT_TIMEZONE
AC_STRUCT_TIMEZONE_DAYLIGHT
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_TYPE_MBSTATE_T
AC_STRUCT_OPTION_GETOPT_H
AC_CHECK_TYPES([pid_t, uint8_t, uint16_t, uint32_t, int32_t, uint64_t, int64_t])
AC_CHECK_SIZEOF(long long)
AH_BOTTOM([
#ifndef HAVE_UINT8_T
typedef unsigned char uint8_t;
#endif
#ifndef HAVE_UINT16_T
typedef unsigned short uint16_t;
#endif
#ifndef HAVE_UINT32_T
typedef unsigned int uint32_t;
#endif
#ifndef HAVE_INT32_T
typedef int int32_t;
#endif
#ifndef HAVE_UINT64_T
#if SIZEOF_LONG_LONG == 8
typedef unsigned long long uint64_t;
#else
typedef unsigned long uint64_t;
#endif
#endif
#ifndef HAVE_INT64_T
#if SIZEOF_LONG_LONG == 8
typedef long long int64_t;
#else
typedef long int64_t;
#endif
#endif
])
AC_TYPE_PID_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_INT32_T
AC_TYPE_UINT64_T
AC_TYPE_INT64_T
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T
AC_FUNC_MMAP
AC_FUNC_FORK
AC_FUNC_MBRTOWC
AC_MSG_CHECKING(for gcc compiler warnings)
AC_ARG_ENABLE(warnings,
@@ -156,10 +138,10 @@ else
fi])
dnl Checks for functions
AC_CHECK_FUNCS(mmap strerror strndup strtoul mbrtowc mkstemp utimes utime wcwidth strtof fork)
AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
dnl Provide implementation of some required functions if necessary
AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline)
AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r pread strcasestr fmtcheck)
dnl Checks for libraries
AC_CHECK_LIB(z,gzopen)
+791
View File
@@ -0,0 +1,791 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <[email protected]>.
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <[email protected]>.
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
+32
View File
@@ -0,0 +1,32 @@
MAGIC = $(pkgdatadir)/magic
if FSECT5
man_MAGIC = magic.5
else
man_MAGIC = magic.4
endif
fsect = @fsect@
man_MANS = file.1 $(man_MAGIC) libmagic.3
EXTRA_DIST = file.man magic.man libmagic.man
CLEANFILES = $(man_MANS)
file.1: Makefile file.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
magic.${fsect}: Makefile magic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
libmagic.3: Makefile libmagic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
+669
View File
@@ -0,0 +1,669 @@
# Makefile.in generated by automake 1.14 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2013 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = doc
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" \
"$(DESTDIR)$(man4dir)" "$(DESTDIR)$(man5dir)"
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
NROFF = nroff
MANS = $(man_MANS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgdatadir = @pkgdatadir@
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_VISIBILITY = @HAVE_VISIBILITY@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MINGW = @MINGW@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WARNINGS = @WARNINGS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
fsect = @fsect@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAGIC = $(pkgdatadir)/magic
@FSECT5_FALSE@man_MAGIC = magic.4
@FSECT5_TRUE@man_MAGIC = magic.5
man_MANS = file.1 $(man_MAGIC) libmagic.3
EXTRA_DIST = file.man magic.man libmagic.man
CLEANFILES = $(man_MANS)
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign doc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-man3: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man3dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.3[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \
done; }
uninstall-man3:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man3dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.3[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir)
install-man4: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man4dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man4dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man4dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.4[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^4][0-9a-z]*$$,4,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man4dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man4dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man4dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man4dir)" || exit $$?; }; \
done; }
uninstall-man4:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man4dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.4[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^4][0-9a-z]*$$,4,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man4dir)'; $(am__uninstall_files_from_dir)
install-man5: $(man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(man_MANS)'; \
test -n "$(man5dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.5[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
done; }
uninstall-man5:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man5dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.5[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man4dir)" "$(DESTDIR)$(man5dir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1 install-man3 install-man4 install-man5
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-man
uninstall-man: uninstall-man1 uninstall-man3 uninstall-man4 \
uninstall-man5
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-man1 install-man3 install-man4 install-man5 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am uninstall-man uninstall-man1 \
uninstall-man3 uninstall-man4 uninstall-man5
file.1: Makefile file.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/file.man > $@
magic.${fsect}: Makefile magic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/magic.man > $@
libmagic.3: Makefile libmagic.man
@rm -f $@
sed -e s@__CSECTION__@1@g \
-e s@__FSECTION__@${fsect}@g \
-e s@__VERSION__@${VERSION}@g \
-e s@__MAGIC__@${MAGIC}@g $(srcdir)/libmagic.man > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
@@ -1,5 +1,5 @@
.\" $File: file.man,v 1.98 2011/12/08 12:12:46 rrt Exp $
.Dd October 17, 2011
.\" $File: file.man,v 1.111 2014/12/16 23:18:40 christos Exp $
.Dd December 16, 2014
.Dt FILE __CSECTION__
.Os
.Sh NAME
@@ -8,7 +8,7 @@
.Sh SYNOPSIS
.Nm
.Bk -words
.Op Fl bchiklLNnprsvz0
.Op Fl bcEhiklLNnprsvz0
.Op Fl Fl apple
.Op Fl Fl mime-encoding
.Op Fl Fl mime-type
@@ -16,6 +16,7 @@
.Op Fl F Ar separator
.Op Fl f Ar namefile
.Op Fl m Ar magicfiles
.Op Fl P Ar name=value
.Ar
.Ek
.Nm
@@ -164,6 +165,10 @@ in any of the character sets listed above is simply said to be
.Dq data .
.Sh OPTIONS
.Bl -tag -width indent
.It Fl Fl apple
Causes the file command to output the file type and creator code as
used by older MacOS versions. The code consists of eight letters,
the first describing the file type, the latter the creator.
.It Fl b , Fl Fl brief
Do not prepend filenames to output lines (brief mode).
.It Fl C , Fl Fl compile
@@ -175,6 +180,10 @@ Cause a checking printout of the parsed form of the magic file.
This is usually used in conjunction with the
.Fl m
flag to debug a new magic file before installing it.
.It Fl E
On filesystem errors (file not found etc), instead of handling the error
as regular output as POSIX mandates and keep going, issue an error message
and exit.
.It Fl e , Fl Fl exclude Ar testname
Exclude the test named in
.Ar testname
@@ -259,8 +268,16 @@ prepended.
(If you want a newline, see the
.Fl r
option.)
The magic pattern with the highest strength (see the
.Fl l
option) comes first.
.It Fl l , Fl Fl list
Print information about the strength of each magic pattern.
Shows a list of patterns and their strength sorted descending by
.Xr magic 4
strength
which is used for the matching (see also the
.Fl k
option).
.It Fl L , Fl Fl dereference
option causes symlinks to be followed, as the like-named option in
.Xr ls 1
@@ -268,8 +285,6 @@ option causes symlinks to be followed, as the like-named option in
This is the default if the environment variable
.Ev POSIXLY_CORRECT
is defined.
.It Fl l
Shows sorted patterns list in the order which is used for the matching.
.It Fl m , Fl Fl magic-file Ar magicfiles
Specify an alternate list of files and directories containing magic.
This can be a single item, or a colon-separated list.
@@ -289,6 +304,16 @@ or
attempt to preserve the access time of files analyzed, to pretend that
.Nm
never read them.
.It Fl P , Fl Fl parameter Ar name=value
Set various parameter limits.
.Bl -column "elf_phnum" "Default" "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -offset indent
.It Sy "Name" Ta Sy "Default" Ta Sy "Explanation"
.It Li indir Ta 15 Ta recursion limit for indirect magic
.It Li name Ta 30 Ta use count limit for name/use magic
.It Li elf_notes Ta 256 Ta max ELF notes processed
.It Li elf_phnum Ta 128 Ta max ELF program sections processed
.It Li elf_shnum Ta 32768 Ta max ELF sections processed
.El
.It Fl r , Fl Fl raw
Don't translate unprintable characters to \eooo.
Normally
@@ -325,7 +350,7 @@ after the end of the filename.
Nice to
.Xr cut 1
the output.
This does not affect the separator which is still printed.
This does not affect the separator, which is still printed.
.It Fl -help
Print a help message and exit.
.El
@@ -547,20 +572,27 @@ returns 0 on success, and non-zero on error.
Please report bugs and send patches to the bug tracker at
.Pa http://bugs.gw.com/
or the mailing list at
.Aq [email protected] .
.Aq [email protected]
(visit
.Pa http://mx.gw.com/mailman/listinfo/file
first to subscribe).
.Sh TODO
.Pp
Fix output so that tests for MIME and APPLE flags are not needed all
over the place, and actual output is only done in one place. This
needs a design. Suggestion: push possible outputs on to a list, then
pick the last-pushed (most specific, one hopes) value at the end, or
use a default if the list is empty. This should not slow down evaluation.
over the place, and actual output is only done in one place.
This needs a design.
Suggestion: push possible outputs on to a list, then pick the
last-pushed (most specific, one hopes) value at the end, or
use a default if the list is empty.
This should not slow down evaluation.
.Pp
Continue to squash all magic bugs. See Debian BTS for a good source.
Continue to squash all magic bugs.
See Debian BTS for a good source.
.Pp
Store arbitrarily long strings, for example for %s patterns, so that
they can be printed out. Fixes Debian bug #271672. Would require more
complex store/load code in apprentice.
they can be printed out.
Fixes Debian bug #271672.
Would require more complex store/load code in apprentice.
.Pp
Add syntax for relative offsets after current level (Debian bug #466037).
.Pp
@@ -570,6 +602,30 @@ Add a zip library so we can peek inside Office2007 documents to
figure out what they are.
.Pp
Add an option to print URLs for the sources of the file descriptions.
.Pp
Combine script searches and add a way to map executable names to MIME
types (e.g. have a magic value for !:mime which causes the resulting
string to be looked up in a table).
This would avoid adding the same magic repeatedly for each new
hash-bang interpreter.
.Pp
Fix
.Dq name
and
.Dq use
to check for consistency at compile time (duplicate
.Dq name ,
.Dq use
pointing to undefined
.Dq name
).
Make
.Dq name
/
.Dq use
more efficient by keeping a sorted list of names.
Special-case ^ to flip endianness in the parser so that it does not
have to be escaped, and document it.
.Sh AVAILABILITY
You can obtain the original author's latest version by anonymous FTP
on
@@ -1,4 +1,4 @@
.\" $File: libmagic.man,v 1.26 2011/12/19 17:49:31 christos Exp $
.\" $File: libmagic.man,v 1.34 2014/12/16 23:18:40 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
@@ -25,19 +25,25 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd December 19, 2011
.Dd December 16, 2014
.Dt LIBMAGIC 3
.Os
.Sh NAME
.Nm magic_open ,
.Nm magic_close ,
.Nm magic_error ,
.Nm magic_errno ,
.Nm magic_descriptor ,
.Nm magic_buffer ,
.Nm magic_setflags ,
.Nm magic_check ,
.Nm magic_compile ,
.Nm magic_load
.Nm magic_list ,
.Nm magic_load ,
.Nm magic_load_buffers ,
.Nm magic_setparam ,
.Nm magic_getparam ,
.Nm magic_version
.Nd Magic number recognition library
.Sh LIBRARY
.Lb libmagic
@@ -67,6 +73,14 @@
.Fn magic_list "magic_t cookie" "const char *filename"
.Ft int
.Fn magic_load "magic_t cookie" "const char *filename"
.Ft int
.Fn magic_load_buffers "magic_t cookie" "void **buffers" "size_t *sizes" "size_t nbuffers"
.Ft int
.Fn magic_getparam "magic_t cookie" "int param" "void *value"
.Ft int
.Fn magic_setparam "magic_t cookie" "int param" "const void *value"
.Ft int
.Fn magic_version "void"
.Sh DESCRIPTION
These functions
operate on the magic database file
@@ -246,6 +260,70 @@ If that variable is not set, the default database file name is __MAGIC__.
adds
.Dq .mgc
to the database filename as appropriate.
.Pp
The
.Fn magic_load_buffers
function takes an array of size
.Fa nbuffers
of
.Fa buffers
with a respective size for each in the array of
.Fa sizes
loaded with the contents of the magic databases from the filesystem.
This function can be used in environment where the magic library does
not have direct access to the filesystem, but can access the magic
database via shared memory or other IPC means.
.Pp
The
.Fn magic_getparam
and
.Fn magic_setparam
allow getting and setting various limits related to the the magic
library.
.Bl -column "MAGIC_PARAM_ELF_PHNUM_MAX" "size_t" "Default" -offset indent
.It Sy "Parameter" Ta Sy "Type" Ta Sy "Default"
.It Li MAGIC_PARAM_INDIR_MAX Ta size_t Ta 15
.It Li MAGIC_PARAM_NAME_MAX Ta size_t Ta 30
.It Li MAGIC_PARAM_ELF_NOTES_MAX Ta size_t Ta 256
.It Li MAGIC_PARAM_ELF_PHNUM_MAX Ta size_t Ta 128
.It Li MAGIC_PARAM_ELF_SHNUM_MAX Ta size_t Ta 32768
.El
.Pp
The
.Dv MAGIC_PARAM_INDIR_RECURSION
parameter controls how many levels of recursion will be followed for
indirect magic entries.
.Pp
The
.Dv MAGIC_PARAM_NAME_RECURSION
parameter controls how many levels of recursion will be followed for
for name/use calls.
.Pp
The
.Dv MAGIC_PARAM_NAME_MAX
parameter controls the maximum number of calls for name/use.
.Pp
The
.Dv MAGIC_PARAM_NOTES_MAX
parameter controls how many ELF notes will be processed.
.Pp
The
.Dv MAGIC_PARAM_PHNUM_MAX
parameter controls how many ELF program sections will be processed.
.Pp
The
.Dv MAGIC_PARAM_SHNUM_MAX
parameter controls how many ELF sections will be processed.
.Pp
The
.Fn magic_version
command returns the version number of this library which is compiled into
the shared library using the constant
.Dv MAGIC_VERSION
from
.In magic.h .
This can be used by client programs to verify that the version they compile
against is the same as the version that they run against.
.Sh RETURN VALUES
The function
.Fn magic_open
@@ -276,6 +354,9 @@ function returns a textual description of the errors of the above
functions, or
.Dv NULL
if there was no error.
The
.Fn magic_version
always returns the version number of the library.
Finally,
.Fn magic_setflags
returns \-1 on systems that don't support
@@ -1,5 +1,5 @@
.\" $File: magic.man,v 1.71 2011/12/07 11:58:24 rrt Exp $
.Dd April 20, 2011
.\" $File: magic.man,v 1.85 2015/01/01 17:07:34 christos Exp $
.Dd January 1, 2015
.Dt MAGIC __FSECTION__
.Os
.\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
@@ -51,7 +51,7 @@ A 64-bit double precision IEEE floating point number in this machine's native by
.It Dv string
A string of bytes.
The string type specification can be optionally followed
by /[WwcCtb]*.
by /[WwcCtbT]*.
The
.Dq W
flag compacts whitespace in the target, which must
@@ -85,8 +85,12 @@ The
flag forces the test to be done for text files, while the
.Dq b
flag forces the test to be done for binary files.
The
.Dq T
flag causes the string to be trimmed, i.e. leading and trailing whitespace
is deleted before the string is printed.
.It Dv pstring
A Pascal-style string where the first byte/short/int is interpreted as the an
A Pascal-style string where the first byte/short/int is interpreted as the
unsigned length.
The length defaults to byte and can be specified as a modifier.
The following modifiers are supported:
@@ -121,6 +125,8 @@ local time rather than UTC.
.It Dv qldate
An eight-byte value interpreted as a UNIX-style date, but interpreted as
local time rather than UTC.
.It Dv qwdate
An eight-byte value interpreted as a Windows-style date.
.It Dv beid3
A 32-bit ID3 length in big-endian byte order.
.It Dv beshort
@@ -147,6 +153,9 @@ than UTC.
An eight-byte value in big-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv beqwdate
An eight-byte value in big-endian byte order,
interpreted as a Windows-style date.
.It Dv bestring16
A two-byte unicode (UCS16) string in big-endian byte order.
.It Dv leid3
@@ -175,6 +184,9 @@ than UTC.
An eight-byte value in little-endian byte order,
interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv leqwdate
An eight-byte value in little-endian byte order,
interpreted as a Windows-style date.
.It Dv lestring16
A two-byte unicode (UCS16) string in little-endian byte order.
.It Dv melong
@@ -188,6 +200,32 @@ interpreted as a UNIX-style date, but interpreted as local time rather
than UTC.
.It Dv indirect
Starting at the given offset, consult the magic database again.
The offset of th
.Dv indirect
magic is by default absolute in the file, but one can specify
.Dv /r
to indicate that the offset is relative from the beginning of the entry.
.It Dv name
Define a
.Dq named
magic instance that can be called from another
.Dv use
magic entry, like a subroutine call.
Named instance direct magic offsets are relative to the offset of the
previous matched entry, but indirect offsets are relative to the beginning
of the file as usual.
Named magic entries always match.
.It Dv use
Recursively call the named magic starting from the current offset.
If the name of the referenced begins with a
.Dv ^
then the endianness of the magic is switched; if the magic mentioned
.Dv leshort
for example,
it is treated as
.Dv beshort
and vice versa.
This is useful to avoid duplicating the rules for different endianness.
.It Dv regex
A regular expression match in extended POSIX regular expression syntax
(like egrep).
@@ -195,19 +233,25 @@ Regular expressions can take exponential time to process, and their
performance is hard to predict, so their use is discouraged.
When used in production environments, their performance
should be carefully checked.
The type specification can be optionally followed by
.Dv /[c][s] .
The size of the string to search should also be limited by specifying
.Dv /<length> ,
to avoid performance issues scanning long files.
The type specification can also be optionally followed by
.Dv /[c][s][l] .
The
.Dq c
flag makes the match case insensitive, while the
.Dq s
flag update the offset to the start offset of the match, rather than the end.
The regular expression is tested against line
.Dv N + 1
onwards, where
.Dv N
is the given offset.
Line endings are assumed to be in the machine's native format.
The
.Dq l
modifier, changes the limit of length to mean number of lines instead of a
byte count.
Lines are delimited by the platforms native line delimiter.
When a line count is specified, an implicit byte count also computed assuming
each line is 80 characters long.
If neither a byte or line count is specified, the search is limited automatically
to 8KiB.
.Dv ^
and
.Dv $
@@ -216,22 +260,91 @@ not beginning and end of file.
.It Dv search
A literal string search starting at the given offset.
The same modifier flags can be used as for string patterns.
The modifier flags (if any) must be followed by
.Dv /number
the range, that is, the number of positions at which the match will be
The search expression must contain the range in the form
.Dv /number,
that is the number of positions at which the match will be
attempted, starting from the start offset.
This is suitable for
searching larger binary expressions with variable offsets, using
.Dv \e
escapes for special characters.
The offset works as for regex.
The order of modifier and number is not relevant.
.It Dv default
This is intended to be used with the test
.Em x
(which is always true) and a message that is to be used if there are
no other matches.
(which is always true) and it has no type.
It matches when no other test at that continuation level has matched before.
Clearing that matched tests for a continuation level, can be done using the
.Dv clear
test.
.It Dv clear
This test is always true and clears the match flag for that continuation level.
It is intended to be used with the
.Dv default
test.
.El
.Pp
For compatibility with the Single
.Ux
Standard, the type specifiers
.Dv dC
and
.Dv d1
are equivalent to
.Dv byte ,
the type specifiers
.Dv uC
and
.Dv u1
are equivalent to
.Dv ubyte ,
the type specifiers
.Dv dS
and
.Dv d2
are equivalent to
.Dv short ,
the type specifiers
.Dv uS
and
.Dv u2
are equivalent to
.Dv ushort ,
the type specifiers
.Dv dI ,
.Dv dL ,
and
.Dv d4
are equivalent to
.Dv long ,
the type specifiers
.Dv uI ,
.Dv uL ,
and
.Dv u4
are equivalent to
.Dv ulong ,
the type specifier
.Dv d8
is equivalent to
.Dv quad ,
the type specifier
.Dv u8
is equivalent to
.Dv uquad ,
and the type specifier
.Dv s
is equivalent to
.Dv string .
In addition, the type specifier
.Dv dQ
is equivalent to
.Dv quad
and the type specifier
.Dv uQ
is equivalent to
.Dv uquad .
.Pp
Each top-level magic pattern (see below for an explanation of levels)
is classified as text or binary according to the types used.
Types
@@ -307,6 +420,9 @@ is octal, and
.Dv 0x13
is hexadecimal.
.Pp
Numeric operations are not performed on date types, instead the numeric
value is interpreted as an offset.
.Pp
For string values, the string from the
file must match the specified string.
The operators
@@ -324,6 +440,9 @@ then print the string), with
.Em \*[Gt]\e0
(because all non-empty strings are greater than the empty string).
.Pp
Dates are treated as numerical values in the respective internal
representation.
.Pp
The special test
.Em x
always evaluates to true.
@@ -511,7 +630,7 @@ Or even both!
\*[Gt]\*[Gt]\*[Gt]\*[Am](\*[Am]0x54.l-3) string UNACE \eb, ACE self-extracting archive
.Ed
.Pp
Finally, if you have to deal with offset/length pairs in your file, even the
If you have to deal with offset/length pairs in your file, even the
second value in a parenthesized expression can be taken from the file itself,
using another set of parentheses.
Note that this additional indirect offset is always relative to the
@@ -526,6 +645,18 @@ start of the main indirect offset.
# these are located 14 and 10 bytes after the section name
\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive
.Ed
.Pp
If you have a list of known avalues at a particular continuation level,
and you want to provide a switch-like default case:
.Bd -literal -offset indent
# clear that continuation level match
\*[Gt]18 clear
\*[Gt]18 lelong 1 one
\*[Gt]18 lelong 2 two
\*[Gt]18 default x
# print default match
\*[Gt]\*[Gt]18 lelong x unmatched 0x%x
.Ed
.Sh SEE ALSO
.Xr file __CSECTION__
\- the command that reads this file.
@@ -537,19 +668,41 @@ The formats
.Dv melong ,
.Dv short ,
.Dv beshort ,
.Dv leshort ,
.Dv date ,
.Dv bedate ,
.Dv medate ,
.Dv ledate ,
.Dv beldate ,
.Dv leldate ,
and
.Dv meldate
are system-dependent; perhaps they should be specified as a number
of bytes (2B, 4B, etc),
since the files being recognized typically come from
a system on which the lengths are invariant.
.Dv leshort
do not depend on the length of the C data types
.Dv short
and
.Dv long
on the platform, even though the Single
.Ux
Specification implies that they do. However, as OS X Mountain Lion has
passed the Single
.Ux
Specification validation suite, and supplies a version of
.Xr file __CSECTION__
in which they do not depend on the sizes of the C data types and that is
built for a 64-bit environment in which
.Dv long
is 8 bytes rather than 4 bytes, presumably the validation suite does not
test whether, for example
.Dv long
refers to an item with the same size as the C data type
.Dv long .
There should probably be
.Dv type
names
.Dv int8 ,
.Dv uint8 ,
.Dv int16 ,
.Dv uint16 ,
.Dv int32 ,
.Dv uint32 ,
.Dv int64 ,
and
.Dv uint64 ,
and specified-byte-order variants of them,
to make it clearer that those types have specified widths.
.\"
.\" From: [email protected] (Guy Harris)
.\" Newsgroups: net.bugs.usg
+12 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: install-sh.in,v 1.5 2010/10/08 19:57:05 tez Exp $
# $NetBSD: install-sh.in,v 1.6 2012/01/11 13:07:31 hans Exp $
# This script now also installs multiple files, but might choke on installing
# multiple files with spaces in the file names.
#
@@ -45,6 +45,7 @@ rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
instcmd="$cpprog"
instflags=""
pathcompchmodcmd="$chmodprog 755"
chmodcmd="$chmodprog 755"
chowncmd=""
@@ -84,6 +85,11 @@ while [ x"$1" != x ]; do
shift
continue;;
-m*)
chmodcmd="$chmodprog ${1#-m}"
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
@@ -104,6 +110,10 @@ while [ x"$1" != x ]; do
shift
continue;;
-p) instflags="-p"
shift
continue;;
*) if [ x"$msrc" = x ]
then
msrc="$dst"
@@ -154,7 +164,7 @@ else
if [ -f "$srcarg" ]
then
doinst="$instcmd"
doinst="$instcmd $instflags"
elif [ -d "$srcarg" ]
then
echo "install: $srcarg: not a regular file"
+9664
View File
File diff suppressed because it is too large. Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: adventure,v 1.13 2010/12/31 16:32:54 christos Exp $
# $File: adventure,v 1.14 2012/06/21 01:32:26 christos Exp $
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <[email protected]>
@@ -33,10 +33,14 @@
#
0 ubyte >0
>0 ubyte <9
>>16 belong&0xfe00f0f0 0x3030 Infocom game data
>>>0 ubyte x (Z-machine %d,
>>>>2 ubeshort x Release %d /
>>>>18 string >\0 Serial %.6s)
>>16 belong&0xfe00f0f0 0x3030
>>>0 ubyte < 10
>>>>2 ubeshort < 10
>>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9]
>>>>>>0 ubyte < 10 Infocom (Z-machine %d,
>>>>>>>2 ubeshort < 10 Release %d /
>>>>>>>>18 string >\0 Serial %.6s)
!:strength + 40
#------------------------------------------------------------------------------
# Glulx: file(1) magic for Glulx binaries.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: amigaos,v 1.14 2009/09/19 16:28:07 christos Exp $
# $File: amigaos,v 1.15 2012/06/21 01:13:59 christos Exp $
# amigaos: file(1) magic for AmigaOS binary formats:
#
@@ -63,3 +63,6 @@
# From: Alex Beregszaszi <[email protected]>
0 string LZX LZX compressed archive (Amiga)
# From: Przemek Kramarczyk <[email protected]>
0 string .KEY AmigaDOS script
0 string .key AmigaDOS script
+139
View File
@@ -0,0 +1,139 @@
#------------------------------------------------------------
# $File: android,v 1.7 2014/11/10 05:08:23 christos Exp $
# Various android related magic entries
#------------------------------------------------------------
# Dalvik .dex format. http://retrodev.com/android/dexformat.html
# From <[email protected]> "Mike Fleming"
# Fixed to avoid regexec 17 errors on some dex files
# From <[email protected]> "Tim Strazzere"
0 string dex\n
>0 regex dex\n[0-9]{2}\0 Dalvik dex file
>4 string >000 version %s
0 string dey\n
>0 regex dey\n[0-9]{2}\0 Dalvik dex file (optimized for host)
>4 string >000 version %s
# Android bootimg format
# From https://android.googlesource.com/\
# platform/system/core/+/master/mkbootimg/bootimg.h
0 string ANDROID! Android bootimg
>1024 string LOKI\01 \b, LOKI'd
>8 lelong >0 \b, kernel
>>12 lelong >0 \b (0x%x)
>16 lelong >0 \b, ramdisk
>>20 lelong >0 \b (0x%x)
>24 lelong >0 \b, second stage
>>28 lelong >0 \b (0x%x)
>36 lelong >0 \b, page size: %d
>38 string >0 \b, name: %s
>64 string >0 \b, cmdline (%s)
# Android Backup archive
# From: Ariel Shkedi
# File extension: .ab
# No mime-type defined
# URL: https://github.com/android/platform_frameworks_base/blob/\
# 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
# android/server/BackupManagerService.java#L2367
# After the header comes a tar file
# If compressed, the entire tar file is compressed with JAVA deflate
#
# Include the version number hardcoded with the magic string to avoid
# false positives
0 string/b ANDROID\ BACKUP\n1\n Android Backup
>17 string 0\n \b, Not-Compressed
>17 string 1\n \b, Compressed
# any string as long as it's not the word none (which is matched below)
>>19 regex/1l \^([^n\n]|n[^o]|no[^n]|non[^e]|none.+).* \b, Encrypted (%s)
>>19 string none\n \b, Not-Encrypted
# Commented out because they don't seem useful to print
# (but they are part of the header - the tar file comes after them):
#>>>&1 regex/1l .* \b, Password salt: %s
#>>>>&1 regex/1l .* \b, Master salt: %s
#>>>>>&1 regex/1l .* \b, PBKDF2 rounds: %s
#>>>>>>&1 regex/1l .* \b, IV: %s
#>>>>>>>&1 regex/1l .* \b, Key: %s
# *.pit files by Joerg Jenderek
# http://forum.xda-developers.com/showthread.php?p=9122369
# http://forum.xda-developers.com/showthread.php?t=816449
# Partition Information Table for Samsung's smartphone with Android
# used by flash software Odin
0 ulelong 0x12349876
# 1st pit entry marker
>0x01C ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000
# minimal 13 and maximal 18 PIT entries found
>>4 ulelong <128 Partition Information Table for Samsung smartphone
>>>4 ulelong x \b, %d entries
# 1. pit entry
>>>4 ulelong >0 \b; #1
>>>0x01C use PIT-entry
>>>4 ulelong >1 \b; #2
>>>0x0A0 use PIT-entry
>>>4 ulelong >2 \b; #3
>>>0x124 use PIT-entry
>>>4 ulelong >3 \b; #4
>>>0x1A8 use PIT-entry
>>>4 ulelong >4 \b; #5
>>>0x22C use PIT-entry
>>>4 ulelong >5 \b; #6
>>>0x2B0 use PIT-entry
>>>4 ulelong >6 \b; #7
>>>0x334 use PIT-entry
>>>4 ulelong >7 \b; #8
>>>0x3B8 use PIT-entry
>>>4 ulelong >8 \b; #9
>>>0x43C use PIT-entry
>>>4 ulelong >9 \b; #10
>>>0x4C0 use PIT-entry
>>>4 ulelong >10 \b; #11
>>>0x544 use PIT-entry
>>>4 ulelong >11 \b; #12
>>>0x5C8 use PIT-entry
>>>4 ulelong >12 \b; #13
>>>>0x64C use PIT-entry
# 14. pit entry
>>>4 ulelong >13 \b; #14
>>>>0x6D0 use PIT-entry
>>>4 ulelong >14 \b; #15
>>>0x754 use PIT-entry
>>>4 ulelong >15 \b; #16
>>>0x7D8 use PIT-entry
>>>4 ulelong >16 \b; #17
>>>0x85C use PIT-entry
# 18. pit entry
>>>4 ulelong >17 \b; #18
>>>0x8E0 use PIT-entry
0 name PIT-entry
# garbage value implies end of pit entries
>0x00 ulequad&0xFFFFFFFCFFFFFFFC =0x0000000000000000
# skip empty partition name
>>0x24 ubyte !0
# partition name
>>>0x24 string >\0 %-.32s
# flags
>>>0x0C ulelong&0x00000002 2 \b+RW
# partition ID:
# 0~IPL,MOVINAND,GANG;1~PIT,GPT;2~HIDDEN;3~SBL,HIDDEN;4~SBL2,HIDDEN;5~BOOT;6~KENREl,RECOVER,misc;7~RECOVER
# ;11~MODEM;20~efs;21~PARAM;22~FACTORY,SYSTEM;23~DBDATAFS,USERDATA;24~CACHE;80~BOOTLOADER;81~TZSW
>>>0x08 ulelong x (0x%x)
# filename
>>>0x44 string >\0 "%-.64s"
#>>>0x18 ulelong >0
# blocksize in 512 byte units ?
#>>>>0x18 ulelong x \b, %db
# partition size in blocks ?
#>>>>0x22 ulelong x \b*%d
# Android bootimg format
# From https://android.googlesource.com/\
# platform/system/core/+/master/libsparse/sparse_format.h
0 lelong 0xed26ff3a Android sparse image
>4 leshort x \b, version: %d
>6 leshort x \b.%d
>16 lelong x \b, Total of %d
>12 lelong x \b %d-byte output blocks in
>20 lelong x \b %d input chunks.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: animation,v 1.45 2011/09/06 11:00:06 christos Exp $
# $File: animation,v 1.56 2014/10/23 23:12:51 christos Exp $
# animation: file(1) magic for animation/movie formats
#
# animation formats
@@ -32,43 +32,155 @@
!:mime application/x-quicktime-player
4 string/W jP JPEG 2000 image
!:mime image/jp2
# http://www.ftyps.com/ with local additions
4 string ftyp ISO Media
>8 string isom \b, MPEG v4 system, version 1
!:mime video/mp4
>8 string iso2 \b, MPEG v4 system, part 12 revision
>8 string mp41 \b, MPEG v4 system, version 1
!:mime video/mp4
>8 string mp42 \b, MPEG v4 system, version 2
!:mime video/mp4
>8 string mp7t \b, MPEG v4 system, MPEG v7 XML
>8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
>8 string/W jp2 \b, JPEG 2000
!:mime image/jp2
>8 string 3ge \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>8 string 3gg \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>8 string 3gp \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>8 string 3gs \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>8 string 3g2 \b, MPEG v4 system, 3GPP2
!:mime video/3gpp2
>>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
>>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
>>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
>8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
!:mime video/mp4
>8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC
>>11 byte a \b C.S0050-0 V1.0
>>11 byte b \b C.S0050-0-A V1.0.0
>>11 byte c \b C.S0050-0-B V1.0
>8 string 3ge \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>8 string/W M4A \b, MPEG v4 system, iTunes AAC-LC
!:mime audio/mp4
>8 string/W M4V \b, MPEG v4 system, iTunes AVC-LC
>>11 byte 6 \b, Release 6 MBMS Extended Presentations
>>11 byte 7 \b, Release 7 MBMS Extended Presentations
>8 string 3gg \b, MPEG v4 system, 3GPP
>11 byte 6 \b, Release 6 General Profile
!:mime video/3gpp
>8 string 3gp \b, MPEG v4 system, 3GPP
>11 byte 1 \b, Release %d (non existent)
>11 byte 2 \b, Release %d (non existent)
>11 byte 3 \b, Release %d (non existent)
>11 byte 4 \b, Release %d
>11 byte 5 \b, Release %d
>11 byte 6 \b, Release %d
>11 byte 7 \b, Release %d Streaming Servers
!:mime video/3gpp
>8 string 3gs \b, MPEG v4 system, 3GPP
>11 byte 7 \b, Release %d Streaming Servers
!:mime video/3gpp
>8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC [ISO 14496-12:2005]
!:mime video/mp4
>8 string/W M4P \b, MPEG v4 system, iTunes AES encrypted
>8 string/W M4B \b, MPEG v4 system, iTunes bookmarked
>8 string/W qt \b, Apple QuickTime movie
!:mime video/quicktime
>8 string CAEP \b, Canon Digital Camera
>8 string caqv \b, Casio Digital Camera
>8 string CDes \b, Convergent Design
>8 string da0a \b, DMB MAF w/ MPEG Layer II aud, MOT slides, DLS, JPG/PNG/MNG
>8 string da0b \b, DMB MAF, ext DA0A, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string da1a \b, DMB MAF audio with ER-BSAC audio, JPG/PNG/MNG images
>8 string da1b \b, DMB MAF, ext da1a, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string da2a \b, DMB MAF aud w/ HE-AAC v2 aud, MOT slides, DLS, JPG/PNG/MNG
>8 string da2b \b, DMB MAF, ext da2a, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string da3a \b, DMB MAF aud with HE-AAC aud, JPG/PNG/MNG images
>8 string da3b \b, DMB MAF, ext da3a w/ BIFS, 3GPP, DID, TVA, REL, IPMP
>8 string dmb1 \b, DMB MAF supporting all the components defined in the spec
>8 string dmpf \b, Digital Media Project
>8 string drc1 \b, Dirac (wavelet compression), encap in ISO base media (MP4)
>8 string dv1a \b, DMB MAF vid w/ AVC vid, ER-BSAC aud, BIFS, JPG/PNG/MNG, TS
>8 string dv1b \b, DMB MAF, ext dv1a, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string dv2a \b, DMB MAF vid w/ AVC vid, HE-AAC v2 aud, BIFS, JPG/PNG/MNG, TS
>8 string dv2b \b, DMB MAF, ext dv2a, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string dv3a \b, DMB MAF vid w/ AVC vid, HE-AAC aud, BIFS, JPG/PNG/MNG, TS
>8 string dv3b \b, DMB MAF, ext dv3a, with 3GPP timed text, DID, TVA, REL, IPMP
>8 string dvr1 \b, DVB (.DVB) over RTP
!:mime video/vnd.dvb.file
>8 string dvt1 \b, DVB (.DVB) over MPEG-2 Transport Stream
!:mime video/vnd.dvb.file
>8 string F4V \b, Video for Adobe Flash Player 9+ (.F4V)
!:mime video/mp4
>8 string F4P \b, Protected Video for Adobe Flash Player 9+ (.F4P)
!:mime video/mp4
>8 string F4A \b, Audio for Adobe Flash Player 9+ (.F4A)
!:mime audio/mp4
>8 string F4B \b, Audio Book for Adobe Flash Player 9+ (.F4B)
!:mime audio/mp4
>8 string isc2 \b, ISMACryp 2.0 Encrypted File
# ?/enc-isoff-generic
>8 string iso2 \b, MP4 Base Media v2 [ISO 14496-12:2005]
!:mime video/mp4
>8 string isom \b, MP4 Base Media v1 [IS0 14496-12:2003]
!:mime video/mp4
>8 string/W jp2 \b, JPEG 2000
!:mime image/jp2
>8 string JP2 \b, JPEG 2000 Image (.JP2) [ISO 15444-1 ?]
!:mime image/jp2
>8 string JP20 \b, Unknown, from GPAC samples (prob non-existent)
>8 string jpm \b, JPEG 2000 Compound Image (.JPM) [ISO 15444-6]
!:mime image/jpm
>8 string jpx \b, JPEG 2000 w/ extensions (.JPX) [ISO 15444-2]
!:mime image/jpx
>8 string KDDI \b, 3GPP2 EZmovie for KDDI 3G cellphones
!:mime video/3gpp2
>8 string M4A \b, Apple iTunes ALAC/AAC-LC (.M4A) Audio
!:mime audio/x-m4a
>8 string M4B \b, Apple iTunes ALAC/AAC-LC (.M4B) Audio Book
!:mime audio/mp4
>8 string M4P \b, Apple iTunes ALAC/AAC-LC (.M4P) AES Protected Audio
!:mime video/mp4
>8 string M4V \b, Apple iTunes Video (.M4V) Video
!:mime video/x-m4v
>8 string M4VH \b, Apple TV (.M4V)
!:mime video/x-m4v
>8 string M4VP \b, Apple iPhone (.M4V)
!:mime video/x-m4v
>8 string mj2s \b, Motion JPEG 2000 [ISO 15444-3] Simple Profile
!:mime video/mj2
>8 string mjp2 \b, Motion JPEG 2000 [ISO 15444-3] General Profile
!:mime video/mj2
>8 string mmp4 \b, MPEG-4/3GPP Mobile Profile (.MP4 / .3GP) (for NTT)
!:mime video/mp4
>8 string mobi \b, MPEG-4, MOBI format
!:mime video/mp4
>8 string mp21 \b, MPEG-21 [ISO/IEC 21000-9]
>8 string mp41 \b, MP4 v1 [ISO 14496-1:ch13]
!:mime video/mp4
>8 string mp42 \b, MP4 v2 [ISO 14496-14]
!:mime video/mp4
>8 string mp71 \b, MP4 w/ MPEG-7 Metadata [per ISO 14496-12]
>8 string mp7t \b, MPEG v4 system, MPEG v7 XML
>8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
>8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
!:mime video/mp4
>8 string MPPI \b, Photo Player, MAF [ISO/IEC 23000-3]
>8 string mqt \b, Sony / Mobile QuickTime (.MQV) US Pat 7,477,830
!:mime video/quicktime
>8 string MSNV \b, MPEG-4 (.MP4) for SonyPSP
!:mime audio/mp4
>8 string NDAS \b, MP4 v2 [ISO 14496-14] Nero Digital AAC Audio
!:mime audio/mp4
>8 string NDSC \b, MPEG-4 (.MP4) Nero Cinema Profile
!:mime video/mp4
>8 string NDSH \b, MPEG-4 (.MP4) Nero HDTV Profile
!:mime video/mp4
>8 string NDSM \b, MPEG-4 (.MP4) Nero Mobile Profile
!:mime video/mp4
>8 string NDSP \b, MPEG-4 (.MP4) Nero Portable Profile
!:mime video/mp4
>8 string NDSS \b, MPEG-4 (.MP4) Nero Standard Profile
!:mime video/mp4
>8 string NDXC \b, H.264/MPEG-4 AVC (.MP4) Nero Cinema Profile
!:mime video/mp4
>8 string NDXH \b, H.264/MPEG-4 AVC (.MP4) Nero HDTV Profile
!:mime video/mp4
>8 string NDXM \b, H.264/MPEG-4 AVC (.MP4) Nero Mobile Profile
!:mime video/mp4
>8 string NDXP \b, H.264/MPEG-4 AVC (.MP4) Nero Portable Profile
!:mime video/mp4
>8 string NDXS \b, H.264/MPEG-4 AVC (.MP4) Nero Standard Profile
!:mime video/mp4
>8 string odcf \b, OMA DCF DRM Format 2.0 (OMA-TS-DRM-DCF-V2_0-20060303-A)
>8 string opf2 \b, OMA PDCF DRM Format 2.1 (OMA-TS-DRM-DCF-V2_1-20070724-C)
>8 string opx2 \b, OMA PDCF DRM + XBS ext (OMA-TS-DRM_XBS-V1_0-20070529-C)
>8 string pana \b, Panasonic Digital Camera
>8 string qt \b, Apple QuickTime (.MOV/QT)
!:mime video/quicktime
>8 string ROSS \b, Ross Video
>8 string sdv \b, SD Memory Card Video
>8 string ssc1 \b, Samsung stereo, single stream (patent pending)
>8 string ssc2 \b, Samsung stereo, dual stream (patent pending)
# MPEG sequences
# Scans for all common MPEG header start codes
@@ -89,7 +201,10 @@
>>4 byte 77 \b, main
>>4 byte 88 \b, extended
>>6 byte x \b @ L %u
# GRR too general as it catches also FoxPro Memo example NG.FPT
>3 byte 0xB0 MPEG sequence, v4
# TODO: maybe this extra line exclude FoxPro Memo example NG.FPT starting with 000001b0 00000100 00000000
#>>4 byte !0 MPEG sequence, v4
!:mime video/mpeg4-generic
>>5 belong 0x000001B5
>>>9 byte &0x80
@@ -448,6 +563,7 @@
# MP2, M2A
0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
!:mime audio/mpeg
# rate
>2 byte&0xF0 0x10 \b, 8 kbps
>2 byte&0xF0 0x20 \b, 16 kbps
@@ -617,7 +733,7 @@
# Live MPEG-4 audio streams (instead of RTP FlexMux)
0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
!:mime audio/x-mp4a-latm
#>1 beshort&0x1FFF x \b, %u byte packet
#>1 beshort&0x1FFF x \b, %hu byte packet
>3 byte&0xE0 0x40
>>4 byte&0x3C 0x04 \b, single stream
>>4 byte&0x3C 0x08 \b, 2 streams
@@ -688,10 +804,6 @@
# iso 13818 transport stream
#
# from Oskar Schirmer <[email protected]> Feb 3, 2001 (ISO 13818.1)
# (the following is a little bit restrictive and works fine for a stream
# that starts with PAT properly. it won't work for stream data, that is
# cut from an input device data right in the middle, but this shouldn't
# disturb)
# syncbyte 8 bit 0x47
# error_ind 1 bit -
# payload_start 1 bit 1
@@ -699,9 +811,9 @@
# PID 13 bit 0x0000
# scrambling 2 bit -
# adaptfld_ctrl 2 bit 1 or 3
# conti_count 4 bit 0
0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
>188 byte !0x47 CORRUPTED
# conti_count 4 bit -
0 belong&0xFF5FFF10 0x47400010
>188 byte 0x47 MPEG transport stream data
# DIF digital video file format <[email protected]>
0 belong&0xffffff00 0x1f070000 DIF
@@ -719,16 +831,16 @@
!:mime video/x-mng
>4 belong !0x0d0a1a0a CORRUPTED,
>4 belong 0x0d0a1a0a
>>16 belong x %ld x
>>20 belong x %ld
>>16 belong x %d x
>>20 belong x %d
# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
0 string \x8bJNG JNG video data,
!:mime video/x-jng
>4 belong !0x0d0a1a0a CORRUPTED,
>4 belong 0x0d0a1a0a
>>16 belong x %ld x
>>20 belong x %ld
>>16 belong x %d x
>>20 belong x %d
# Vivo video (Wolfram Kleff)
3 string \x0D\x0AVersion:Vivo Vivo video data
@@ -755,7 +867,7 @@
>0 byte x GameCube movie,
>0x34 ubeshort x %d x
>0x36 ubeshort x %d,
>0x26 ubeshort x %dµs,
>0x26 ubeshort x %dus,
>0x42 ubeshort 0 no audio
>0x42 ubeshort >0 %dHz audio
@@ -789,25 +901,26 @@
# MPEG file
# MPEG sequences
# FIXME: This section is from the old magic.mime file and needs integrating with the rest
0 belong 0x000001BA
>4 byte &0x40
!:mime video/mp2p
>4 byte ^0x40
!:mime video/mpeg
0 belong 0x000001BB
!:mime video/mpeg
0 belong 0x000001B0
!:mime video/mp4v-es
0 belong 0x000001B5
!:mime video/mp4v-es
0 belong 0x000001B3
!:mime video/mpv
0 belong&0xFF5FFF1F 0x47400010
!:mime video/mp2t
0 belong 0x00000001
>4 byte&0x1F 0x07
!:mime video/h264
# FIXME: This section is from the old magic.mime file and needs
# integrating with the rest
#0 belong 0x000001BA
#>4 byte &0x40
#!:mime video/mp2p
#>4 byte ^0x40
#!:mime video/mpeg
#0 belong 0x000001BB
#!:mime video/mpeg
#0 belong 0x000001B0
#!:mime video/mp4v-es
#0 belong 0x000001B5
#!:mime video/mp4v-es
#0 belong 0x000001B3
#!:mime video/mpv
#0 belong&0xFF5FFF10 0x47400010
#!:mime video/mp2t
#0 belong 0x00000001
#>4 byte&0x1F 0x07
#!:mime video/h264
# Type: Bink Video
# Extension: .bik
+46
View File
@@ -0,0 +1,46 @@
#------------------------------------------------------------------------------
# $File: aout,v 1.1 2013/01/09 22:37:23 christos Exp $
# aout: file(1) magic for a.out executable/object/etc entries that
# handle executables on multiple platforms.
#
#
# Little-endian 32-bit-int a.out, merged from bsdi (for BSD/OS, from
# BSDI), netbsd, and vax (for UNIX/32V and BSD)
#
# XXX - is there anything we can look at to distinguish BSD/OS 386 from
# NetBSD 386 from various VAX binaries? The BSD/OS shared library flag
# works only for binaries using shared libraries. Grabbing the entry
# point from the a.out header, using it to find the first code executed
# in the program, and looking at that might help.
#
0 lelong 0407 a.out little-endian 32-bit executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses BSD/OS shared libs)
0 lelong 0410 a.out little-endian 32-bit pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses BSD/OS shared libs)
0 lelong 0413 a.out little-endian 32-bit demand paged pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses BSD/OS shared libs)
#
# Big-endian 32-bit-int a.out, merged from sun (for old 68010 SunOS a.out),
# mips (for old 68020(!) SGI a.out), and netbsd (for old big-endian a.out).
#
# XXX - is there anything we can look at to distinguish old SunOS 68010
# from old 68020 IRIX from old NetBSD? Again, I guess we could look at
# the first instruction or instructions in the program.
#
0 belong 0407 a.out big-endian 32-bit executable
>16 belong >0 not stripped
0 belong 0410 a.out big-endian 32-bit pure executable
>16 belong >0 not stripped
0 belong 0413 a.out big-endian 32-bit demand paged executable
>16 belong >0 not stripped
File renamed without changes.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: apple,v 1.24 2010/11/25 15:00:12 christos Exp $
# $File: apple,v 1.29 2014/04/30 21:41:02 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
@@ -106,8 +106,13 @@
# This is incredibly sloppy, but will be true if the program was
# written at its usual memory location of 2048 and its first line
# number is less than 256. Yuck.
# update by Joerg Jenderek at Feb 2013
0 belong&0xff00ff 0x80000 Applesoft BASIC program data
# GRR: this test is still too general as it catches also Gujin BOOT144.SYS (0xfa080000)
#0 belong&0xff00ff 0x80000 Applesoft BASIC program data
0 belong&0x00ff00ff 0x00080000
# assuming that line number must be positive
>2 leshort >0 Applesoft BASIC program data, first line number %d
#>2 leshort x \b, first line number %d
# ORCA/EZ assembler:
@@ -199,15 +204,15 @@
# purposes in YellowStep/Cocoa, including some nib files.
# From: David Remahl <[email protected]>
2 string typedstream NeXT/Apple typedstream data, big endian
>0 byte x \b, version %hhd
>0 byte x \b, version %d
>0 byte <5 \b
>>13 byte 0x81 \b
>>>14 ubeshort x \b, system %hd
>>>14 ubeshort x \b, system %d
2 string streamtyped NeXT/Apple typedstream data, little endian
>0 byte x \b, version %hhd
>0 byte x \b, version %d
>0 byte <5 \b
>>13 byte 0x81 \b
>>>14 uleshort x \b, system %hd
>>>14 uleshort x \b, system %d
#------------------------------------------------------------------------------
# CAF: Apple CoreAudio File Format
@@ -249,3 +254,49 @@
# From: "Nelson A. de Oliveira" <[email protected]>
# .vdi
4 string innotek\ VirtualBox\ Disk\ Image %s
# Apple disk partition stuff, strengthen the magic using byte 4
0 beshort 0x4552
>4 byte 0 Apple Driver Map
>>2 beshort x \b, blocksize %d
>>4 belong x \b, blockcount %d
>>10 beshort x \b, devtype %d
>>12 beshort x \b, devid %d
>>20 beshort x \b, descriptors %d
# Assume 8 partitions each at a multiple of the sector size.
# We could glean this from the partition descriptors, but they are empty!?!?
>>(2.S*1) indirect \b, contains[@0x%x]:
>>(2.S*2) indirect \b, contains[@0x%x]:
>>(2.S*3) indirect \b, contains[@0x%x]:
>>(2.S*4) indirect \b, contains[@0x%x]:
>>(2.S*5) indirect \b, contains[@0x%x]:
>>(2.S*6) indirect \b, contains[@0x%x]:
>>(2.S*7) indirect \b, contains[@0x%x]:
>>(2.S*8) indirect \b, contains[@0x%x]:
# Yes, the 3rd and 4th bytes are reserved, but we use them to make the
# magic stronger.
0 belong 0x504d0000 Apple Partition Map
>4 belong x \b, map block count %d
>8 belong x \b, start block %d
>12 belong x \b, block count %d
>16 string >0 \b, name %s
>48 string >0 \b, type %s
>124 string >0 \b, processor %s
>140 string >0 \b, boot arguments %s
>92 belong & 1 \b, valid
>92 belong & 2 \b, allocated
>92 belong & 4 \b, in use
>92 belong & 8 \b, has boot info
>92 belong & 16 \b, readable
>92 belong & 32 \b, writable
>92 belong & 64 \b, pic boot code
>92 belong & 128 \b, chain compatible driver
>92 belong & 256 \b, real driver
>92 belong & 512 \b, chain driver
>92 belong & 1024 \b, mount at startup
>92 belong & 2048 \b, is the startup partition
#http://wiki.mozilla.org/DS_Store_File_Format`
#http://en.wikipedia.org/wiki/.DS_Store
0 string \0\0\0\1Bud1\0 Apple Desktop Services Store
File renamed without changes.
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: archive,v 1.70 2011/10/26 15:44:47 christos Exp $
# $File: archive,v 1.88 2014/08/16 10:42:17 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -36,12 +36,66 @@
0 string 070701 ASCII cpio archive (SVR4 with no CRC)
0 string 070702 ASCII cpio archive (SVR4 with CRC)
# Debian package (needs to go before regular portable archives)
#
# Various archive formats used by various versions of the "ar"
# command.
#
#
# Original UNIX archive formats.
# They were written with binary values in host byte order, and
# the magic number was a host "int", which might have been 16 bits
# or 32 bits. We don't say "PDP-11" or "VAX", as there might have
# been ports to little-endian 16-bit-int or 32-bit-int platforms
# (x86?) using some of those formats; if none existed, feel free
# to use "PDP-11" for little-endian 16-bit and "VAX" for little-endian
# 32-bit. There might have been big-endian ports of that sort as
# well.
#
0 leshort 0177555 very old 16-bit-int little-endian archive
0 beshort 0177555 very old 16-bit-int big-endian archive
0 lelong 0177555 very old 32-bit-int little-endian archive
0 belong 0177555 very old 32-bit-int big-endian archive
0 leshort 0177545 old 16-bit-int little-endian archive
>2 string __.SYMDEF random library
0 beshort 0177545 old 16-bit-int big-endian archive
>2 string __.SYMDEF random library
0 lelong 0177545 old 32-bit-int little-endian archive
>4 string __.SYMDEF random library
0 belong 0177545 old 32-bit-int big-endian archive
>4 string __.SYMDEF random library
#
# From "pdp" (but why a 4-byte quantity?)
#
0 lelong 0x39bed PDP-11 old archive
0 lelong 0x39bee PDP-11 4.0 archive
#
# XXX - what flavor of APL used this, and was it a variant of
# some ar archive format? It's similar to, but not the same
# as, the APL workspace magic numbers in pdp.
#
0 long 0100554 apl workspace
#
# System V Release 1 portable(?) archive format.
#
0 string =<ar> System V Release 1 ar archive
!:mime application/x-archive
#
# Debian package; it's in the portable archive format, and needs to go
# before the entry for regular portable archives, as it's recognized as
# a portable archive whose first member has a name beginning with
# "debian".
#
0 string =!<arch>\ndebian
!:mime application/x-debian-package
>8 string debian-split part of multipart Debian package
!:mime application/vnd.debian.binary-package
>8 string debian-binary Debian binary package
!:mime application/vnd.debian.binary-package
>8 string !debian
>68 string >\0 (format %s)
# These next two lines do not work, because a bzip2 Debian archive
@@ -53,18 +107,14 @@
#>84 string gz \b, uses gzip compression
#>136 ledate x created: %s
# other archives
0 long 0177555 very old archive
0 short 0177555 very old PDP-11 archive
0 long 0177545 old archive
0 short 0177545 old PDP-11 archive
0 long 0100554 apl workspace
0 string =<ar> archive
!:mime application/x-archive
# MIPS archive (needs to go before regular portable archives)
#
# MIPS archive; they're in the portable archive format, and need to go
# before the entry for regular portable archives, as it's recognized as
# a portable archive whose first member has a name beginning with
# "__________E".
#
0 string =!<arch>\n__________E MIPS archive
!:mime application/x-archive
>20 string U with MIPS Ucode members
>21 string L with MIPSEL members
>21 string B with MIPSEB members
@@ -75,56 +125,20 @@
0 search/1 -h- Software Tools format archive text
#
# XXX - why are there multiple <ar> thingies? Note that 0x213c6172 is
# "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
#
# 0 string =!<arch> current ar archive
# 0 long 0x213c6172 archive file
#
# and for SVR1 archives, we have:
#
# 0 string \<ar> System V Release 1 ar archive
# 0 string =<ar> archive
#
# XXX - did Aegis really store shared libraries, breakpointed modules,
# and absolute code program modules in the same format as new-style
# "ar" archives?
# BSD/SVR2-and-later portable archive formats.
#
0 string =!<arch> current ar archive
!:mime application/x-archive
>8 string __.SYMDEF random library
>0 belong =65538 - pre SR9.5
>0 belong =65539 - post SR9.5
>0 beshort 2 - object archive
>0 beshort 3 - shared library module
>0 beshort 4 - debug break-pointed module
>0 beshort 5 - absolute code program module
0 string \<ar> System V Release 1 ar archive
0 string =<ar> archive
>68 string __.SYMDEF\ SORTED random library
#
# XXX - from "vax", which appears to collect a bunch of byte-swapped
# thingies, to help you recognize VAX files on big-endian machines;
# with "leshort", "lelong", and "string", that's no longer necessary....
# "Thin" archive, as can be produced by GNU ar.
#
0 belong 0x65ff0000 VAX 3.0 archive
0 belong 0x3c61723e VAX 5.0 archive
#
0 long 0x213c6172 archive file
0 lelong 0177555 very old VAX archive
0 leshort 0177555 very old PDP-11 archive
#
# XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
# be a random library (it said 0xff65 rather than 0177545).
#
0 lelong 0177545 old VAX archive
>8 string __.SYMDEF random library
0 leshort 0177545 old PDP-11 archive
>8 string __.SYMDEF random library
#
# From "pdp" (but why a 4-byte quantity?)
#
0 lelong 0x39bed PDP-11 old archive
0 lelong 0x39bee PDP-11 4.0 archive
0 string =!<thin>\n thin archive with
>68 belong 0 no symbol entries
>68 belong 1 %d symbol entry
>68 belong >1 %d symbol entries
# ARC archiver, from Daniel Quinlan ([email protected])
#
@@ -184,7 +198,10 @@
# SAR
3 string LH5 SAR archive data
# BSArc/BS2
0 string \212\3SB \0 BSArc/BS2 archive data
0 string \212\3SB\020\0 BSArc/BS2 archive data
# Bethesda Softworks Archive (Oblivion)
0 string BSA\0 BSArc archive data
>4 lelong x version %d
# MAR
2 string =-ah MAR archive data
# ACB
@@ -209,7 +226,7 @@
# AMGC
0 string \xad6" AMGC archive data
# NuLIB
0 string NõFélå NuLIB archive data
0 string N\xc3\xb5F\xc3\xa9lx\xc3\xa5 NuLIB archive data
# PakLeo
0 string LEOLZW PAKLeo archive data
# ChArc
@@ -221,7 +238,7 @@
# Freeze
0 string \x1f\x9f\x4a\x10\x0a Freeze archive data
# KBoom
0 string ¨MP¨ KBoom archive data
0 string \xc2\xa8MP\xc2\xa8 KBoom archive data
# NSQ, must go after CDC Codec
0 string \x76\xff NSQ archive data
# DPA
@@ -252,14 +269,14 @@
>9 string \0
>>0 string KWAJ
>>>7 string \321\003 MS Compress archive data
>>>>14 ulong >0 \b, original size: %ld bytes
>>>>14 ulong >0 \b, original size: %d bytes
>>>>18 ubyte >0x65
>>>>>18 string x \b, was %.8s
>>>>>(10.b-4) string x \b.%.3s
# MP3 (archiver, not lossy audio compression)
0 string MP3\x1a MP3-Archiver archive data
# ZET
0 string OZÝ ZET archive data
0 string OZ\xc3\x9d ZET archive data
# TSComp
0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
# ARQ
@@ -290,7 +307,7 @@
# Xtreme
0 string ULEB\0 Xtreme archive data
# Pack Magic
0 string @â\1\0 Pack Magic archive data
0 string @\xc3\xa2\1\0 Pack Magic archive data
# BTS
0 belong&0xfeffffff 0x1a034465 BTS archive data
# ELI 5750
@@ -426,7 +443,7 @@
# XPack Data
0 string xpa XPack archive data
# XPack Single Data
0 string Í\ jm XPack single archive data
0 string \xc3\x8d\ jm XPack single archive data
# TODO: missing due to unknown magic/magic at end of file:
#DWC
@@ -481,7 +498,7 @@
# This is a really bad format. A file containing HAWAII will match this...
#0 string HA HA archive data,
#>2 leshort =1 1 file,
#>2 leshort >1 %u files,
#>2 leshort >1 %hu files,
#>4 byte&0x0f =0 first is type CPY
#>4 byte&0x0f =1 first is type ASC
#>4 byte&0x0f =2 first is type HSC
@@ -571,6 +588,7 @@
!:mime application/zip
# Zip archives (Greg Roelofs, c/o [email protected])
0 string PK\005\006 Zip archive data (empty)
0 string PK\003\004
# Specialised zip formats which start with a member named 'mimetype'
@@ -660,11 +678,10 @@
!:mime application/vnd.oasis.opendocument.image-template
# EPUB (OEBPS) books using OCF (OEBPS Container Format)
# From: Adam Buchbinder <[email protected]>
# http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
# (mimetype contains "application/epub+zip")
>>50 string epub+zip EPUB ebook data
!:mime application/epub+zip
# From: Ralf Brown <[email protected]>
>>50 string epub+zip EPUB document
!:mime application/epub+zip
# Catch other ZIP-with-mimetype formats
# In a ZIP file, the bytes immediately after a member's contents are
@@ -684,16 +701,21 @@
>>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?)
!:mime application/zip
# Java Jar files
>(26.s+30) leshort 0xcafe Java archive data (JAR)
!:mime application/java-archive
# Generic zip archives (Greg Roelofs, c/o [email protected])
# Next line excludes specialized formats:
>26 string !\x8\0\0\0mimetype Zip archive data
>(26.s+30) leshort !0xcafe
>>26 string !\x8\0\0\0mimetype Zip archive data
!:mime application/zip
>>4 byte 0x09 \b, at least v0.9 to extract
>>4 byte 0x0a \b, at least v1.0 to extract
>>4 byte 0x0b \b, at least v1.1 to extract
>>4 byte 0x14 \b, at least v2.0 to extract
>>4 byte 0x2d \b, at least v3.0 to extract
>>0x161 string WINZIP \b, WinZIP self-extracting
>>>4 byte 0x09 \b, at least v0.9 to extract
>>>4 byte 0x0a \b, at least v1.0 to extract
>>>4 byte 0x0b \b, at least v1.1 to extract
>>>4 byte 0x14 \b, at least v2.0 to extract
>>>4 byte 0x2d \b, at least v3.0 to extract
>>>0x161 string WINZIP \b, WinZIP self-extracting
# StarView Metafile
# From Pierre Ducroquet <[email protected]>
@@ -852,7 +874,7 @@
# From: Dirk Jagdmann <[email protected]>
# xar archive format: http://code.google.com/p/xar/
0 string xar! xar archive
>6 beshort x - version %ld
>6 beshort x - version %d
# From: "Nelson A. de Oliveira" <[email protected]>
# .kgb
@@ -884,14 +906,8 @@
# archive must be an uncompressed file called 'mimetype' with contents
# 'application/epub+zip'
# start by checking that this is a ZIP archive, then check for the
# proper mimetype file
# From: Ralf Brown <[email protected]>
0 string PK\003\004
>0x1E string mimetypeapplication/epub+zip EPUB document
!:mime application/epub+zip
# From: "Michał Górny" <[email protected]>
# From: "Michael Gorny" <[email protected]>
# ZPAQ: http://mattmahoney.net/dc/zpaq.html
0 string zPQ ZPAQ stream
>3 byte x \b, level %d
@@ -905,3 +921,36 @@
>36 byte 16 \b, back-to-front
>42 beshort x \b, (%dx,
>44 beshort x %d)
# Symantec GHOST image by Joerg Jenderek at May 2014
# http://us.norton.com/ghost/
# http://www.garykessler.net/library/file_sigs.html
0 ubelong&0xFFFFf7f0 0xFEEF0100 Norton GHost image
# *.GHO
>2 ubyte&0x08 0x00 \b, first file
# *.GHS or *.[0-9] with cns program option
>2 ubyte&0x08 0x08 \b, split file
# part of split index interesting for *.ghs
>>4 ubyte x id=0x%x
# compression tag minus one equals numeric compression command line switch z[1-9]
>3 ubyte 0 \b, no compression
>3 ubyte 2 \b, fast compression (Z1)
>3 ubyte 3 \b, medium compression (Z2)
>3 ubyte >3
>>3 ubyte <11 \b, compression (Z%d-1)
>2 ubyte&0x08 0x00
# ~ 30 byte password field only for *.gho
>>12 ubequad !0 \b, password protected
>>44 ubyte !1
# 1~Image All, sector-by-sector only for *.gho
>>>10 ubyte 1 \b, sector copy
# 1~Image Boot track only for *.gho
>>>43 ubyte 1 \b, boot track
# 1~Image Disc only for *.gho implies Image Boot track and sector copy
>>44 ubyte 1 \b, disc sector copy
# optional image description only *.gho
>>0xff string >\0 "%-.254s"
# look for DOS sector end sequence
>0xE08 search/7776 \x55\xAA
>>&-512 indirect x \b; contains
+18
View File
@@ -0,0 +1,18 @@
#------------------------------------------------------------------------------
# $File: assembler,v 1.6 2013/12/11 14:14:20 christos Exp $
# make: file(1) magic for assembler source
#
0 regex \^[\040\t]{0,50}\\.asciiz assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.byte assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.even assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.globl assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.text assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.file assembler source text
!:mime text/x-asm
0 regex \^[\040\t]{0,50}\\.type assembler source text
!:mime text/x-asm
File renamed without changes.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: att3b,v 1.8 2009/09/19 16:28:08 christos Exp $
# $File: att3b,v 1.9 2014/04/30 21:41:02 christos Exp $
# att3b: file(1) magic for AT&T 3B machines
#
# The `versions' should be un-commented if they work for you.
@@ -11,10 +11,10 @@
# The 3B20 conflicts with SCCS.
#0 beshort 0550 3b20 COFF executable
#>12 belong >0 not stripped
#>22 beshort >0 - version %ld
#>22 beshort >0 - version %d
#0 beshort 0551 3b20 COFF executable (TV)
#>12 belong >0 not stripped
#>22 beshort >0 - version %ld
#>22 beshort >0 - version %d
#
# WE32K
#
@@ -29,12 +29,12 @@
>20 beshort 0410 (pure)
>20 beshort 0413 (demand paged)
>20 beshort 0443 (target shared library)
>22 beshort >0 - version %ld
>22 beshort >0 - version %d
0 beshort 0561 WE32000 COFF executable (TV)
>12 belong >0 not stripped
#>18 beshort &00020000 - 32100 required
#>18 beshort &00040000 and MAU hardware required
#>22 beshort >0 - version %ld
#>22 beshort >0 - version %d
#
# core file for 3b2
0 string \000\004\036\212\200 3b2 core file
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: audio,v 1.64 2012/02/20 16:37:34 christos Exp $
# $File: audio,v 1.71 2014/05/14 23:30:28 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt ([email protected]), Dan Quinlan ([email protected]),
@@ -104,7 +104,7 @@
# first entry is also the string "NTRK"
0 belong 0x4e54524b MultiTrack sound data
>4 belong x - version %ld
>4 belong x - version %d
# Extended MOD format (*.emd) (Greg Roelofs, [email protected]); NOT TESTED
# [based on posting 940824 by "Dirk/Elastik", [email protected]]
@@ -512,7 +512,7 @@
>>12 ulelong x \b, sample rate %d
# adlib sound files
# From Gürkan Sengün <[email protected]>, http://www.linuks.mine.nu
# From Gurkan Sengun <[email protected]>, http://www.linuks.mine.nu
0 string RAWADATA RdosPlay RAW
1068 string RoR AMUSIC Adlib Tracker
@@ -571,6 +571,7 @@
# musepak support From: "Jiri Pejchal" <[email protected]>
0 string MP+ Musepack audio
!:mime audio/x-musepack
>3 byte 255 \b, SV pre8
>3 byte&0xF 0x6 \b, SV 6
>3 byte&0xF 0x8 \b, SV 8
@@ -636,3 +637,66 @@
# URL: http://wiki.multimedia.cx/index.php?title=WavPack
# From: Mike Melanson <[email protected]>
0 string wvpk WavPack Lossless Audio
# From Fabio R. Schmidlin <[email protected]>
# VGM music file
0 string Vgm\
>9 ubyte >0 VGM Video Game Music dump v
>>9 ubyte/16 >0 \b%d
>>9 ubyte&0x0F x \b%d
>>8 ubyte/16 x \b.%d
>>8 ubyte&0x0F >0 \b%d
#Get soundchips
>>8 ubyte x \b, soundchip(s)=
>>0x0C ulelong >0 SN76489,
>>0x10 ulelong >0 YM2413,
>>0x2C ulelong >0 YM2612,
>>0x30 ulelong >0 YM2151,
>>0x38 ulelong >0 Sega PCM,
>>0x34 ulelong >0xC
>>>0x40 ulelong >0 RF5C68,
>>0x34 ulelong >0x10
>>>0x44 ulelong >0 YM2203,
>>0x34 ulelong >0x14
>>>0x48 ulelong >0 YM2608,
>>0x34 ulelong >0x18
>>>0x4C lelong >0 YM2610,
>>>0x4C lelong <0 YM2610B,
>>0x34 ulelong >0x1C
>>>0x50 ulelong >0 YM3812,
>>0x34 ulelong >0x20
>>>0x54 ulelong >0 YM3526,
>>0x34 ulelong >0x24
>>>0x58 ulelong >0 Y8950,
>>0x34 ulelong >0x28
>>>0x5C ulelong >0 YMF262,
>>0x34 ulelong >0x2C
>>>0x60 ulelong >0 YMF278B,
>>0x34 ulelong >0x30
>>>0x64 ulelong >0 YMF271,
>>0x34 ulelong >0x34
>>>0x68 ulelong >0 YMZ280B,
>>0x34 ulelong >0x38
>>>0x6C ulelong >0 RF5C164,
>>0x34 ulelong >0x3C
>>>0x70 ulelong >0 PWM,
>>0x34 ulelong >0x40
>>>0x74 ulelong >0
>>>>0x78 ubyte 0x00 AY-3-8910,
>>>>0x78 ubyte 0x01 AY-3-8912,
>>>>0x78 ubyte 0x02 AY-3-8913,
>>>>0x78 ubyte 0x03 AY-3-8930,
>>>>0x78 ubyte 0x10 YM2149,
>>>>0x78 ubyte 0x11 YM3439,
# GVOX Encore file format
# Since this is a proprietary file format and there is no publicly available
# format specification, this is just based on induction
#
0 string SCOW
>4 byte 0xc4 GVOX Encore music, version 5.0 or above
>4 byte 0xc2 GVOX Encore music, version < 5.0
0 string ZBOT
>4 byte 0xc5 GVOX Encore music, version < 5.0
File renamed without changes.
@@ -1,12 +1,12 @@
#------------------------------------------------------------------------------
# $File: bflt,v 1.4 2009/09/19 16:28:08 christos Exp $
# $File: bflt,v 1.5 2014/04/30 21:41:02 christos Exp $
# bFLT: file(1) magic for BFLT uclinux binary files
#
# From Philippe De Muyter <[email protected]>
#
0 string bFLT BFLT executable
>4 belong x - version %ld
>4 belong x - version %d
>4 belong 4
>>36 belong&0x1 0x1 ram
>>36 belong&0x2 0x2 gotpic
+8
View File
@@ -0,0 +1,8 @@
#------------------------------------------------------------------------------
# $File: blackberry,v 1.1 2014/01/31 01:51:32 christos Exp $
# blackberry: file(1) magic for BlackBerry file formats
#
5 belong 0
>8 belong 010010010 BlackBerry RIM ETP file
>>22 string x \b for %s
File renamed without changes.
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: blender,v 1.5 2009/09/19 16:28:08 christos Exp $
# $File: blender,v 1.6 2014/08/30 08:34:17 christos Exp $
# blender: file(1) magic for Blender 3D related files
#
# Native format rule v1.2. For questions use the developers list
@@ -35,5 +35,5 @@
>>>0x44 string =GLOB \b.
>>>>0x60 beshort x \b%.4d
# Scripts that run in the embeded Python interpreter
# Scripts that run in the embedded Python interpreter
0 string #!BPY Blender3D BPython script
File renamed without changes.
File renamed without changes.
@@ -1,27 +1,17 @@
#------------------------------------------------------------------------------
# $File: bsdi,v 1.5 2009/09/19 16:28:08 christos Exp $
# $File: bsdi,v 1.7 2014/03/29 15:40:34 christos Exp $
# bsdi: file(1) magic for BSD/OS (from BSDI) objects
# Some object/executable formats use the same magic numbers as are used
# in other OSes; those are handled by entries in aout.
#
0 lelong 0314 386 compact demand paged pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0407 386 executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0410 386 pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
0 lelong 0413 386 demand paged pure executable
>16 lelong >0 not stripped
>32 byte 0x6a (uses shared libs)
# same as in SunOS 4.x, except for static shared libraries
0 belong&077777777 0600413 sparc demand paged
0 belong&077777777 0600413 SPARC demand paged
>0 byte &0x80
>>20 belong <4096 shared library
>>20 belong =4096 dynamically linked executable
@@ -30,13 +20,13 @@
>16 belong >0 not stripped
>36 belong 0xb4100001 (uses shared libs)
0 belong&077777777 0600410 sparc pure
0 belong&077777777 0600410 SPARC pure
>0 byte &0x80 dynamically linked executable
>0 byte ^0x80 executable
>16 belong >0 not stripped
>36 belong 0xb4100001 (uses shared libs)
0 belong&077777777 0600407 sparc
0 belong&077777777 0600407 SPARC
>0 byte &0x80 dynamically linked executable
>0 byte ^0x80 executable
>16 belong >0 not stripped
Loaded 100 of 3749 files, more files were not shown because too many files have changed in this diff. Show more