Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | recognize those ubiquitous webp file | 2021-01-23 | 1 | -1/+3 | |
| | | | | | | cherry-picked from FreeBSD okay millert@, deraadt@, sthen@ | ||||
* | remove macro instances from arbitrary string width specifiers. for example | 2020-11-14 | 1 | -4/+4 | |
| | | | | | | | -width ".Dv BOB" -> -width "BOB" although they are not errors, they are misleading and probably should not get pasted around | ||||
* | After fork(2) the pledge(2) in the parent proc can be reduced to | 2019-11-30 | 1 | -1/+4 | |
| | | | | | | | | "stdio rpath sendfd" so that it can call {l,}stat/open and sendfd for imsg_* in order to send fds to the child proc which is already pledged by recvfd to receive them OK brynet@ deraadt@ | ||||
* | asprintf returns -1, not an arbitrary value < 0. Also upon error the | 2019-06-28 | 1 | -2/+2 | |
| | | | | | | | (very sloppy specification) leaves an undefined value in *ret, so it is wrong to inspect it, the error condition is enough. discussed a little with nicm, and then much more with millert until we were exasperated | ||||
* | dev_t is signed to permit passing -1 as an invalid condition, but the | 2019-02-05 | 1 | -3/+3 | |
| | | | | | | decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther | ||||
* | Regex flags should include REG_NEWLINE and REG_ICASE should actually be | 2019-01-15 | 1 | -2/+2 | |
| | | | | used if specified. | ||||
* | the parent process doesn't do much but open files, but just the same | 2019-01-06 | 1 | -1/+4 | |
| | | | | | there's no reason it can't use pledge to enforce that. ok brynet deraadt | ||||
* | Update qcow file definitions | 2018-10-04 | 1 | -26/+60 | |
| | | | | | | Taken from netbsd "go for it" deraadt@ | ||||
* | Return from magic_test does not need to be copied because the caller | 2018-06-14 | 1 | -3/+3 | |
| | | | | will do so anyway and it was just being leaked. ok brynet deraadt | ||||
* | Revert my changes in r1.60 back to nicm@'s latest for now. | 2018-01-15 | 2 | -110/+243 | |
| | | | | | | Fixes "file *|grep" breakage reported by espie@ ok nicm, deraadt | ||||
* | Default unknowns to application/octet-stream instead of x-not-regular-file. | 2017-11-30 | 1 | -2/+2 | |
| | | | | | | This makes more sense and matches what the latest "other" file(1) now does. ok nicm@ | ||||
* | add missing types; from klemens nanni | 2017-09-20 | 1 | -5/+26 | |
| | | | | ok nicm | ||||
* | Replace fgetln with POSIX getline, even though file was using fgetln in | 2017-07-02 | 1 | -10/+11 | |
| | | | | | | | | | the idiomatic safe way. Also, check for stream errors with ferror and err(1, "") in that case. with feedback from joerg@, schwarze@, nicm@ ok nicm "code is shorter anyway", and joerg@ for an earlier diff | ||||
* | close open fd after testing files, ensuring that fd isn't stdin. | 2017-07-01 | 1 | -1/+3 | |
| | | | | ok nicm@ | ||||
* | magicfp is fclosed where it was opened, remove fclose from magic_load() | 2017-07-01 | 1 | -2/+1 | |
| | | | | ok nicm deraadt | ||||
* | Fix stdin file read support, accidentally broken in my last commit. | 2017-06-28 | 1 | -2/+6 | |
| | |||||
* | remove excess #include | 2017-06-28 | 1 | -6/+1 | |
| | |||||
* | perform an initial pledge very early on, and drop tzset to later. | 2017-06-28 | 1 | -4/+6 | |
| | | | | ok nicm brynet | ||||
* | Simplify file(1) by removing the no longer necessary parent/child separation | 2017-06-28 | 2 | -238/+101 | |
| | | | | | | | | | | and just drop privileges in the main process. Also allows for a tighter "stdio" pledge. passing regress tests still pass ok nicm@ with helpful feedback | ||||
* | Style nits; no binary change. | 2017-04-18 | 4 | -17/+12 | |
| | |||||
* | Recognise AArch64 binaries and core dumps. | 2017-02-19 | 1 | -1/+2 | |
| | |||||
* | Pull in <time.h> for ctime_r, gmtime, etc | 2016-08-26 | 1 | -1/+2 | |
| | | | | ok deraadt@ | ||||
* | Remove old unused prototype, from Ilya Kaliman. | 2016-06-12 | 1 | -4/+1 | |
| | |||||
* | Tidy up some #include lines. | 2016-05-01 | 2 | -10/+11 | |
| | |||||
* | Exact match use and name with strcmp rather than prefix with strncmp. | 2016-05-01 | 1 | -3/+3 | |
| | |||||
* | Use the right size (include the length byte) when working out if a | 2016-05-01 | 1 | -2/+2 | |
| | | | | pstring is too big. | ||||
* | Add support for 'name' and 'use' which allows more of the latest magic | 2016-05-01 | 4 | -46/+241 | |
| | | | | | files to work unchanged. (We are still missing 'indirect' and a few other bits.) | ||||
* | Trim = prefix from regex (it a noop). | 2016-05-01 | 1 | -1/+3 | |
| | |||||
* | Remove __unused that are now lies. | 2016-05-01 | 1 | -4/+3 | |
| | |||||
* | Add support for 'clear' test, and fix 'default' to expand the result | 2016-05-01 | 3 | -5/+32 | |
| | | | | string if any (used by, for example, rtf). | ||||
* | magic_test_type_default parameter is no longer __unused. | 2016-04-30 | 1 | -3/+2 | |
| | |||||
* | Fix the default type to work properly, that is to only match if no | 2016-04-30 | 2 | -3/+7 | |
| | | | | previous test at the same level has matched. | ||||
* | Replace regex match string in results (some new magic entries use this). | 2016-04-30 | 1 | -3/+5 | |
| | |||||
* | Partially sync magdir/sniffer from the file distribution on astron.com, | 2016-04-28 | 1 | -3/+108 | |
| | | | | | | adds pcap-ng files and some more link-layer types for pcap. Not an exact merge because they're using "use" which we don't currently support. ok nicm@ jasper@ | ||||
* | typos; | 2016-04-24 | 1 | -3/+3 | |
| | |||||
* | Sync 'archive' magic from file 5.25. Various improvements including | 2016-03-06 | 1 | -158/+330 | |
| | | | | | | epub detection which jirib at devio dot us reported as not working. nicm says "The only thing I see that we do not support is the indirect on the last line, I suggest just commenting it" (done). | ||||
* | fix broken list | 2016-03-04 | 1 | -2/+2 | |
| | |||||
* | fix typo | 2016-03-04 | 1 | -3/+3 | |
| | |||||
* | Fix the C type used for 32-bit float/lefloat/befloat, it should be float | 2016-02-20 | 1 | -2/+2 | |
| | | | | | not double (they are not used in any magic files anyway at the moment though). Spotted by and ok jsg. | ||||
* | Therefor -> Therefore (where appropriate) | 2016-01-29 | 1 | -2/+2 | |
| | | | | from ray@, ok jmc@ | ||||
* | Sync magdir/animation with file 5.25, amongst other updates this fixes an | 2016-01-02 | 1 | -78/+309 | |
| | | | | | incorrect detection of mp3 sample frequency/audio channels with non-mp3 files tracked down by Brandon Vincent. ok nicm@ | ||||
* | Add --brief and --dereference, used by xdg-open/xdg-mime. | 2015-12-24 | 2 | -8/+10 | |
| | | | | From Ralf Horstmann, ok tb@ deraadt@ nicm@ sthen@ | ||||
* | EAGAIN handling for imsg_read. OK henning@ benno@ | 2015-12-05 | 1 | -2/+4 | |
| | |||||
* | Merge xmalloc.[ch] files across base, skipping OpenSSH for now. | 2015-11-17 | 2 | -14/+9 | |
| | | | | ok nicm | ||||
* | When validating a char by calling strchr() with a string of allowed chars, | 2015-11-15 | 1 | -3/+3 | |
| | | | | | | check for '\0' first, because strchr() would return non-NULL. ok nicm | ||||
* | Break the message preparation bit of the main loop into its own function | 2015-11-13 | 1 | -39/+47 | |
| | | | | for less excessive level of indentation. | ||||
* | Call stat not lstat with -L, makes links actually be followed. Reported | 2015-11-13 | 1 | -27/+29 | |
| | | | | by and ok semarie@. | ||||
* | palmpilot should have gone when palm was added, it is redundant. | 2015-11-05 | 1 | -12/+0 | |
| | |||||
* | Update Matroska magic file. | 2015-10-31 | 1 | -4/+6 | |
| | |||||
* | The file(1) magic-parsing process was using pledge "stdio getpw proc recvfd" | 2015-10-17 | 1 | -2/+2 | |
| | | | | | | | | | | | | | | early on, then a set of getpwnam/setresuid/... before quickly dropping to "stdio recvfd". It receives fd's and runs the magic code on them in a chroot'd "stdio" jail. We can do better than that. Before the recent change, "proc" contained both the concepts of "forking" and "setuid". "id" is now split out as a seperate request, and it is exactly what this process needs momentarily. So this loses another window of opportunity, in case we have a major bug in .... hmm, it'd have to be in getpwnam.... ok tedu doug semarie gilles |