Hacker News new | ask | show | jobs
by lizknope 1712 days ago
https://en.wikipedia.org/wiki/Everything_is_a_file

Why is the socket interface the way it is? Why isn't it like /dev/tcp in bash?

I tried Plan 9 about 10 years ago. Since then I use VPNs everyday and it can be tricky to setup at times.

The Plan 9 concept of just importing /net from the VPN machine as a union overlay is so elegant.

https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs#Combinin...

1 comments

>Why is the socket interface the way it is? Why isn't it like /dev/tcp in bash?

That's wrong. /dev/tcp or /dev/udp should be devices themselves, not a fake one for bash.

I know the one in bash is fake but I'm saying that /dev/tcp and /dev/udp could be filesystems like /dev or /proc

Open /dev/tcp/google.com/80 or /dev/tcp/192.168.1.1/22 or whatever.

Instead of having your web server start as root and then do some UID switching to drop priveleges why not have it start as a non priveleged user from the beginning?

The ports under 1024 are reserved for root but how about we get rid of that and have files for every port number? Then use chown and chmod to set permissions and only let the httpd user account read and write to port 80?

Plan9 doesn't work like that, you have a /net equivalent per namespace.

https://doc.cat-v.org/plan_9/4th_edition/papers/names