Funny enough macOS, iOS, iPadOS and Android do this and they are constantly attacked for it.
I do think there needs to be more strict adherence by developers to standards like XDG but I don’t know how it could be enforced.
Funny enough macOS, iOS, iPadOS and Android do this and they are constantly attacked for it.
I do think there needs to be more strict adherence by developers to standards like XDG but I don’t know how it could be enforced.
I'm not sure what the purpose of the question is, because a unixy command line doesn't use phone-style permissions. I didn't say everything works this way.
If I installed photoshop with phone-style permissions, it wouldn't be able to invoke chmod and wouldn't even be able to access my downloads folder.
(Trying to tighten down a command line shell ends up being a tangent, but the short answer is that zsh itself would need to be trusted and hardened, and wget would not be allowed to run chmod. When it comes to downloading a script and then running that script on purpose, you probably just have to accept that doing so bypasses the permission system. Thankfully I very rarely need to do something like that.)
Now what should happen if the text editor decides to modify /etc/hosts without your knowledge?
Pop up a UAC prompt of course. It worked so well for Vista.
This works better with a GUI, but you can adapt it to a console too.
Even if users don't read the permission dialogs, you can make one path a lot easier. And you can flag anything too tricky as malware behavior.
OSes are doing a bad job of this, but they could do much better. Linux is making the most progress on various package formats.
It can't be enforced. Developers can and will always do whatever they want with the tools available. For good ends (Adobe) or for ill (malware).
If you try to fix it with sandboxing and closed app stores (Apple forcing sandboxing and using SIP), you get attacked. If you don't try to fix it and let devs do as they please (Microsoft allowing host file editing), you get attacked. The conclusion of these incompatible goals? HN and nerds have zero relevance in policy discussions, because they don't have a consistent policy to offer [1].
[1] Unless, of course, you define "devs shouldn't be able to do anything bad even if they choose" and "users should be able to anything bad if they choose" and "users should be able to write their own software capable of bad things while simultaneously not being held to the standard of devs" as a compatible principled position.
The problem with things like iOS is the user can't make that choice. Also what you call 'bad' is up to the user. At the end of the day a user should be able to adjust things even at root level or request other software to do that on their behalf. Heck for iDevices owners should be able to load their own signing keys at a minimum for the Boot-ROM.
As for Adobe most people would not expect their software to touch the host file, so it's fine to call them out here. Someone using a utility or tool that you would expect to edit the host file that's fine, and people should be able to use or make such a tool. (The os should not prevent the user/owner if that's what they want).