From c4a20912b12915281cbe68e6816475eda7191e56 Mon Sep 17 00:00:00 2001 From: metze Date: Tue, 6 Nov 2007 12:34:50 +0000 Subject: nss_wrapper: hopefully a better fix for the solaris get*ent_r functions metze git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25873 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit e0c8c01650b2aa0a1ab491c9800b8aa575bf4185) --- source3/lib/nss_wrapper/nss_wrapper.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'source3/lib') diff --git a/source3/lib/nss_wrapper/nss_wrapper.c b/source3/lib/nss_wrapper/nss_wrapper.c index f4ea9bb6de..5bf7ebda4f 100644 --- a/source3/lib/nss_wrapper/nss_wrapper.c +++ b/source3/lib/nss_wrapper/nss_wrapper.c @@ -906,7 +906,21 @@ _PUBLIC_ int nwrap_getpwent_r(struct passwd *pwdst, char *buf, struct passwd *pw; if (!nwrap_enabled()) { +#ifdef SOLARIS_GETPWENT_R + pw = real_getpwent_r(pwdst, buf, buflen); + if (!pw) { + if (errno == 0) { + return ENOENT; + } + return errno; + } + if (pwdstp) { + *pwdstp = pw; + } + return 0; +#else return real_getpwent_r(pwdst, buf, buflen, pwdstp); +#endif } pw = nwrap_getpwent(); @@ -1078,7 +1092,21 @@ _PUBLIC_ int nwrap_getgrent_r(struct group *grdst, char *buf, struct group *gr; if (!nwrap_enabled()) { +#ifdef SOLARIS_GETGRENT_R + gr = real_getgrent_r(grdst, buf, buflen); + if (!gr) { + if (errno == 0) { + return ENOENT; + } + return errno; + } + if (grdstp) { + *grdstp = gr; + } + return 0; +#else return real_getgrent_r(grdst, buf, buflen, grdstp); +#endif } gr = nwrap_getgrent(); -- cgit