Live data from Hacker News

Man who thought opening a TXT file is fine thought wrong

paulosyibelo.com

171–180 of 316 posts

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

#171
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…

This is a frustrating behavior on Windows, not because it's possible, but because it's default. I vastly prefer the way KDE performs. Whatever the default program to open that file type is attempts to open it. You can easily change what the default is.

It's frustrating when I instinctively change a file extension on Windows so I can do some other operation with it (say changing a configuration file to .txt to edit it) and Windows still doesn't know what to do with it.

I'm not averse to the behavior, I just wish I could control when it happens.

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

#173

Oh, man. The idea that TextEdit automatically parsed .txt files as HTML if they started with a certain file signature is problematic... ...but the fact that file:// schemes can access remote files by appending /net/ followed by a domain name is pretty shocking. I mean, the entire purpose of "file://" would seem to be to provide access to local/mounted files and only those. The fact that a Mac engineer thought it woul…

The extension is meaningless outside of Windows...

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

#176

Earlier quoted context omitted.

It's not the only factor, but definitely one of the most important ones.

Why would the quality of an OS be determined by what apps come bundled with it? An OS is a different thing than applications, it's what the applications run on. I think you have an unusual viewpoint.

Because people generally want their computer to be usable when they buy it. Imagine if OSes did not include a text editor, browser, file explorer, settings app, wifi connection tool, etc. MS paint is similarly a very basic part of the standard toolset.

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

#177

Earlier quoted context omitted.

Looking in /etc/auto_master, which is the configuration for Autofs, the /net mount point is commented out by default. I do not know when (or if) it was ever turned on by default.

Whether or not a default configuration is vulnerable is a pretty typical component of accessing a vulnerability’s severity. Unfortunate that the author didn’t mention this. Obviously this doesn’t excuse the bug, but it’s important to contextualize if we hope to compare relative impact and have frank discussions.

The default configuration was, in fact, vulnerable at the time. Having it be commented out by default is new.

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

#178
For attachment handling there's really a need for a service that takes the file in light of the uploaded suffix and mime type, and normalizes or rejects it (in a sandbox) based on how safe for consumption it is for common apps that handle that kind of file. For normalization eg GhostScript can convert PDFs to PDF/A that contain no scripts, images can be recoded, etc. Open source project idea? Or is there something this lie this already?

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

#179

Oh, man. The idea that TextEdit automatically parsed .txt files as HTML if they started with a certain file signature is problematic... ...but the fact that file:// schemes can access remote files by appending /net/ followed by a domain name is pretty shocking. I mean, the entire purpose of "file://" would seem to be to provide access to local/mounted files and only those. The fact that a Mac engineer thought it woul…

It's not specific to the file:// URI scheme; /net is an actual filesystem path that works with anything that accesses paths. Or used to work, anyway; it was recently changed to be disabled by default.

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

#180

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.

Yesterday grep didn't work because it 'autodetected' that the target file was a binary.. So I 1) cursed whoever made this non backward compatible change 2) used man to find the '-a' option..
Post reply on HN