Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/nss/shadow.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-10-09 22:10:27 +0200
committerArthur de Jong <arthur@arthurdejong.org>2010-10-09 22:10:27 +0200
commita7ac27ed9e31c8b6bfca11b73816d62528cef286 (patch)
tree1d66a314dd9d46a83e6ccb74b86e8438dfd1f167 /nss/shadow.c
parentb978f0588a933c8a554b7a2a3f7416645d3da758 (diff)
have one shared file handle per flavour instead of one global one (for now) and re-introduce some other minor changes that got lost in r1247
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1249 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nss/shadow.c')
-rw-r--r--nss/shadow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/nss/shadow.c b/nss/shadow.c
index 7e5e7ce..403dd3a 100644
--- a/nss/shadow.c
+++ b/nss/shadow.c
@@ -30,9 +30,6 @@
#include "common.h"
#include "compat/attrs.h"
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *spentfp;
-
/* read a single shadow entry from the stream */
static nss_status_t read_spwd(
TFILE *fp,struct spwd *result,
@@ -66,7 +63,7 @@ nss_status_t _nss_ldap_getspnam_r(
}
/* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *spentfp; */
+static __thread TFILE *spentfp;
/* start listing all shadow users */
nss_status_t _nss_ldap_setspent(int UNUSED(stayopen))
@@ -111,6 +108,7 @@ static nss_status_t _xnss_ldap_getspnam_r(nss_backend_t UNUSED(*be),void *args)
char *buffer=NSS_ARGS(args)->buf.buffer;
size_t buflen=NSS_ARGS(args)->buf.buflen;
char *data_ptr;
+ char field_buf[128];
nss_status_t status;
if (NSS_ARGS(args)->buf.buflen<0)
{
@@ -124,7 +122,6 @@ static nss_status_t _xnss_ldap_getspnam_r(nss_backend_t UNUSED(*be),void *args)
{
/* result==NULL, return file format */
data_ptr=(char *)malloc(buflen);
- char field_buf[128];
sprintf(data_ptr,"%s:%s:",sp->sp_namp,sp->sp_pwdp);
if (sp->sp_lstchg >= 0)
sprintf(field_buf,"%d:",sp->sp_lstchg);
@@ -173,6 +170,9 @@ static nss_status_t _xnss_ldap_getspnam_r(nss_backend_t UNUSED(*be),void *args)
return status;
}
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *spentfp;
+
static nss_status_t _xnss_ldap_setspent(nss_backend_t UNUSED(*be),void UNUSED(*args))
{
NSS_SETENT(spentfp);
@@ -193,6 +193,7 @@ static nss_status_t _xnss_ldap_getspent_r(nss_backend_t UNUSED(*be),void *args)
char *buffer=NSS_ARGS(args)->buf.buffer;
size_t buflen=NSS_ARGS(args)->buf.buflen;
char *data_ptr;
+ char field_buf[128];
nss_status_t status;
if (NSS_ARGS(args)->buf.buflen<0)
{
@@ -206,7 +207,6 @@ static nss_status_t _xnss_ldap_getspent_r(nss_backend_t UNUSED(*be),void *args)
{
/* result==NULL, return file format */
data_ptr=(char *)malloc(buflen);
- char field_buf[128];
sprintf(data_ptr,"%s:%s:",sp->sp_namp,sp->sp_pwdp);
if (sp->sp_lstchg >= 0)
sprintf(field_buf,"%d:",sp->sp_lstchg);