/* netgroup.c - netgroup lookup routines */
/* $OpenLDAP$ */
-/*
- * Copyright 2008 by Howard Chu, Symas Corp.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 2008-2014 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
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
-/*
+/* 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.
/* we should have a bracket now */
if (triple[i]!='(')
{
- Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): entry does not begin with '(' (entry skipped)",0,0,0);
+ Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): entry does not begin with '(' (entry skipped)\n",0,0,0);
return 0;
}
i++;
/* nothing else to do */ ;
if (triple[i]!=',')
{
- Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)",0,0,0);
+ Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)\n",0,0,0);
return 0;
}
hoste=i;
/* nothing else to do */ ;
if (triple[i]!=',')
{
- Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)",0,0,0);
+ Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)\n",0,0,0);
return 0;
}
usere=i;
/* nothing else to do */ ;
if (triple[i]!=')')
{
- Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ')' (entry skipped)",0,0,0);
+ Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ')' (entry skipped)\n",0,0,0);
return 0;
}
domaine=i;
/* if anything is left in the string we have a problem */
if (triple[i]!='\0')
{
- Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): string contains trailing data (entry skipped)",0,0,0);
+ Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): string contains trailing data (entry skipped)\n",0,0,0);
return 0;
}
/* write strings */
- WRITE_INT32(fp,NSLCD_RESULT_SUCCESS);
- WRITE_INT32(fp,NETGROUP_TYPE_TRIPLE);
+ WRITE_INT32(fp,NSLCD_RESULT_BEGIN);
+ WRITE_INT32(fp,NSLCD_NETGROUP_TYPE_TRIPLE);
WRITE_STRING_STRIPSPACE_LEN(fp,triple+hostb,hoste-hostb)
WRITE_STRING_STRIPSPACE_LEN(fp,triple+userb,usere-userb)
WRITE_STRING_STRIPSPACE_LEN(fp,triple+domainb,domaine-domainb)
for (i=0;i<a->a_numvals;i++)
{
/* write the result code */
- WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS);
+ WRITE_INT32(cbp->fp,NSLCD_RESULT_BEGIN);
/* write triple indicator */
- WRITE_INT32(cbp->fp,NETGROUP_TYPE_NETGROUP);
+ WRITE_INT32(cbp->fp,NSLCD_NETGROUP_TYPE_NETGROUP);
/* write netgroup name */
if (write_string_stripspace_len(cbp->fp,a->a_vals[i].bv_val,a->a_vals[i].bv_len))
return -1;
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_TRACE,"nssov_netgroup_byname(%s)",cbp.name.bv_val,0,0);,
+ Debug(LDAP_DEBUG_TRACE,"nssov_netgroup_byname(%s)\n",cbp.name.bv_val,0,0);,
NSLCD_ACTION_NETGROUP_BYNAME,
nssov_filter_byname(cbp.mi,0,&cbp.name,&filter)
)