Age | Commit message (Collapse) | Author | |
---|---|---|---|
2015-07-08 | Properly handle files >= 4 GB on 32 bit architectures. | Tobias Stoeckmann | |
with input by and ok nicm@ | |||
2015-07-08 | Do not allow '\0' as an offset operator or type. | Tobias Stoeckmann | |
ok nicm | |||
2015-06-17 | Use strdup in xstrdup from Fritjof Bornebusch. While here, remove xfree | Nicholas Marriott | |
which is unused. | |||
2015-06-04 | systrace(4) STRIOCATTACH can only fail for file(1) if it is already | Nicholas Marriott | |
systraced. If so, silently ignore the error and do not attempt to apply our own systrace policy. From Patrick Keshishian. | |||
2015-05-30 | Support - to read from stdin, from Sebastien Marie. | Nicholas Marriott | |
2015-05-29 | millert points out I can just call tzset() early to avoid having to | Nicholas Marriott | |
permit access() in the child. | |||
2015-05-29 | Use gmtime not localtime when we want UTC, I got it right in one place | Nicholas Marriott | |
but not in another two. I expect I was confused by the fact that the original file(1) had them the wrong way round (so, for example, leqldate was actually UTC). | |||
2015-05-29 | Don't stop at the first successful test unless it has generated some | Nicholas Marriott | |
output. | |||
2015-05-29 | The case-insensitive flag (c) for string and search tests doesn't make | Nicholas Marriott | |
the entire match case sensitive, only lower case characters. | |||
2015-05-29 | I got confused and made the strength multiplier 20, it should be 10. | Nicholas Marriott | |
2015-05-29 | file(1) needs access(/etc/localtime) for localtime(). | Nicholas Marriott | |
2015-05-29 | Only mmap() on regular files; mmap() on /dev/stdin will happily map as | Nicholas Marriott | |
much as we ask for but only the first page will be usable. (We could get the actual size with ioctl(FIONREAD) and mmap() that but it would need to be done in the parent - I think just using read() is simpler.) | |||
2015-05-29 | Make things a little less confusing by making fill_buffer self-contained | Nicholas Marriott | |
and return both the buffer and amount filled rather than having it modify the input struct and return a value. | |||
2015-05-29 | If reading into buffer, correct the stored file size at EOF, we don't | Nicholas Marriott | |
want to look at any garbage that might already be in the buffer after that. From Sebastien Marie. | |||
2015-05-29 | Silently fall back to /etc/magic if ~/.magic can't be opened, ok deraadt stsp | Nicholas Marriott | |
2015-05-28 | probably makes more sense to show "file" as being mandatory; | Jason McIntyre | |
from sebastien marie | |||
2015-05-18 | No longer need tricks with setvbuf(). Instead, we just give permission | Theo de Raadt | |
to call fstat() and fcntl(). ok nicm | |||
2015-04-30 | Add a comment about waitpid, suggested by espie@. | Nicholas Marriott | |
2015-04-30 | Tweak comment so it doesn't imply line buffering is needed (any will do | Nicholas Marriott | |
so long as it is explicit), and set stderr to NBF not LBF. Pointed out by espie@. | |||
2015-04-29 | the non braced do while made my teeth hurt | Theo de Raadt | |
2015-04-28 | Add a missing free in the error path. | Lawrence Teo | |
ok nicm@ | |||
2015-04-27 | Use a systrace(4) sandbox with a short whitelist of allowed syscalls for | Nicholas Marriott | |
the file(1) child process. Based on similar code in ssh sandbox-systrace.c. Idea and help from deraadt@. | |||
2015-04-27 | Add a _file user and use for privsep, ok deraadt | Nicholas Marriott | |
2015-04-27 | Add simple privilege separation to file(1). Two processes, file | Nicholas Marriott | |
descriptors and a few other bits are opened in parent and passed to child using imsg. Child currently drops to "nobody" but this will change. | |||
2015-04-27 | remove some extraneous text; ok nicm | Jason McIntyre | |
2015-04-26 | Don't support -s on FIFOs, it doesn't work well and the workarounds are | Nicholas Marriott | |
a bit horrible. | |||
2015-04-26 | stat() the original link path not the resolved one which may be relative. | Nicholas Marriott | |
2015-04-25 | Only print MIME warnings when warnings are enabled. | Nicholas Marriott | |
2015-04-25 | Fail if a \ appears at EOL rather than continuing off the end of the | Nicholas Marriott | |
buffer, from Sebastien Marie. | |||
2015-04-25 | Switch to using the POSIX endian macros, i.e: be64toh vs. betoh64. | Bryan Steele | |
ok nicm@ | |||
2015-04-24 | Document -h, and bring some consistency to the option descriptions. ok jmc | Nicholas Marriott | |
2015-04-24 | tweaks; ok nicm | Jason McIntyre | |
2015-04-24 | Do not attempt to use ~/.magic if running as root (or issetugid()). | Nicholas Marriott | |
2015-04-24 | move an ugly space | Theo de Raadt | |
2015-04-24 | We need to loop over the files once to work out the width of the labels | Nicholas Marriott | |
before testing them. | |||
2015-04-24 | Trying to drop privileges means we can't handle ARG_MAX arguments, so | Nicholas Marriott | |
remove it for now. | |||
2015-04-24 | Add a couple of missing spaces (style nits). | Nicholas Marriott | |
2015-04-24 | Use symbolic constants for st_mode flags, no binary change. | Nicholas Marriott | |
2015-04-24 | If ~/.magic exists but can't be used, fail rather than silently falling | Nicholas Marriott | |
back to /etc/magic. | |||
2015-04-24 | Fix a couple of errors in the magic source files. | Nicholas Marriott | |
2015-04-24 | New implementation of the file(1) utility. This is a simplified, | Nicholas Marriott | |
modernised version with a nearly complete magic(5) parser but omits some of the complex builtin tests (notably ELF) and has a reduced set of options. ok deraadt | |||
2015-02-15 | Use "In" to mark up include files, instead of wrongly wrapping with Aq. | Anthony J. Bentley | |
Aq is not the same as <> in non-ASCII situations, so this caused incorrect output in some places. And it provided no semantics besides. ok schwarze@ | |||
2015-01-16 | Add missing <limits.h> to file.c and remove definition of PATH_MAX | Todd C. Miller | |
which masked the missing include. OK deraadt@ | |||
2015-01-16 | Replace <sys/param.h> with <limits.h> | Doug Hogan | |
This patch is from Theo. I helped verify that removing <sys/param.h> doesn't change anything. This produces the same binaries before and after with clang 3.5 and gcc 4.9.4 on amd64. There is a slight difference in the way it is generated by our old gcc 4.2.1 despite the fact that the preprocessed input is almost identical. ok deraadt@ | |||
2015-01-16 | If MAXPATHLEN is undefined, do not set it to 512. Dangerous. | Theo de Raadt | |
2014-11-04 | bounds check, apply from upstream devel/libmagic | Theo de Raadt | |
from Matthias Pitzl @ genua | |||
2014-10-26 | Place additional parantheses around readdir() and check return does not | Brad Smith | |
equal NULL. apprentice.c:645:13: warning: using the result of an assignment as a condition without parentheses [-Wparentheses] With input and ok guenther@ | |||
2014-10-11 | Userland reallocarray() audit. | Doug Hogan | |
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@ | |||
2014-05-18 | use reallocarray | Marc Espie | |
okay ian@, chl@ | |||
2014-01-16 | Avoid size_t overflow in apprentice_map. | Tobias Stoeckmann | |
ok millert |