[issue10388] spwd returning different value depending on privileges

Robert Collins report at bugs.python.org
Sat Jul 25 21:11:13 CEST 2015


Robert Collins added the comment:

The man page for setspent says this:
"The functions that return a pointer return NULL if no more entries are available or if an error occurs during processing.  The functions  which
       have int as the return value return 0 for success and -1 for failure, with errno set to indicate the cause of the error.

       For the nonreentrant functions, the return value may point to static area, and may be overwritten by subsequent calls to these functions.

       The reentrant functions return zero on success.  In case of error, an error number is returned.

"

-> that is, setspent's interaction with errno is undefined, at least on Linux. I'm a little worried about whether this may pickup false errors as a result.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10388>
_______________________________________


More information about the Python-bugs-list mailing list