news.volyx.in

“My wife has complained that OpenOffice will never print on Tuesdays” (2009) (bugs.launchpad.net)

577 points by beshrkayali · 2450 days ago · 207 comments on HN

Article summary

A user reported a bug where OpenOffice would not print on Tuesdays, which was later found to be caused by a bug in the `file` utility. The `file` utility misidentified PostScript files as Erlang JAM files if they contained the string "Tue" at the fourth byte. The user discovered a workaround by modifying a script to change the case of "Tue" to "tue". The bug was eventually fixed in the `file` utility later that year.

Main themes

  • file utility bugs
  • Unix tool limitations
  • file type identification
  • heuristics and security
  • Apple's Unix support
  • printing and PostScript files

What commenters say

  • The `file` utility is flawed because it relies on heuristics that can lead to incorrect file type identification.
  • Relying on file extensions is not a reliable method for determining file types, especially on Unix-like systems.
  • Apple's failure to update the `file` utility and other Unix tools on macOS can lead to compatibility issues and security vulnerabilities.
  • Using `file`-like heuristics is necessary when the file type is unknown, but it can be improved by considering the context in which the file is being used.
  • Some commenters argue that the bug is not in the `file` utility, but rather in the workflow that relies on it.
  • Others suggest that programs should use their own heuristics or precedence when determining file types, rather than relying on the `file` utility.
  • The use of `file` can be a security risk, as it can be used to sniff the MIME type of a file and potentially lead to security vulnerabilities.