there was no real "it's fixed" conclusion yesterday, was there?
Oh, sorry... It's fixed!
I.e. could you point me to a commit to cherry-pick?
https://github.com/FreeRADIUS/freeradius-server/commit/a2a04cd15bc3886ceb7d1...
If not... here's a really simple and stupid suggestion (from someone who didn't write C/C++ since a decade!):
if ((rad_lockfd(fd, len + 2) < 0) || (write(fd, query, len) < 0) || (write(fd, ";\n", 2) < 0)) {
Since the main problem is that the ; and queries somehow get mixed - would not a *single* write that combines the two write()s fix that? I'm thinking of:
... || (write(fd, query + ";\n", len + 2) < 0) ...
Maybe I'm too naive ...
Well, it'd involve allocing an intermediary buffer as you can't do string concatenation like that in C. There is that other multi variable version of write, but i'm not sure if it's guaranteed to be atomic. Maybe Alan can comment, he seems to have an encyclopaedic knowledge of C pitfalls :) -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2