Email List: Xaustin-review-lX
[All Lists]

Defect in XSH getgrnam, getgrnam_r - search group database for a name

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH getgrnam, getgrnam_r - search group database for a name
From: yyyyyy@xxxxxxxx
Date: Fri, 2 Dec 2005 16:50:01 GMT
        Defect report from : Tobias Burnus , ZEDV, Physics Department, Free 
Univ. Berlin

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page P520 line L17147-17148 section getgrnam, getgrnam_r - search group 
database for a name editorial {getgrnam}

Problem:

Edition of Specification (Year): 2004

Defect code :  3. Clarification required

For both getgrnam and getgrnam_r the specification is a bit unclear in terms 
what is returned, when no entry has been found.


getgrnam()

SUSv3: "The getgrnam() function shall return a null pointer if either the 
requested entry was not found, or an error occurred. On error, errno shall be 
set to indicate the error."


Ok, I'd expect that getgrnam("noExist") == NULL, but it is not clearly stated 
whether the errno may be changed or not.
I read this as: errno stays that value and is not touched.

Others regard this a undefined by the spec. (GNU Libc maintainer: "The code 
always did signal a missing entry with a NULL pointer and ENOENT.  There is 
nothing in POSIX which prohibits this.  The POSIX spec just said what has to 
happen for the error conditions.")



getgrnam_r()

Description: "A NULL pointer is returned at the location pointed to by result 
on error or if the requested entry is not found."

Returned value: "If successful, the getgrnam_r() function shall return zero; 
otherwise, an error number shall be returned to indicate the error."

It is a bit unclear whether the error number is zero or not if entry has been 
found.

Action:

a) Clearify whether errno (getgrnam) is modified when no entry has been found

b) Clearify whether not found is "successful", i.e. whether zero is returned or 
not.

<Prev in Thread] Current Thread [Next in Thread>
  • Defect in XSH getgrnam, getgrnam_r - search group database for a name, burnus <=