3.0.2: rlm_sql_null duplicating its statements

Arran Cudbard-Bell a.cudbardb at freeradius.org
Tue Apr 8 10:12:51 CEST 2014


> 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/a2a04cd15bc3886ceb7d197d943639365e168652

> 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 at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freeradius.org/mailman/private/freeradius-users/attachments/20140408/7369cc5f/attachment.pgp>


More information about the Freeradius-Users mailing list