From ec9a0917055d731aa95e2fea2045445f9945b74d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 27 May 2009 18:38:10 +0200 Subject: nss_wrapper: restructure nwrap calls. Guenther --- lib/nss_wrapper/nss_wrapper.c | 240 +++++++++++++++++++++++++++++------------- 1 file changed, 169 insertions(+), 71 deletions(-) (limited to 'lib/nss_wrapper/nss_wrapper.c') diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index da090832b0..09603b8794 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -771,14 +771,11 @@ static int nwrap_gr_copy_r(const struct group *src, struct group *dst, } /* user functions */ -_PUBLIC_ struct passwd *nwrap_getpwnam(const char *name) + +static struct passwd *nwrap_files_getpwnam(const char *name) { int i; - if (!nwrap_enabled()) { - return real_getpwnam(name); - } - nwrap_cache_reload(nwrap_pw_global.cache); for (i=0; i Date: Thu, 28 May 2009 10:53:53 +0200 Subject: nss_wrapper: remove re-structuring leftovers (unused variables). Guenther --- lib/nss_wrapper/nss_wrapper.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lib/nss_wrapper/nss_wrapper.c') diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 09603b8794..3c061f0de8 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -855,8 +855,6 @@ static struct passwd *nwrap_files_getpwuid(uid_t uid) _PUBLIC_ struct passwd *nwrap_getpwuid(uid_t uid) { - int i; - if (!nwrap_enabled()) { return real_getpwuid(uid); } @@ -1057,8 +1055,6 @@ static int nwrap_files_getgrnam_r(const char *name, struct group *grdst, _PUBLIC_ int nwrap_getgrnam_r(const char *name, struct group *grdst, char *buf, size_t buflen, struct group **grdstp) { - struct group *gr; - if (!nwrap_enabled()) { return real_getgrnam_r(name, grdst, buf, buflen, grdstp); } @@ -1091,8 +1087,6 @@ static struct group *nwrap_files_getgrgid(gid_t gid) _PUBLIC_ struct group *nwrap_getgrgid(gid_t gid) { - int i; - if (!nwrap_enabled()) { return real_getgrgid(gid); } -- cgit From 136b2a3eb21eda28e7a18547751ee20f097e7492 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 28 May 2009 11:51:46 +0200 Subject: nss_wrapper: fix nss_wrapper build for solaris. Guenther --- lib/nss_wrapper/nss_wrapper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/nss_wrapper/nss_wrapper.c') diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index 3c061f0de8..1875dc3e4f 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -954,6 +954,7 @@ _PUBLIC_ int nwrap_getpwent_r(struct passwd *pwdst, char *buf, { if (!nwrap_enabled()) { #ifdef SOLARIS_GETPWENT_R + struct passwd *pw; pw = real_getpwent_r(pwdst, buf, buflen); if (!pw) { if (errno == 0) { @@ -1188,6 +1189,7 @@ _PUBLIC_ int nwrap_getgrent_r(struct group *grdst, char *buf, { if (!nwrap_enabled()) { #ifdef SOLARIS_GETGRENT_R + struct group *gr; gr = real_getgrent_r(grdst, buf, buflen); if (!gr) { if (errno == 0) { -- cgit