Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> It seems TextEdit for some reason thought it should parse the HTML even while the file format was TXT. So we can inject a bunch of limited HTML into a text file, now what?

Well, what's a file type unless you know it from context, for example a special file system attribute that set to "text/html"? Heuristics. At the very least I think it's better to ignore file "extensions" completely when dealing with the data inside than to make it the deciding factor.

libmagic, which powers a lot of file(1)'s work, is called libmagic for several reasons.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: