open(filename, O_RDONLY) is dangerous
Closed this issue · 1 comments
andoma commented
When calling open(filename, O_RDONLY) from an app...
psl1ght's open code psl1ght_open_r() does this:
oflag |= mode;
Ie, unconditionally OR the third (optional) argument into oflags.
I find this very strange. The mode argument should only be used if O_CREAT is set and even so it should not be merged with the flags argument.
In my case it happened to result (due to whatever was in r5) that all files I opened for reading instead was opened with LV2_O_CREAT | LV2_O_TRUNC ( == very bad)