summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-11-06 12:34:50 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:44:35 +0100
commit336eddb5f2cdd7e49c2ccd23f25728b0d8849bf7 (patch)
treebab8f8bd187e2b75be0bb27b5d4a91a07ed4ccdb /source4/lib
parent8867f82611e232a0752fad27db915b20da5c56bb (diff)
downloadsamba-336eddb5f2cdd7e49c2ccd23f25728b0d8849bf7.tar.gz
samba-336eddb5f2cdd7e49c2ccd23f25728b0d8849bf7.tar.bz2
samba-336eddb5f2cdd7e49c2ccd23f25728b0d8849bf7.zip
r25873: nss_wrapper: hopefully a better fix for the solaris get*ent_r functions
metze (This used to be commit 084aad79807ba787a5d1560cf6152d4b26e8e1f6)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/nss_wrapper/nss_wrapper.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/lib/nss_wrapper/nss_wrapper.c b/source4/lib/nss_wrapper/nss_wrapper.c
index f4ea9bb6de..5bf7ebda4f 100644
--- a/source4/lib/nss_wrapper/nss_wrapper.c
+++ b/source4/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();