Lines 308-313
vsyslog1(int pri, const char *fmt, va_list ap)
Link Here
|
308 |
*/ |
308 |
*/ |
309 |
|
309 |
|
310 |
if (send(LogFile, tbuf, cnt, 0) < 0) { |
310 |
if (send(LogFile, tbuf, cnt, 0) < 0) { |
|
|
311 |
int attempt = 1; |
311 |
if (errno != ENOBUFS) { |
312 |
if (errno != ENOBUFS) { |
312 |
/* |
313 |
/* |
313 |
* Scenario 1: syslogd was restarted |
314 |
* Scenario 1: syslogd was restarted |
Lines 322-328
vsyslog1(int pri, const char *fmt, va_list ap)
Link Here
|
322 |
* possible scenario 2 |
323 |
* possible scenario 2 |
323 |
*/ |
324 |
*/ |
324 |
} |
325 |
} |
325 |
while (errno == ENOBUFS) { |
326 |
while (errno == ENOBUFS && attempt < 1024) { |
326 |
/* |
327 |
/* |
327 |
* Scenario 2: out of socket buffer space |
328 |
* Scenario 2: out of socket buffer space |
328 |
* possible DoS, fail fast on a privileged |
329 |
* possible DoS, fail fast on a privileged |
Lines 333-338
vsyslog1(int pri, const char *fmt, va_list ap)
Link Here
|
333 |
_usleep(1); |
334 |
_usleep(1); |
334 |
if (send(LogFile, tbuf, cnt, 0) >= 0) |
335 |
if (send(LogFile, tbuf, cnt, 0) >= 0) |
335 |
return; |
336 |
return; |
|
|
337 |
attempt++; |
336 |
} |
338 |
} |
337 |
} else |
339 |
} else |
338 |
return; |
340 |
return; |