Re: Where are privileged ports defined in the kernel?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Mr. Tomcat wrote:

> I am doing some experimentation and trying to change the range of
> privileged ports in the kernel, so I could make it more restrictive
> (only root can bind to ports < 10000) or less restrictive (any user can
> bind to any port).  It seems like there should be a constant defined in
> a .h file somewhere which controls this, but I can't find it.  I found
> in /usr/include/netinet/in.h the constant  IPPORT_RESERVED = 1024 but I
> can't find that anywhere in the kernel.  Can anyone point me to the
> right file?

IPPORT_RESERVED is user-mode. This is the value which user-space code
(e.g. rresvport()) uses to determine whether a port is "privileged".

It doesn't necessarily correspond to the port range for which the
kernel requires root privilege. AFAICT, that is defined by:

	#define PROT_SOCK	1024

in e.g. /usr/src/linux/include/net/sock.h.

-- 
Glynn Clements <glynn.clements@virgin.net>
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux