Bug 1000780

Summary: WINS name lookup fails from inside a Net-SNMP application
Product: [Fedora] Fedora Reporter: Bart Van Assche <bart.vanassche+redhat>
Component: sambaAssignee: Guenther Deschner <gdeschner>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: abokovoy, asn, extras-orphan, gdeschner, jlayton, notting, sbose, ssorce
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-17 09:39:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bart Van Assche 2013-08-25 07:43:34 UTC
Description of problem:

A WINS name lookup fails if libnetsnmp.so is loaded - it causes an application exit with the error message "ERROR: memdup failed".

Version-Release number of selected component (if applicable):

samba-winbind-clients-4.0.8-1.fc19.i686
Any Net-SNMP version.

How reproducible:

100%

Steps to Reproduce:
1. Edit /etc/nsswitch.conf. Change the "hosts: files dns" line into "hosts: files wins dns"
2. Download the Net-SNMP source code, build it and run its regression tests:
git clone git://git.code.sf.net/p/net-snmp/code net-snmp &&
cd net-snmp &&
./configure --with-defaults &&
make &&
rm -rf /tmp/snmp-test-* &&
make test

Actual results:

We failed these 1 tests:
  com2sec directive ( /home/bart/software/net-snmp/testing/fulltests/default/T070com2sec_simple )

cat /tmp/snmp-test-T070com2sec_simple-*/snmpd.log.stdout 
ERROR: memdup failed

Expected results:

Library functions to report memory allocation failures to the caller instead of calling exit(1).
All Net-SNMP regression tests pass.

Note: the root cause of this is probably that the libnss_wins function load_interfaces() calls memdup() and that the loader redirects this call to the Net-SNMP definition of memdup() instead of the libnss_wins version of memdup().

Comment 1 Bart Van Assche 2013-09-16 18:04:01 UTC
Probably the same issue as https://bugzilla.redhat.com/show_bug.cgi?id=913614.

Comment 2 Bart Van Assche 2013-09-16 18:05:18 UTC
Candidate fix: http://sourceforge.net/p/net-snmp/mailman/message/31405941/.

Comment 3 Guenther Deschner 2013-09-17 09:39:37 UTC
You're right, it's a duplicate.

*** This bug has been marked as a duplicate of bug 913614 ***