summaryrefslogtreecommitdiff
path: root/usr.bin/file/file.c
AgeCommit message (Expand)Author
2018-01-15Revert my changes in r1.60 back to nicm@'s latest for now.Bryan Steele
2017-11-30Default unknowns to application/octet-stream instead of x-not-regular-file.Anthony J. Bentley
2017-07-01close open fd after testing files, ensuring that fd isn't stdin.Bryan Steele
2017-06-28Fix stdin file read support, accidentally broken in my last commit.Bryan Steele
2017-06-28remove excess #includeTheo de Raadt
2017-06-28perform an initial pledge very early on, and drop tzset to later.Theo de Raadt
2017-06-28Simplify file(1) by removing the no longer necessary parent/child separationBryan Steele
2017-04-18Style nits; no binary change.Nicholas Marriott
2016-05-01Tidy up some #include lines.Nicholas Marriott
2015-12-24Add --brief and --dereference, used by xdg-open/xdg-mime.Jeremie Courreges-Anglas
2015-12-05EAGAIN handling for imsg_read. OK henning@ benno@Claudio Jeker
2015-11-13Break the message preparation bit of the main loop into its own functionNicholas Marriott
2015-11-13Call stat not lstat with -L, makes links actually be followed. ReportedNicholas Marriott
2015-10-17The file(1) magic-parsing process was using pledge "stdio getpw proc recvfd"Theo de Raadt
2015-10-09Change all tame callers to namechange to pledge(2).Theo de Raadt
2015-10-06Move from tame "cmsg" to tame "sendfd" or "recvfd", depending on whichTheo de Raadt
2015-10-05use the normal -1 check for tame failureTheo de Raadt
2015-10-04Add tame(2) to file(1) and drop the old systrace(4) sandbox. tame(2) isNicholas Marriott
2015-10-02use limits.h instead of sys/param.h to get PATH_MAXTheo de Raadt
2015-07-12Keep one byte for terminating '\0'.Tobias Stoeckmann
2015-07-08Properly handle files >= 4 GB on 32 bit architectures.Tobias Stoeckmann
2015-05-30Support - to read from stdin, from Sebastien Marie.Nicholas Marriott
2015-05-29millert points out I can just call tzset() early to avoid having toNicholas Marriott
2015-05-29Only mmap() on regular files; mmap() on /dev/stdin will happily map asNicholas Marriott
2015-05-29Make things a little less confusing by making fill_buffer self-containedNicholas Marriott
2015-05-29If reading into buffer, correct the stored file size at EOF, we don'tNicholas Marriott
2015-05-29Silently fall back to /etc/magic if ~/.magic can't be opened, ok deraadt stspNicholas Marriott
2015-05-28probably makes more sense to show "file" as being mandatory;Jason McIntyre
2015-05-18No longer need tricks with setvbuf(). Instead, we just give permissionTheo de Raadt
2015-04-28Add a missing free in the error path.Lawrence Teo
2015-04-27Use a systrace(4) sandbox with a short whitelist of allowed syscalls forNicholas Marriott
2015-04-27Add simple privilege separation to file(1). Two processes, fileNicholas Marriott
2015-04-26Don't support -s on FIFOs, it doesn't work well and the workarounds areNicholas Marriott
2015-04-26stat() the original link path not the resolved one which may be relative.Nicholas Marriott
2015-04-24Do not attempt to use ~/.magic if running as root (or issetugid()).Nicholas Marriott
2015-04-24We need to loop over the files once to work out the width of the labelsNicholas Marriott
2015-04-24Trying to drop privileges means we can't handle ARG_MAX arguments, soNicholas Marriott
2015-04-24Use symbolic constants for st_mode flags, no binary change.Nicholas Marriott
2015-04-24If ~/.magic exists but can't be used, fail rather than silently fallingNicholas Marriott
2015-04-24New implementation of the file(1) utility. This is a simplified,Nicholas Marriott
2015-01-16Add missing <limits.h> to file.c and remove definition of PATH_MAXTodd C. Miller
2015-01-16Replace <sys/param.h> with <limits.h>Doug Hogan
2015-01-16If MAXPATHLEN is undefined, do not set it to 512. Dangerous.Theo de Raadt
2011-04-15Make the file_mbswidth() function cope if wcwidth() returns -1.Stefan Sperling
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
2009-10-26Fix usage; requested by jmc@Antoine Jacoutot
2009-08-27Appease gcc2 (I wish people would write in C, rather than "latest crapTheo de Raadt
2009-04-24file update to 4.24Charles Longeau
2008-05-08Update file to 4.21.Charles Longeau
2007-02-19Our version of file(1) doesn't have the MIME magic file, so removeTom Cosgrove