]> git.pld-linux.org Git - packages/chrony.git/blob - chrony-sysheaders.patch
- up to 1.31.1 (fixes CVE-2015-1799, CVE-2015-1821, CVE-2015-1822)
[packages/chrony.git] / chrony-sysheaders.patch
1 diff -urN chrony-1.31.org/chrony_timex.h chrony-1.31/chrony_timex.h
2 --- chrony-1.31.org/chrony_timex.h      2014-09-10 17:00:54.000000000 +0200
3 +++ chrony-1.31/chrony_timex.h  1970-01-01 01:00:00.000000000 +0100
4 @@ -1,73 +0,0 @@
5 -/* Taken from /usr/include/linux/timex.h.  Avoids the need to
6 - * include kernel header files. */
7 -
8 -#ifndef CHRONY_TIMEX_H
9 -#define CHRONY_TIMEX_H
10 -
11 -#include <sys/time.h>
12 -
13 -struct timex {
14 -       unsigned int modes;     /* mode selector */
15 -       long offset;            /* time offset (usec) */
16 -       long freq;              /* frequency offset (scaled ppm) */
17 -       long maxerror;          /* maximum error (usec) */
18 -       long esterror;          /* estimated error (usec) */
19 -       int status;             /* clock command/status */
20 -       long constant;          /* pll time constant */
21 -       long precision;         /* clock precision (usec) (read only) */
22 -       long tolerance;         /* clock frequency tolerance (ppm)
23 -                                * (read only)
24 -                                */
25 -       struct timeval time;    /* (read only) */
26 -       long tick;              /* (modified) usecs between clock ticks */
27 -
28 -       long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
29 -       long jitter;            /* pps jitter (us) (ro) */
30 -       int shift;              /* interval duration (s) (shift) (ro) */
31 -       long stabil;            /* pps stability (scaled ppm) (ro) */
32 -       long jitcnt;            /* jitter limit exceeded (ro) */
33 -       long calcnt;            /* calibration intervals (ro) */
34 -       long errcnt;            /* calibration errors (ro) */
35 -       long stbcnt;            /* stability limit exceeded (ro) */
36 -
37 -       int  :32; int  :32; int  :32; int  :32;
38 -       int  :32; int  :32; int  :32; int  :32;
39 -       int  :32; int  :32; int  :32; int  :32;
40 -};
41 -
42 -#define ADJ_OFFSET             0x0001  /* time offset */
43 -#define ADJ_FREQUENCY          0x0002  /* frequency offset */
44 -#define ADJ_MAXERROR           0x0004  /* maximum time error */
45 -#define ADJ_STATUS             0x0010  /* clock status */
46 -#define ADJ_TIMECONST          0x0020  /* pll time constant */
47 -#define ADJ_SETOFFSET          0x0100  /* add 'time' to current time */
48 -#define ADJ_NANO               0x2000  /* select nanosecond resolution */
49 -#define ADJ_TICK               0x4000  /* tick value */
50 -#define ADJ_OFFSET_SINGLESHOT  0x8001  /* old-fashioned adjtime */
51 -#define ADJ_OFFSET_SS_READ     0xa001  /* read-only adjtime */
52 -
53 -#define SHIFT_USEC 16          /* frequency offset scale (shift) */
54 -
55 -#define STA_PLL                0x0001  /* enable PLL updates (rw) */
56 -#define STA_PPSFREQ    0x0002  /* enable PPS freq discipline (rw) */
57 -#define STA_PPSTIME    0x0004  /* enable PPS time discipline (rw) */
58 -#define STA_FLL                0x0008  /* select frequency-lock mode (rw) */
59 -
60 -#define STA_INS                0x0010  /* insert leap (rw) */
61 -#define STA_DEL                0x0020  /* delete leap (rw) */
62 -#define STA_UNSYNC     0x0040  /* clock unsynchronized (rw) */
63 -#define STA_FREQHOLD   0x0080  /* hold frequency (rw) */
64 -
65 -#define STA_PPSSIGNAL  0x0100  /* PPS signal present (ro) */
66 -#define STA_PPSJITTER  0x0200  /* PPS signal jitter exceeded (ro) */
67 -#define STA_PPSWANDER  0x0400  /* PPS signal wander exceeded (ro) */
68 -#define STA_PPSERROR   0x0800  /* PPS signal calibration error (ro) */
69 -
70 -#define STA_CLOCKERR   0x1000  /* clock hardware fault (ro) */
71 -#define STA_NANO       0x2000  /* resolution (0 = us, 1 = ns) (ro) */
72 -
73 -/* This doesn't seem to be in any include files !! */
74 -
75 -extern int adjtimex(struct timex *);
76 -
77 -#endif /* CHRONY_TIMEX_H */
78 diff -urN chrony-1.31.org/wrap_adjtimex.c chrony-1.31/wrap_adjtimex.c
79 --- chrony-1.31.org/wrap_adjtimex.c     2014-09-10 17:00:54.000000000 +0200
80 +++ chrony-1.31/wrap_adjtimex.c 2015-02-19 18:14:48.994437746 +0100
81 @@ -22,18 +22,33 @@
82  
83    =======================================================================
84  
85 -  This is a wrapper around the Linux adjtimex system call.  It isolates the
86 -  inclusion of <linux/adjtimex.h> from the need to include other header files,
87 -  many of which conflict with those in <linux/...> on some recent distributions
88 -  (as of Jul 2000) using kernels around 2.2.16 onwards.
89 +  This is a wrapper around the Linux adjtimex system call.
90  
91    */
92  
93  #include "config.h"
94  
95 -#include "chrony_timex.h"
96  #include "wrap_adjtimex.h"
97  
98 +#include <sys/timex.h>
99 +
100 +/* Definitions used if missing in the system headers */
101 +#ifndef ADJ_TAI
102 +#define ADJ_TAI                 0x0080  /* set TAI offset */
103 +#endif
104 +#ifndef ADJ_SETOFFSET
105 +#define ADJ_SETOFFSET           0x0100  /* add 'time' to current time */
106 +#endif
107 +#ifndef ADJ_NANO
108 +#define ADJ_NANO                0x2000  /* select nanosecond resolution */
109 +#endif
110 +#ifndef ADJ_OFFSET_SS_READ
111 +#define ADJ_OFFSET_SS_READ      0xa001  /* read-only adjtime */
112 +#endif
113 +
114 +/* Frequency offset scale (shift) */
115 +#define SHIFT_USEC 16
116 +
117  static int status = 0;
118  
119  int
This page took 0.034622 seconds and 3 git commands to generate.