Commit Graph

77 Commits

Author SHA1 Message Date
Jose Luis Duran
3347078000 (upstream) PR/386: Add newlines for consitency 2
Obtained from:	https://github.com/file/file/pull/134/
2023-10-08 21:52:53 -07:00
Jose Luis Duran
0d3a87569f file_test: Fix file test
Trimming of the line feed is no longer necessary after
d993c6b0db

Currently the tests:

  - bcachefs2
  - gpkg-1-zst
  - multiple

are failing, but a fix will be committed upstream.

This also reverts c5e957ad4 "file: fix test case for gpkg by removing the extra \n."

MFC after:	3 days
2023-10-08 21:44:14 -07:00
Xin LI
898496ee09 MFV: file 5.45.
MFC after:	3 days
2023-09-10 12:21:16 -07:00
Xin LI
07dfb236c8 MFV: Restore the ability to process files from stdin immediately.
PR:		bin/267221
MFC after:	3 days
2022-10-27 00:12:53 -07:00
Xin LI
c5e957ad4f file: fix test case for gpkg by removing the extra \n.
MFC after:	3 days
2022-09-30 22:45:32 -07:00
Xin LI
a2dfb7224e file: upgrade to 5.43.
MFC after:	3 days
2022-09-24 19:16:39 -07:00
Xin LI
bced4d8b3e MFV: cherry-pick "PR/358: Fix width for -f - (jpalus)"
MFC after:	1 week
PR:		bin/266264
2022-09-06 23:31:20 -07:00
Xin LI
a4d6d3b891 file: upgrade to 5.42.
MFC after:	2 weeks
2022-07-03 17:11:09 -07:00
Xin LI
43a5ec4eb4 file: upgrade to 5.41.
MFC after:	2 weeks
2022-01-03 22:03:39 -08:00
Ed Maste
4e22eafc99 Revert r362261, "Re-apply r333944 to unbreak ports"
A file update in 2018 broke many ports as it misidentified shared
libraries as PIE binaries.  r333944 reverted part of the change,
restoring ports builds but misidentifying objects in the opposite
direction.

Earlier this month file 5.39 was imported, and then the change
originally from r333944 was recommitted as r362261.  However, the
issue was fixed upstream, so r362261 serves no purpose.

PR:		246960, 247461 [exp-run]
Sponsored by:	The FreeBSD Foundation
2020-06-29 13:30:48 +00:00
Baptiste Daroussin
5b990a9463 Revert r362466
Such change should not have happen without prior discussion and review.

With hat:	transitioning core
2020-06-22 07:46:24 +00:00
Hans Petter Selasky
7747001b12 Improve wording to be more precise and clear.
No functional change intended.

s/Master Boot/Main Boot/ (also called MBR)

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-06-21 13:34:08 +00:00
Antoine Brodin
1f73e3e4a4 Re-apply r333944 to unbreak ports 2020-06-17 10:11:54 +00:00
Xin LI
2726a70148 MFV r362254: file 5.39.
MFC after:	2 weeks
2020-06-17 07:41:28 +00:00
Xin LI
d38c30c092 MFV r357712: file 5.38.
MFC after:	2 weeks
2020-02-11 07:02:48 +00:00
Xin LI
f327c2ba2f MFV r354798:
Apply vendor fixes:

06de62c Detect multiplication overflow when computing sector position
46a8443 Limit the number of elements in a vector (found by oss-fuzz)

Requested by:	wen
MFC after:	3 days
Security:	CVE-2019-18218
2019-11-18 04:22:04 +00:00
Xin LI
48c779cdec MFV r354582: file 5.37.
MFC after:	3 days
2019-11-10 17:00:23 +00:00
Leandro Lupori
c4e127e24d [PowerPC64] Add ABI flags to 'file' magic
The distinction between ELF header version and OpenPOWER ELF ABI version is
confusing for most of people, so this adds text to "file" output to make it
clear about which OpenPOWER ELF ABI version binary was built for.

The strings used in this change are based on "64-Bit ELF V2 ABI
Specification/3.1. ELF Header" document available at
http://openpowerfoundation.org/wp-content/uploads/resources/leabi/content/dbdoclet.50655241_97607.html

Example:

$ file t1-Flag2 -m -m contrib/file/magic/Magdir/elf t1-Flag2: ELF 64-bit MSB
executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1
(FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, for FreeBSD
13.0 (1300033), FreeBSD-style, not stripped

Submitted by:	alfredo.junior_eldorado.org.br
Reviewed by:	luporl
Differential Revision:	https://reviews.freebsd.org/D20771
2019-06-28 15:52:40 +00:00
Eitan Adler
2dc4dbb967 file: update to 5.34
PR:		230141
exp-run by:	antoine
2018-08-08 01:33:36 +00:00
Oleksandr Tymoshenko
964219664d Fix file(1) dumpdate reporting for dump(8) files
Magic file for dump(8) had this dump and previous dump dates reversed.
Fix order for all three flavours of the dump(8) format.
This fix was committed to upstream repo as magic/Magdir/dump,v 1.17
and will be merged during next vendor import.

PR:		223155
MFC after:	2 weeks
2018-06-26 18:53:52 +00:00
Antoine Brodin
a665699823 Revert last change to file/magic/Magdir/elf, it misidentifies most shared
libraries installed from ports as pie executables instead of shared libraries,
and consequently breaks ports.
2018-05-20 22:07:44 +00:00
Eitan Adler
58a0f0d00c MFV: file 5.33
Merge the latest file(1) in.

Relevent Changelog:
- extend the support for ${x?:} expansions for magic descriptions
- add support for ${x?:} in mime types to handle pie binaries.
- add support for negative offsets (offsets from the end of file)
- close the file on error when writing magic

Relnotes:	yes
2018-05-20 05:06:42 +00:00
Gordon Tetlow
40427cca7a MFV r323678: file 5.32
Approved by:	emaste (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D12400
2017-09-17 19:14:38 +00:00
Gordon Tetlow
367cf59651 Fix an incorrectly used conditional causing a stack buffer overflow.
Reported by:	Thomas Jarosch of Intra2net AG
Reviewed by:	emaste, jhb
Security:	CVE-2017-1000249
2017-09-07 18:54:54 +00:00
Xin LI
a5d223e641 MFV r308392: file 5.29.
MFC after:	2 weeks
2016-11-07 15:54:47 +00:00
Xin LI
282e23f07b MFV r302218: file 5.28.
Relnotes:	yes
MFC after:	2 weeks
Approved by:	re (gjb)
2016-06-27 01:29:17 +00:00
Xin LI
20f8619da0 MFV r299716: file 5.27
MFC after:	2 weeks
Relnotes:	yes
2016-05-14 08:52:37 +00:00
Xin LI
53021c7e30 MFV r299237: apply two upstream revisions to address upstream bug PR/540.
PR:		209211
MFC after:	2 weeks
X-MFC:		if there is no new file release
2016-05-08 18:18:35 +00:00
Xin LI
7206c4fc60 MFV r299233: Apply upstream fix 11edb37a71851b5bcbd4e51ca6ad3dcbf57e9761:
Revert: Don't close stdin...

This have been observed by portupgrade in its interaction with file(1),
as reported as a regression in bin/209211.

PR:		209211
MFC after:	3 days
2016-05-08 09:30:36 +00:00
Xin LI
3e41d09d08 MFV r298178:
Update file to 5.26.

MFC after:	2 weeks
Relnotes:	yes
2016-04-18 07:36:24 +00:00
Xin LI
9ce06829f2 MFV r288140: update file to 5.25.
MFC after:	1 month
2015-09-23 05:39:20 +00:00
Xin LI
072d210fa1 Fix build. 2015-09-04 08:04:12 +00:00
Xin LI
9fc5c47fa5 MFV r287451 + 287452: file 5.24 + fix for bin/181436.
PR:		181436
MFC after:	2 weeks
2015-09-04 05:56:14 +00:00
Xin LI
3fd03fdbfe MFV r284276: Fix long options.
Reported by:	jkim
MFC after:	13 days
2015-06-11 17:32:36 +00:00
Xin LI
5f0216bd88 MFV r284234:
Update file to 5.23.

MFC after:	2 weeks
2015-06-10 19:22:41 +00:00
Xin LI
4460e5b02d MFV r276568:
Update file to 5.22.

MFC after:	2 weeks
2015-01-02 21:20:02 +00:00
Xin LI
c293113327 MFV r275696: file 5.21.
MFC after:	 2 weeks
2014-12-11 06:52:10 +00:00
Edward Tomasz Napierala
be3a49ee62 Add fstyp(8). This utility, named after its SVR4 counterpart, detects
filesystems.  It differs from file(1) in that it gives machine-parseable
output, it outputs filesystem labels, doesn't get confused by other
formats metadata, and runs in Capsicum sandbox.

Differential Revision:	https://reviews.freebsd.org/D1255
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2014-12-10 14:14:16 +00:00
Xin LI
2c4f16476d 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
2014-12-10 08:19:55 +00:00
Xin LI
cd0b4959e6 MFV r273688:
Update filesystems magic.  This fixes a regression introduced by
libmagic 5.19 which prevents file(1) to show more verbose information
about a MBR.

Submitted by:	madpilot
MFC after:	2 weeks
2014-10-26 09:29:12 +00:00
Xin LI
b6cee71de3 MFV r267843: update file/libmagic to 5.19.
MFC after:	2 weeks
2014-06-26 06:03:39 +00:00
Xin LI
d627d450b3 Fix multiple vulnerabilities in file(1) and libmagic(3).
Security:	FreeBSD-SA-14:16.file
Approved by:	so
2014-06-24 19:04:32 +00:00
Ed Maste
0fcefb433d Update NetBSD Foundation copyrights to 2-clause BSD
The NetBSD Foundation states "Third parties are encouraged to change the
license on any files which have a 4-clause license contributed to the
NetBSD Foundation to a 2-clause license."

This change removes clauses 3 and 4 from copyright / license blocks that
list The NetBSD Foundation as the only copyright holder.

Sponsored by:	The FreeBSD Foundation
2014-03-18 01:40:25 +00:00
Dimitry Andric
b71498e619 Apply upstream commit 33312fd828e59c78ae4ee30fd70d0ca109748cf0 (by
zoulasc) to contrib/file:

  don't write a char to a pointer.

MFC after:	3 days
2013-12-22 14:14:53 +00:00
David E. O'Brien
4ebb86b33b Add support for Lua 5.2.
Submitted by:	skreuzer
2013-01-11 17:34:30 +00:00
Stephen McKay
a0ebde2020 Correct a regression introduced during the import of file(1) 5.11.
Magic tests containing "search" or "regex" directives were incorrectly
compiled by "mkmagic" and were effectively ignored.  This caused troff
files (for example) to be detected as simply "ASCII text" instead of
as "troff or preprocessor input, ASCII text".

PR:		bin/170415
Approved by:	consensus on developers@
MFC after:	3 days
2012-08-17 02:27:17 +00:00
David E. O'Brien
80c86c3659 Update file(1) to version 5.11. 2012-04-19 03:20:13 +00:00
Dimitry Andric
0adb64b5d9 In contrib/file/softmagic.c, fix a potential format string security
problem.  (This fix has already been applied upstream, but we do not
have the latest version of file in the tree at the moment.)

MFC after:	1 week
2011-12-15 23:28:17 +00:00
Attilio Rao
7f08176ee8 Add the ability for GDB to printout the thread name along with other
thread specific informations.

In order to do that, and in order to avoid KBI breakage with existing
infrastructure the following semantic is implemented:
- For live programs, a new member to the PT_LWPINFO is added (pl_tdname)
- For cores, a new ELF note is added (NT_THRMISC) that can be used for
  storing thread specific, miscellaneous, informations. Right now it is
  just popluated with a thread name.

GDB, then, retrieves the correct informations from the corefile via the
BFD interface, as it groks the ELF notes and create appropriate
pseudo-sections.

Sponsored by:	Sandvine Incorporated
Tested by:	gianni
Discussed with:	dim, kan, kib
MFC after:	2 weeks
2010-11-22 14:42:13 +00:00
Rui Paulo
91e3f06a9e Properly warp around more code under COMPILE_ONLY to recover from build
errors.
2010-08-02 13:05:12 +00:00