Via BSD Now, the old, familiar file command has been completely rewritten by OpenBSD developer Nicholas Marriott, who also happens to be the author of tmux. This new edition takes advantage of modern coding practices and the usual OpenBSD scrutiny. It will run by default as an unprivileged user with no shell, and in a systrace sandbox, strictly limiting what system calls can be made and has a drastically reduced potential for damage which a malicious file could do. Ian Darwin, the original author of the utility, saw the commit and, in what may be a moment in BSD history to remember, replied.
The file utility has been around since the 1970s and is used to determine what type of file something actually is. It hasn't seen a lot of development these days, and it's had its share of security issues as well. Some of those security issues remained unfixed, despite being publicly known for a while. It is run to inspect all kinds of files and was technically designed to be used on untrusted files, so tightening things up improves the situation quite a bit.
(Score: 2) by tempest on Thursday April 30 2015, @07:49PM
I have a macbook and use it fairly often. As the computer guy, people at my company send me things attached in email asking why they can't open it. I've seen a lot of weird shit like MS Word files with .pdf extensions and all sorts of zip files with the wrong extension. I figured using "file" is as safe as anything to figure out what something is.
(Score: 3, Interesting) by frojack on Thursday April 30 2015, @08:00PM
I figured using "file" is as safe as anything to figure out what something is.
To the extent that file can be tricked into doing anything, the most likely place for that to happen is in your file manager, trying to figure out what the file really is.
No user is going to use file to actually do any thing at the command line, its almost always part of an automated tool chain.
I just use a dumb as a rock hex editor for file inspection if there is any question.
When my users bring me files they can't open they get "The Lecture"(tm) first, then, maybe (but probably not) I might look into it.
No, you are mistaken. I've always had this sig.
(Score: 3, Insightful) by maxwell demon on Friday May 01 2015, @01:01PM
Ah, so I'm no user. Nice to know.
The Tao of math: The numbers you can count are not the real numbers.