rsyslogd please apply patch for large group handling

Bug #933943 reported by Alec Warner
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rsyslog
Fix Released
Low
rsyslog (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

http://bugzilla.adiscon.com/show_bug.cgi?id=310

rsyslog uses a static 2048 character buffer to perform group lookups. Some of us have large groups and need a larger buffer. This patch repeatedly calls getgrnam_r until it gets a buffer of sufficient size.

-A

Tags: patch
Revision history for this message
In , Alec Warner (antarus) wrote :

I'll attach a patch shortly.

Revision history for this message
In , Alec Warner (antarus) wrote :

Created attachment 146
Call getgrnam_r repeatedly if we receive ERANGE

Some large enterprises have huge groups that need to be resolved.

Example: I have a group that needs a 2MB buffer ;)

antarus@goats2 /tmp $ ./a.out
Trying 4096
Trying 8192
Trying 16384
Trying 32768
Trying 65536
Trying 131072
Trying 262144
Trying 524288
Trying 1048576
Trying 2097152

Revision history for this message
Alec Warner (antarus) wrote :

This patch is against, HEAD, I still need to verify this patch for Lucid and Precise.

-A

Changed in rsyslog:
importance: Unknown → Low
status: Unknown → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "0001-call-getgrnam_r-repeatedly-to-get-all-group-members.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in rsyslog (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
In , Rgerhards-j (rgerhards-j) wrote :

Finally merged the fix ;) Please note that there is a small memory leak associated with it. I corrected it with this commit:

http://git.adiscon.com/?p=rsyslog.git;a=commitdiff;h=e593f6a22fbebe7a06dd4b08b378ab5d12e7d8ad

This is to be released with 5.8.12

Revision history for this message
In , Alec Warner (antarus) wrote :

(In reply to comment #2)
> Finally merged the fix ;) Please note that there is a small memory leak
> associated with it. I corrected it with this commit:

Yeah sorry, I fixed the memory leak in our internal copy and never sent you the updated patch. Thanks for merging it.

-A

>
> http://git.adiscon.com/?p=rsyslog.git;a=commitdiff;h=e593f6a22fbebe7a06dd4b08b378ab5d12e7d8ad
>
> This is to be released with 5.8.12

Changed in rsyslog:
status: Confirmed → Fix Released
Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote :

Why does this say "Fix Released" if it's not released in Ubuntu? What package should I wait for?

Revision history for this message
In , Theinric (theinric) wrote :

Hi, I have several remarks.

There's a potential for an endless loop in not so unrealistic conditions.

Every other error besides ERANGE causes this. E.g. referencing a non-existent group. Others can be caused by missing permissions, wrong configuration in /etc/nsswitch.conf, etc.

Attached is a patch that should mitigate this. Manpages are a bit ambiguous about how getgrnam_r() reports errors, but it looks safe to ignore errno completely and rely on the return code.

The patch is for 5.10.2 but the code in v7 is almost identical.

Revision history for this message
In , Theinric (theinric) wrote :

Created attachment 209
patch for the endless loop

Changed in rsyslog:
status: Fix Released → Confirmed
Revision history for this message
In , Rgerhards-j (rgerhards-j) wrote :

Thanks for the patch. Merged it into v5-stable (5.10.2 candidate), v6-stable, v7-stable (7.2.7) and v7-devel (7.3.9). Will be released with the next regular releases.

Changed in rsyslog:
status: Confirmed → Fix Released
Revision history for this message
Simon Déziel (sdeziel) wrote :

Marking as fix released based on versions reported in comment # 10. Ubuntu Trusty ships 7.4.4 so it has the patch.

Changed in rsyslog (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.