From Bugzilla Helper: User-Agent: Mozilla/5.0 (compatible; Konqueror/3.4) KHTML/3.4.2 (like Gecko) Description of problem: Function innetgr() doesn't free memory if the specified machine is found in the file /etc/netgroup. Doesn't happen in case of no match. This function is used by rpc.mountd (nfs-utils) to check if an host is a member of a network group. Attached patch fixes the bug. Version-Release number of selected component (if applicable): glibc-2.3.4-2.9 How reproducible: Always Steps to Reproduce: 1. Compile following sample program: #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <unistd.h> #include <string.h> #include <netdb.h> int main(int argc, char *argv[]) { char *hname = "p1.mygroup.com"; char *cname = "@mygroup"; while(1) { if(innetgr(cname+1, hname, NULL, NULL)) { printf("Found\n"); } sleep(1); } } 2. Edit /etc/nsswitch.conf, on line networks, put: networks: files 3. Save provided attachment as /etc/netgroup Actual Results: Sample program indefinitly calls innetgr() to check if host p1.mygroup.com is a member of network group mygroup and sleeps 1 second. Using top command shows that memory is consumed on every iteration. Expected Results: Memory usage should not increase. Additional info: Bug tested on Fedora 4 with glibc-2.3.5-10.3
Created attachment 119145 [details] innetgr Patch
Created attachment 119146 [details] Sample /etc/netgroup file
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&r1=1.9548&r2=1.9549 http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/inet/getnetgrent_r.c.diff?cvsroot=glibc&r1=1.29&r2=1.30
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0124.html