balabit / syslog-ng-incubator

Experimental modules for syslog-ng 3.5+
Other
52 stars 28 forks source link

getent: handle errors #80

Closed faxm0dem closed 7 years ago

faxm0dem commented 10 years ago

I'm stumbling on the following error message for large groups:

syslog-ng[9522]: $(getent group) failed; key='124', errno='Numerical result out of range (34)'

Found some references:

faxm0dem commented 10 years ago

Trying to solve this with my limited Cskills. I'm seeing this error for groups with the following sizes (according to getent group <gid> | wc -c): 875, 726, 1004, ... . Looking at the code, I see bufsize which on my system seems to be 1024: shouldn't that be enough for these groups?

faxm0dem commented 10 years ago

I guess the solution would be to have a loop reallocating the buffer in case if (errno == ERANGE)

algernon commented 10 years ago

As a quick workaround, I'd try upping the buffer size to something like 4096. That's easier and less costy than reallocation would be.

faxm0dem commented 10 years ago

you mean by ignoring _SC_GETPW_R_SIZE_MAX completely?

algernon commented 10 years ago

Yes.

mochrul commented 7 years ago

getent module removed from the incubator (and merged into syslog-ng upstream).