X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=contrib%2Fslapd-modules%2Fnssov%2Fshadow.c;h=235c11caefb45dc281421ab60c9c7afc5d0e0d89;hb=19883d7f89f173d00308cadc14a13556b66dd9a9;hp=49fd6fbd3f6b4a84a66552859b37a5068fb4ce69;hpb=57af0cea1608dd6b54173c3ba4884bbd8e7b5bed;p=openldap diff --git a/contrib/slapd-modules/nssov/shadow.c b/contrib/slapd-modules/nssov/shadow.c index 49fd6fbd3f..235c11caef 100644 --- a/contrib/slapd-modules/nssov/shadow.c +++ b/contrib/slapd-modules/nssov/shadow.c @@ -1,7 +1,9 @@ /* shadow.c - shadow account lookup routines */ /* $OpenLDAP$ */ -/* - * Copyright 2008 by Howard Chu, Symas Corp. +/* This work is part of OpenLDAP Software . + * + * Copyright 2008-2010 The OpenLDAP Foundation. + * Portions Copyright 2008 by Howard Chu, Symas Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -12,7 +14,7 @@ * top-level directory of the distribution or, alternatively, at * . */ -/* +/* ACKNOWLEDGEMENTS: * This code references portions of the nss-ldapd package * written by Arthur de Jong. The nss-ldapd code was forked * from the nss-ldap library written by Luke Howard. @@ -91,7 +93,7 @@ static long to_date(struct berval *date,AttributeDescription *attr) value=strtol(buffer,&tmp,0); if ((buffer[0]=='\0')||(*tmp!='\0')) { - Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value", + Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value\n", attr->ad_cname.bv_val,0,0); return 0; } @@ -102,7 +104,7 @@ static long to_date(struct berval *date,AttributeDescription *attr) value=strtol(date->bv_val,&tmp,0); if ((date->bv_val[0]=='\0')||(*tmp!='\0')) { - Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value", + Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value\n", attr->ad_cname.bv_val,0,0); return 0; } @@ -121,13 +123,13 @@ static long to_date(struct berval *date,AttributeDescription *attr) { \ if (a->a_numvals > 1) \ { \ - Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values", \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values\n", \ entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ } \ var=strtol(a->a_vals[0].bv_val,&tmp,0); \ if ((a->a_vals[0].bv_val[0]=='\0')||(*tmp!='\0')) \ { \ - Debug(LDAP_DEBUG_ANY,"shadow entry %s contains non-numeric %s value", \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains non-numeric %s value\n", \ entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ return 0; \ } \ @@ -141,7 +143,7 @@ static long to_date(struct berval *date,AttributeDescription *attr) { \ if (a->a_numvals > 1) \ { \ - Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values", \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values\n", \ entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ } \ var=to_date(&a->a_vals[0],cbp->mi->mi_attrs[key].an_desc); \ @@ -173,7 +175,7 @@ static int write_shadow(nssov_shadow_cbp *cbp,Entry *entry) a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[UID_KEY].an_desc); if (!a) { - Debug(LDAP_DEBUG_ANY,"shadow entry %s does not contain %s value", + Debug(LDAP_DEBUG_ANY,"shadow entry %s does not contain %s value\n", entry->e_name.bv_val, cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_val,0); return 0; } @@ -215,7 +217,7 @@ static int write_shadow(nssov_shadow_cbp *cbp,Entry *entry) /* write the entries */ for (i=0;!BER_BVISNULL(&names[i]);i++) { - WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_INT32(cbp->fp,NSLCD_RESULT_BEGIN); WRITE_BERVAL(cbp->fp,&names[i]); WRITE_BERVAL(cbp->fp,&passwd); WRITE_INT32(cbp->fp,lastchangedate); @@ -236,10 +238,10 @@ NSSOV_HANDLE( char fbuf[1024]; struct berval filter = {sizeof(fbuf)}; filter.bv_val = fbuf; - READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf));, + READ_STRING(fp,cbp.buf);, cbp.name.bv_len = tmpint32; cbp.name.bv_val = cbp.buf; - Debug(LDAP_DEBUG_ANY,"nssov_shadow_byname(%s)",cbp.name.bv_val,0,0);, + Debug(LDAP_DEBUG_ANY,"nssov_shadow_byname(%s)\n",cbp.name.bv_val,0,0);, NSLCD_ACTION_SHADOW_BYNAME, nssov_filter_byname(cbp.mi,UID_KEY,&cbp.name,&filter) ) @@ -249,7 +251,7 @@ NSSOV_HANDLE( struct berval filter; /* no parameters to read */ BER_BVZERO(&cbp.name);, - Debug(LDAP_DEBUG_ANY,"nssov_shadow_all()",0,0,0);, + Debug(LDAP_DEBUG_ANY,"nssov_shadow_all()\n",0,0,0);, NSLCD_ACTION_SHADOW_ALL, (filter=cbp.mi->mi_filter,0) )