freeradius-client rc_avpair_log() function
Hi, AFAIU, rc_avpair_log() function in freeradius-client is not thread-safe, it uses a shared buffer (rh->ppbuf). So one can't have shared rc_handle if calling to rc_avpair_log() from different threads. Please tell me if that's correct and I'll make a simple patch changing: rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair) to rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair, char *buf, size_t l) This way a caller will provide a non-shared buffer. -- Best Regards, Alex Massover VoIP R&D TL Jajah Inc. This mail was sent via Mail-SeCure System.
Hi Alan, Here's a patch attached.
Please tell me if that’s correct and I’ll make a simple patch changing:
rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair)
to
rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair, char *buf, size_t l)
That's a good idea, thanks.
Alan DeKok.
This mail was sent via Mail-SeCure System.
Hi, one more patch in addition to the previous one. Nobody uses ppbuf in rc_conf struct anymore, and probably not supposed to, because shared buffer is not thread-safe. So this patch removes this buffer.
Hi Alan,
Here's a patch attached.
Please tell me if that’s correct and I’ll make a simple patch changing:
rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair)
to
rc_avpair_log(rc_handle *rh, VALUE_PAIR *pair, char *buf, size_t l)
That's a good idea, thanks.
Alan DeKok.
This mail was sent via Mail-SeCure System.
This mail was received via Mail-SeCure System.
This mail was sent via Mail-SeCure System.
participants (2)
-
Alan DeKok -
Alex Massover