Earlier quoted context omitted.
shoulda used 'cat
Using cat with arbitrary input exposes you to many terminal-side security issues. It is insufficiently complex.
Man who thought opening a TXT file is fine thought wrong
121–130 of 316 posts
Re: Man who thought opening a TXT file is fine thought wrong
#122 printf '' > test.txt
Opening test.txt shows the exact code I printed. Am I missing something?Re: Man who thought opening a TXT file is fine thought wrong
#123Hmm, I can't replicate this on my Mac running 10.9. printf ' ' > test.txt Opening test.txt shows the exact code I printed. Am I missing something?
Re: Man who thought opening a TXT file is fine thought wrong
#124Re: Man who thought opening a TXT file is fine thought wrong
#125Oh, 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…
I think it carries over from NeXTstep, iirc.
Because why would you be connected to the internet all the time? And how could you even afford those long distance calls?
Re: Man who thought opening a TXT file is fine thought wrong
#126Two 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.
TextEdit dates back to NeXTStep, so it was originally written in the late 1980s probably. Guessing it didn't render HTML originally, but it always had RTF capability. Not that it's an excuse in 2021, but very few applications from that era woudl be considered "safe" today.
TextEdit.app is the OpenStep rewrite of Edit.app and dates to the mid 1990s. It was likely one of the first OpenStep apps. It supported the same rich text files as the original Edit.app.
Apple bought NeXT, OpenStep became Cocoa, TextEdit was ported to Java, and then back to garbage collected Objective-C, then ARC Objective-C, (then Swift, probably).
Along the way it picked up features for reading/writing/editing HTML and Microsoft Word documents.
Apple used to publish the source code for TextEdit as part of their Xcode sample code, but they stopped a few years ago.
Re: Man who thought opening a TXT file is fine thought wrong
#127Why is TextEdit accessing the Internet without permission? Does Big Sur's Access Control block stuff like this?
From the OP it sounds like there is a very weird feature/component in MacOS called "AutoMount" and/or "AutoFS" that lets HTTP GET network requests be made via reading file system locations... and it may somehow escape other access controls? I too am curious for more details about this. Where did this feature come from, how has it been used, has it actually been used? Is AutoMount/AutoFS still there after this CVE pat…
It's pretty common on Unix-like systems (especially in multi-user environments) and not at all specific to macOS.
References:
https://wiki.archlinux.org/index.php/autofs
https://www.freebsd.org/cgi/man.cgi?query=autofs&sektion=5
https://access.redhat.com/documentation/en-us/red_hat_enterp...
Re: Man who thought opening a TXT file is fine thought wrong
#128Oh, 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…
Re: Man who thought opening a TXT file is fine thought wrong
#129Oh, 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…
Re: Man who thought opening a TXT file is fine thought wrong
#130Two 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.
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.