2 ms·
You probably are right about that, but it can’t be fully correct. If I type “cat ”, drag in a file, and hit return, it isn’t Terminal.app that reads the file, b
by Someone 7y ago
You probably are right about that, but it can’t be fully correct. If I type “cat ”, drag in a file, and hit return, it isn’t Terminal.app that reads the file, but cat, launched by my shell (and that’s the simple case; nothing forbids me from nesting a few shells, a few sudo’s, etc. before accessing a file)
⇒ this special permission must either directly apply to all command-line tools or always be inherited on fork and/or execve (it cannot require a magic system call, as the command-line tool reading or writing data might not be Apple-supplied)
I can see how opening this door “just long enough” gets hairy very easily. So, as others suggest, this may have been implemented as a “OK, let’s do it this way for now, and try and figure out whether we can better later”.