diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-11-06 12:11:35 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:44:34 +0100 |
commit | 32bed4d0fbd2acf3570ccb75cc046eee064b063b (patch) | |
tree | 62f16b73ef33b6553e75ef9c15ba4f6d3ec71784 | |
parent | 37f6b948b7598ca8c532154f3c9833ea0965e887 (diff) | |
download | samba-32bed4d0fbd2acf3570ccb75cc046eee064b063b.tar.gz samba-32bed4d0fbd2acf3570ccb75cc046eee064b063b.tar.bz2 samba-32bed4d0fbd2acf3570ccb75cc046eee064b063b.zip |
r25871: nss_wrapper: set the destination pointer in the get*_r functions
metze
(This used to be commit e68d1c9276a6696efeb7271433072b3cb3ab33cb)
-rw-r--r-- | source4/lib/nss_wrapper/nss_wrapper.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/lib/nss_wrapper/nss_wrapper.c b/source4/lib/nss_wrapper/nss_wrapper.c index 72ddd8d5c3..6d26588fff 100644 --- a/source4/lib/nss_wrapper/nss_wrapper.c +++ b/source4/lib/nss_wrapper/nss_wrapper.c @@ -535,7 +535,7 @@ static void nwrap_pw_unload(struct nwrap_cache *nwrap) } static int nwrap_pw_copy_r(const struct passwd *src, struct passwd *dst, - char *buf, size_t buflen, struct passwd **destp) + char *buf, size_t buflen, struct passwd **dstp) { char *first; char *last; @@ -567,6 +567,10 @@ static int nwrap_pw_copy_r(const struct passwd *src, struct passwd *dst, ofs = PTR_DIFF(src->pw_shell, first); dst->pw_shell = buf + ofs; + if (dstp) { + *dstp = dst; + } + return 0; } @@ -719,7 +723,7 @@ static void nwrap_gr_unload(struct nwrap_cache *nwrap) } static int nwrap_gr_copy_r(const struct group *src, struct group *dst, - char *buf, size_t buflen, struct group **destp) + char *buf, size_t buflen, struct group **dstp) { char *first; char **lastm; @@ -759,6 +763,10 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst, dst->gr_mem[i] = buf + ofs; } + if (dstp) { + *dstp = dst; + } + return 0; } |