Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2001 11:42:54 -0500 (CDT)
From:      gil@arlut.utexas.edu
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   misc/26486: setnetgrent hangs when netgroup contains empty netgroup
Message-ID:  <200104101642.f3AGgs050799@csdpc2.arlut.utexas.edu>

next in thread | raw e-mail | index | archive | help

>Number:         26486
>Category:       misc
>Synopsis:       setnetgrent hangs when netgroup contains empty netgroup
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 10 09:50:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Gil Kloepfer
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
UT Applied Research Laboratories
>Environment:

	FreeBSD 4.2-RELEASE, and 4.3-RC2, probably others, using
	NIS netgroups.

>Description:

	NIS (yp) netgroups set-up as follows:

	ssh-users	adg-ssh-users omg-ssh-users
	adg-ssh-users
	omg-ssh-users	(-,foo,) (-,bar,)

	A call to setnetgrent("ssh-users") will hang due to the empty
	adg-ssh-users netgroup.  However, it does work when accessed
	via /etc/passwd using the +@ syntax...

>How-To-Repeat:

	using above conditions...

	#include <stdlib.h>
	#include <stdio.h>

	main()
	{
        	char            *nh, *nu, *nd;

        	printf("1\n");
        	setnetgrent("ssh-users");

        	printf("2\n");
        	nh = nu = nd = (char *)0;
        	while (getnetgrent(&nh, &nu, &nd) > 0) {
                	printf("3\n");
                	printf("> %s\n", nu);
        	}

        	printf("4\n");
        	endnetgrent();

        	printf("5\n");
        	exit(0);
	}



>Fix:

	Currently investigating where the hang is occuring.  Will update
	as soon as I find out more, unless someone else finds it first
	and lets me know.  Probably in the parse_netgrp function in
	/usr/src/lib/libc/gen/getnetgrent.c
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104101642.f3AGgs050799>