Lines 1-24
Link Here
|
1 |
--- ntpd/ntpd.c.orig 2020-06-23 02:17:48.000000000 -0700 |
1 |
--- ntpd/ntpd.c.orig 2020-06-23 02:17:48.000000000 -0700 |
2 |
+++ ntpd/ntpd.c 2022-01-26 10:14:00.828563000 -0800 |
2 |
+++ ntpd/ntpd.c 2022-02-18 09:28:58.368959000 -0800 |
3 |
@@ -145,7 +145,9 @@ |
3 |
@@ -145,17 +145,6 @@ |
4 |
# include <seccomp.h> |
4 |
# include <seccomp.h> |
5 |
#endif /* LIBSECCOMP and KERN_SECCOMP */ |
5 |
#endif /* LIBSECCOMP and KERN_SECCOMP */ |
6 |
|
6 |
|
7 |
-#ifdef __FreeBSD__ |
7 |
-#ifdef __FreeBSD__ |
8 |
+#if defined(__FreeBSD_version) && \ |
8 |
-#include <sys/procctl.h> |
9 |
+ ((__FreeBSD_version > 1400000 && __FreeBSD_version < 1400038) || \ |
9 |
-#ifndef PROC_STACKGAP_CTL |
10 |
+ __FreeBSD_version < 1300524) |
10 |
-/* |
11 |
#include <sys/procctl.h> |
11 |
- * Even if we compile on an older system we can still run on a newer one. |
12 |
#ifndef PROC_STACKGAP_CTL |
12 |
- */ |
13 |
/* |
13 |
-#define PROC_STACKGAP_CTL 17 |
14 |
@@ -438,7 +440,9 @@ |
14 |
-#define PROC_STACKGAP_DISABLE 0x0002 |
|
|
15 |
-#endif |
16 |
-#endif |
17 |
- |
18 |
#ifdef HAVE_DNSREGISTRATION |
19 |
# include <dns_sd.h> |
20 |
DNSServiceRef mdns; |
21 |
@@ -438,18 +427,6 @@ |
15 |
char *argv[] |
22 |
char *argv[] |
16 |
) |
23 |
) |
17 |
{ |
24 |
{ |
18 |
-# ifdef __FreeBSD__ |
25 |
-# ifdef __FreeBSD__ |
19 |
+# if defined(__FreeBSD_version) && \ |
26 |
- { |
20 |
+ ((__FreeBSD_version > 1400000 && __FreeBSD_version < 1400038) || \ |
27 |
- /* |
21 |
+ __FreeBSD_version < 1300524) |
28 |
- * We Must disable ASLR stack gap on FreeBSD to avoid a |
22 |
{ |
29 |
- * segfault. See PR/241421 and PR/241960. |
23 |
/* |
30 |
- */ |
24 |
* We Must disable ASLR stack gap on FreeBSD to avoid a |
31 |
- int aslr_var = PROC_STACKGAP_DISABLE; |
|
|
32 |
- |
33 |
- pid_t my_pid = getpid(); |
34 |
- procctl(P_PID, my_pid, PROC_STACKGAP_CTL, &aslr_var); |
35 |
- } |
36 |
-# endif |
37 |
return ntpdmain(argc, argv); |
38 |
} |
39 |
#endif /* !SYS_WINNT */ |