summaryrefslogtreecommitdiff
path: root/Modules/pwdmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/pwdmodule.c')
-rw-r--r--Modules/pwdmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c
index 7416cf71d5..784e9d0349 100644
--- a/Modules/pwdmodule.c
+++ b/Modules/pwdmodule.c
@@ -75,10 +75,18 @@ mkpwent(struct passwd *p)
#define SETS(i,val) sets(v, i, val)
SETS(setIndex++, p->pw_name);
+#if defined(HAVE_STRUCT_PASSWD_PW_PASSWD) && !defined(__ANDROID__)
SETS(setIndex++, p->pw_passwd);
+#else
+ SETS(setIndex++, "");
+#endif
PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid));
PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid));
+#if defined(HAVE_STRUCT_PASSWD_PW_GECOS)
SETS(setIndex++, p->pw_gecos);
+#else
+ SETS(setIndex++, "");
+#endif
SETS(setIndex++, p->pw_dir);
SETS(setIndex++, p->pw_shell);