Skip site navigation (1)Skip section navigation (2)
Date:      Sun,  1 Dec 2002 12:54:31 +0100 (CET)
From:      Petter Reinholdtsen <pere@hungry.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        pere@hungry.com
Subject:   standards/45896: setnetgrent() should return error code
Message-ID:  <20021201115431.EE83612@nerdhaven.nuug.no>

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

>Number:         45896
>Category:       standards
>Synopsis:       setnetgrent() should return error code
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-standards
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Dec 01 04:00:02 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Petter Reinholdtsen
>Release:        FreeBSD 4.7-RELEASE-p1 i386
>Organization:
The Hungry Programmers
>Environment:
System: FreeBSD nerdhaven.nuug.no 4.7-RELEASE-p1 FreeBSD 4.7-RELEASE-p1 #0: Sun Oct 27 09:49:54 CET 2002 root@nerdhaven.nuug.no:/usr/obj/usr/src/sys/NERDHAVEN i386


	
>Description:
	The current setnetgrent() call do not return any value.  This
	make it impossible to detect the difference between an non-existand
	netgroup, and an empty netgroup.  The same call return 'int' on most
	other Unices (Solaris, HP/UX, Tru64 Unix, Darwin, Linux).  The value
	on these unixes is 1 if the group exist, and 0 if it is missing.
>How-To-Repeat:
	The following code fail on FreeBSD.
		#include <netdb.h>
		int main()
		{
			int found = setnetgrent("non-existand-netgroup");
			return 0;
		}
	
>Fix:
	Change the API for setnetgrent() to return 1 on success, and 0
	on failure.
	
>Release-Note:
>Audit-Trail:
>Unformatted:

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




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