aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2019-02-15 18:44:43 +0100
committerAndreas Schneider <asn@samba.org>2019-02-28 12:48:42 +0100
commit205e3f27b2b6c6890d503a413d72619cb817e154 (patch)
tree798fb98ccf01f11563b8e82fb0443bc77df633a1
parenta0f38b46a20b9d55bb67ce4e8d91eff8bcad0203 (diff)
downloadnss_wrapper-205e3f27b2b6c6890d503a413d72619cb817e154.tar.gz
nss_wrapper-205e3f27b2b6c6890d503a413d72619cb817e154.tar.xz
nss_wrapper-205e3f27b2b6c6890d503a413d72619cb817e154.zip
nwrap: Fix copying 'struct passwd' on FreeBSD
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r--src/nss_wrapper.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index f8f6ce7..62c7af1 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -2091,6 +2091,19 @@ static int nwrap_pw_copy_r(const struct passwd *src, struct passwd *dst,
dst->pw_passwd = buf + ofs;
dst->pw_uid = src->pw_uid;
dst->pw_gid = src->pw_gid;
+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
+ ofs = PTR_DIFF(src->pw_class, first);
+ dst->pw_class = buf + ofs;
+#endif /* HAVE_STRUCT_PASSWD_PW_CLASS */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
+ dst->pw_change = 0;
+#endif /* HAVE_STRUCT_PASSWD_PW_CHANGE */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
+ dst->pw_expire = 0;
+#endif /* HAVE_STRUCT_PASSWD_PW_EXPIRE */
+
ofs = PTR_DIFF(src->pw_gecos, first);
dst->pw_gecos = buf + ofs;
ofs = PTR_DIFF(src->pw_dir, first);