Deal with a NULL gr_passwd. Reported by Anders Qvist.
This commit is contained in:
parent
254eb5380f
commit
ceb7c18c10
|
@ -58,7 +58,12 @@ mkgrent(struct group *p)
|
||||||
|
|
||||||
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
|
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
|
||||||
SET(setIndex++, PyString_FromString(p->gr_name));
|
SET(setIndex++, PyString_FromString(p->gr_name));
|
||||||
SET(setIndex++, PyString_FromString(p->gr_passwd));
|
if (p->gr_passwd)
|
||||||
|
SET(setIndex++, PyString_FromString(p->gr_passwd));
|
||||||
|
else {
|
||||||
|
SET(setIndex++, Py_None);
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
}
|
||||||
SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
|
SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
|
||||||
SET(setIndex++, w);
|
SET(setIndex++, w);
|
||||||
#undef SET
|
#undef SET
|
||||||
|
|
Loading…
Reference in New Issue