Beuc
-
2009-08-07
Group skipped on buffer resize
Brought to you by:
cinergi
Hi,
When the buffer is too small, libnss-mysql returns NSS_TRYAGAIN so that the OS doubles the buffer size and call the function again.
However the MySQL resultset is not reset, so when the function is called again, it uses the next row, and hence skips an entry.
I experienced this while using "getent group" (getgrent) with many users: it skipped a group at each buffer resize.
Attach is a proof-of-concept patch that use mysql_row_tell and mysql_row_seek to fix this issue.