summaryrefslogtreecommitdiff
path: root/server/shadow.c
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2006-11-22 13:16:29 +0000
committerArthur de Jong <arthur@arthurdejong.org>2006-11-22 13:16:29 +0000
commitac8e4bfe6e6cc127856019b4f95b77f0a16a98cc (patch)
tree807b8cb5b084d1345c2201543009e7196f3123d0 /server/shadow.c
parente45dcde096907034807924384565f2c1ce2f5af8 (diff)
only flush the stream after writing all records (not every time) and more logging consistency
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/libnss_ldapd@112 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'server/shadow.c')
-rw-r--r--server/shadow.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/shadow.c b/server/shadow.c
index f90293a..c607efb 100644
--- a/server/shadow.c
+++ b/server/shadow.c
@@ -174,14 +174,13 @@ int nslcd_shadow_all(FILE *fp)
/* loop over all results */
while ((retv=nss2nslcd(_nss_ldap_getent(&shadow_context,&result,buffer,1024,&errnop,_nss_ldap_filt_getspent,LM_SHADOW,_nss_ldap_parse_sp)))==NSLCD_RESULT_SUCCESS)
{
- /* write the result code */
+ /* write the result */
WRITE_INT32(fp,retv);
- /* write the shadow entry */
LDF_SHADOW;
- fflush(fp);
}
/* write the final result code */
WRITE_INT32(fp,retv);
+ WRITE_FLUSH(fp);
/* FIXME: if a previous call returns what happens to the context? */
_nss_ldap_enter();
_nss_ldap_ent_context_release(shadow_context);