oetiker / rrdtool-1.x

RRDtool 1.x - Round Robin Database
http://www.rrdtool.org
GNU General Public License v2.0
987 stars 257 forks source link

Open files with `O_CLOEXEC` #1202

Open ensc opened 1 year ago

ensc commented 1 year ago

To increase thread safety, the rrd files should be opened with O_CLOEXEC. Else, the fd might leak to programs which are started by execv() in other threads.

Atm, only

openat(AT_FDCWD, "/log/iftraf/ext0.rrd", O_RDWR) = 4

is used which is prone for races

oetiker commented 1 year ago

can you provide a PR?