summaryrefslogtreecommitdiff
path: root/nss/shadow.c
diff options
context:
space:
mode:
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);