Live data from Hacker News

Man who thought opening a TXT file is fine thought wrong

paulosyibelo.com

231–240 of 316 posts

Re: Man who thought opening a TXT file is fine thought wrong

#231
post #211

Earlier quoted context omitted.

No, the fact that .TXT files got interpreted as HTML is worse.

Rigidly interpreting documents depending on their file extension is worse than trying to figure out the type of a document before interpreting it. File extensions are a brittle and primitive system that does not fix any security issue.

File extensions are simple and, crucially, visible and understandable to the user. They're far better than any proposed alternative.

Re: Man who thought opening a TXT file is fine thought wrong

#232
post #67

Earlier quoted context omitted.

Agreed. This problem exists because someone wrote a tool that should only do one (really well) and but instead made it do five different things.

According to you. I appreciate that TextEdit is a rich editor. I can use vim or countless other apps for plain text. Few do what TextEdit does with its simplicity.

Aye. According to me. I have a preference for tools doing one thing, and one thing well. That attitude has served me very well.

Your opinion is that you like TextEdit for what it is.

Neither opinion/feeling is relevant.

Re: Man who thought opening a TXT file is fine thought wrong

#233

Two words: excessive complexity. It's always seemed strange that an application called TextEdit is actually more than a text editor. I strongly believe that content-type autodetection, much less HTML rendering(!), most certainly does not belong in a text editor.

shoulda used 'cat

that wouldn't work nicely with the mouse :)

Re: Man who thought opening a TXT file is fine thought wrong

#235
Small thing I do first when a new Windows has been installed: make the file association of .VBS and .JS files open with Notepad instead of wscript.exe[0]

Mitigates `iloveyou`[1] virus type attacks on my system

[0] https://en.wikipedia.org/wiki/Windows_Script_Host

[1] https://en.wikipedia.org/wiki/ILOVEYOU

Re: Man who thought opening a TXT file is fine thought wrong

#237
post #214

> I found another browser trick that lets force-downloaded TXT files to be opened without user interaction or warning I wish there was more elaboration on this. Opening a downloaded file without user interaction sounds pretty bad.

That is Safari's default behaviour for ZIP files. Only to extract them, though.

So whenever the program used for extracting ZIPs has a vulnerability any website could force-download a malicious ZIP and it would automatically be extracted and trigger the vulnerability...

Why is "force-download" even a thing? IMO the browser should always ask before downloading any file. Though this is not a unique Mac thing, I believe Chrome does that everywhere.

Re: Man who thought opening a TXT file is fine thought wrong

#238
post #162

Two words: excessive complexity. It's always seemed strange that an application called TextEdit is actually more than a text editor. I strongly believe that content-type autodetection, much less HTML rendering(!), most certainly does not belong in a text editor.

Here's an interesting quirk in Windows: There are two APIs to execute external programs, CreateProcess and ShellExecute. CreateProcess is the older of the two and only runs executables. ShellExecute opens the target with whatever app is associated with the extension. When they shoehorned the ShellExecute behavior into cmd.exe, they basically just said "if (!CreateProcess(foo)) {ShellExecute (foo)}" As a result, if yo…

Being pedantic, CreateProcess is more fundamental but ShellExecute, dating back to 16-bit Windows, is older.
Post reply on HN