~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to ports/winnt/ntpd/win32_io.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-01-05 21:10:03 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090105211003-mh6zc3um4k1uhsj7
Tags: 1:4.2.4p4+dfsg-8
It did not properly check the return value of EVP_VerifyFinal
which results in an malformed DSA signature being treated as
a good signature rather than as an error.  (CVE-2009-0021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
int NT_set_process_priority(void)
19
19
{
20
 
        DWORD  SingleCPUMask = 0;
21
 
        DWORD ProcessAffinityMask, SystemAffinityMask;
22
 
        if (!GetProcessAffinityMask(GetCurrentProcess(), &ProcessAffinityMask, &
23
 
                 SystemAffinityMask))
24
 
                msyslog(LOG_ERR, "GetProcessAffinityMask: %m");
25
 
        else {
26
 
                SingleCPUMask = 1; 
27
 
# ifdef DEBUG 
28
 
        msyslog(LOG_INFO, "System AffinityMask = %x", SystemAffinityMask); 
29
 
# endif 
30
 
                }
31
 
 
32
 
        while (SingleCPUMask && !(SingleCPUMask & SystemAffinityMask)) 
33
 
                SingleCPUMask = SingleCPUMask << 1; 
34
 
                
35
 
        if (!SingleCPUMask) 
36
 
                msyslog(LOG_ERR, "Can't set Processor Affinity Mask"); 
37
 
        else if (!SetProcessAffinityMask(GetCurrentProcess(), SingleCPUMask)) 
38
 
                msyslog(LOG_ERR, "SetProcessAffinityMask: %m"); 
39
 
# ifdef DEBUG 
40
 
        else msyslog(LOG_INFO,"ProcessorAffinity Mask: %x", SingleCPUMask ); 
41
 
# endif 
42
20
        if (!SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS)) 
43
21
                {
44
22
                msyslog(LOG_ERR, "SetPriorityClass: %m"); 
57
35
int
58
36
refclock_open(
59
37
        char *dev,              /* device name pointer */
60
 
        int speed,              /* serial port speed (code) */
61
 
        int flags               /* line discipline flags */
 
38
        u_int speed,            /* serial port speed (code) */
 
39
        u_int flags             /* line discipline flags */
62
40
        )
63
41
{
64
42
        HANDLE Handle = INVALID_HANDLE_VALUE;
77
55
                NULL); // not template
78
56
        if (Handle == INVALID_HANDLE_VALUE) {  
79
57
                 
80
 
                msyslog(LOG_ERR, "NT_COM: Device %s: CreateFile ", dev);
 
58
                msyslog(LOG_ERR, "NT_COM: Device %s: CreateFile error: %m", dev);
81
59
                return -1;
82
60
        }
83
61
 
84
62
        /*  Change the input/output buffers to be large.
85
63
        */
86
64
        if (!SetupComm( Handle, 1024, 1024)) {
87
 
                msyslog(LOG_ERR, "NT_COM: Device %s: SetupComm ", dev);
 
65
                msyslog(LOG_ERR, "NT_COM: Device %s: SetupComm error: %m", dev);
88
66
                return -1;
89
67
        }
90
68
 
91
69
        dcb.DCBlength = sizeof(dcb);
92
70
        if (!GetCommState(Handle, &dcb)) {
93
71
                // Error getting current DCB settings
94
 
                msyslog(LOG_ERR, "NT_COM: Device %s: GetCommState ", dev);
 
72
                msyslog(LOG_ERR, "NT_COM: Device %s: GetCommState error: %m", dev);
95
73
                return -1;
96
74
        }
97
75
 
131
109
        dcb.EofChar = 0;
132
110
 
133
111
        if (!SetCommState(Handle, &dcb)) {
134
 
                msyslog(LOG_ERR, "NT_COM: Device %s: SetCommState ", dev);
 
112
                msyslog(LOG_ERR, "NT_COM: Device %s: SetCommState error: %m", dev);
135
113
                return -1;
136
114
        }
137
115
 
143
121
 
144
122
           // Error setting time-outs.
145
123
        if (!SetCommTimeouts(Handle, &timeouts)) {
146
 
                msyslog(LOG_ERR, "NT_COM: Device %s: SetCommTimeouts ", dev);
 
124
                msyslog(LOG_ERR, "NT_COM: Device %s: SetCommTimeouts error: %m", dev);
147
125
                return -1;
148
126
        }
149
127
 
180
158
        dcb.DCBlength = sizeof(dcb);
181
159
        if (!GetCommState(Handle, &dcb)) {
182
160
                // Error getting current DCB settings
183
 
                msyslog(LOG_ERR, "NT_COM: GetCommState ");
 
161
                msyslog(LOG_ERR, "NT_COM: GetCommState error: %m");
184
162
                return FALSE;
185
163
        }
186
164
 
237
215
        dcb.EofChar = 0;
238
216
 
239
217
        if (!SetCommState(Handle, &dcb)) {
240
 
                msyslog(LOG_ERR, "NT_COM: SetCommState ");
 
218
                msyslog(LOG_ERR, "NT_COM: SetCommState error: %m");
241
219
                return FALSE;
242
220
        }
243
221
        return TRUE;
252
230
        dcb.DCBlength = sizeof(dcb);
253
231
        if (!GetCommState(Handle, &dcb)) {
254
232
                // Error getting current DCB settings
255
 
                msyslog(LOG_ERR, "NT_COM: GetCommState ");
 
233
                msyslog(LOG_ERR, "NT_COM: GetCommState error: %m");
256
234
                return FALSE;
257
235
        }
258
236