3 ms·
It's a unix standard, or at least more than just a design pattern. You know how in any unix shell, typing cd ~ takes you to your home directory? This is actuall
by Alex3917 9y ago
It's a unix standard, or at least more than just a design pattern. You know how in any unix shell, typing cd ~ takes you to your home directory? This is actually a shortcut for typing cd ~yourusername. So having xyz.tld/~username/... in a url path means that the file is hosted in userland, since ~username is the first part of the filepath hosted behind that URL.
Websites have been using this pattern for 25+ years, so it's pretty universal by now.
- gertef 9y agoIt's not a security standard.
- nucleardog 9y agoIt's not even a standard. At best you could call it a convention. And a much more narrowly defined one than you seem to think. The `~` or `~username` is expanded by your shell (but not necessarily all shells) and has nothing to do with the operating system. If you pass a filename like `~myusername/test.txt` to any unix's open() syscall, it's going to either fail or open a file in a directory literally called `~myusername`. This means anywhere you're passing a filename into a program that isn't your shell does not generally support that syntax. A narrowly defined, poorly recognized convention is not a great thing to rely on for security purposes.
- Alex3917 9y agoFair enough. What's the process for submitting it as a proposed standard? I'll write it up.
- inetknght 9y agoIt depends on where you want to make the proposal. I'd make a guess with the POSIX standard. At that point, I think you'd submit a proposal somewhere around http://www3.opengroup.org/content/posix® http://www3.opengroup.org/content/posix® Also, that ® at the end of posix is part of the URL, you will unfortunately get a 404 if you don't copy-paste it right. You might be better to search for "site:opengroup.org posix" Good luck, man