Mercurial > syslog2iptables
comparison src/syslogconfig.cpp @ 31:601bc0e075e1
gpl3
author | carl |
---|---|
date | Sun, 09 Sep 2007 10:59:15 -0700 |
parents | 6465d8640489 |
children | d2ceebcf6595 |
comparison
equal
deleted
inserted
replaced
30:718e94b6b049 | 31:601bc0e075e1 |
---|---|
348 lseek(fd, 0, SEEK_END); | 348 lseek(fd, 0, SEEK_END); |
349 if (fstat(fd, &openfdstat)) { | 349 if (fstat(fd, &openfdstat)) { |
350 close(); | 350 close(); |
351 snprintf(buf, sizeof(buf), "syslog file %s cannot stat after open", file_name); | 351 snprintf(buf, sizeof(buf), "syslog file %s cannot stat after open", file_name); |
352 tokp->token_error(buf); | 352 tokp->token_error(buf); |
353 } | |
354 // specify that this fd gets closed on exec, so that selinux | |
355 // won't complain about iptables trying to read log files. | |
356 int oldflags = fcntl(fd, F_GETFD, 0); | |
357 if (oldflags >= 0) { | |
358 fcntl(fd, F_SETFD, oldflags | FD_CLOEXEC); | |
353 } | 359 } |
354 } | 360 } |
355 } | 361 } |
356 | 362 |
357 | 363 |