Re: sockfs - a filesystem for reserved port permissions

Darren Reed (darrenr@cyber.com.au)
Fri, 19 Sep 1997 11:31:07 +1000 (EST)


In some mail I received from Taner Halicioglu, sie wrote
>
> On Fri, 19 Sep 1997, Darren Reed wrote:
>
> > In some mail I received from Malcolm Beattie, sie wrote
> > >
> > > Surely anonymous sockets shouldn't get bound to port numbers less
> > > than 1024 (i.e. PROT_SOCK)? The kernel patch I made was a bit wrong
> >
> > Why not make "1024" configurable ? >:-) But in addition, to defining
> > anonymous range, I'm suggesting also defining the "root-only" range
> > with a similar variable.
>
> Well, an interesting example of 'random ports' that get bound to a port #
> below 1024, is ssh. ssh starts at 1023, and works DOWN... rather
> interesting, if you ask me.
>
> I was rather perplexed as to why, but I can only guess it's to avoid any
> possibilities of another non-root program trying to bind at the same time?

The BSD r* programs (rlogin/rcp/rsh - anything that uses rcmd basically)
work the same way.

All these programs _search_ for the first free port below 1024.