Home > Back-end >  The openldap the properties of the modified problem
The openldap the properties of the modified problem

Time:10-20

Properties is not successful, and the rc return value has always been 89, checked, bad that is passed to the application of the parameters, but I don't feel any problem,,, entry "telephoneNumber=Book1, dc maxcrc, dc=com" attribute is as follows:
UserPassword BINARY (6 b)
GivenName manager
SeeAlso documentTitle=Book1, dc maxcrc, dc=com
ObjectClass person
Sn manager
Cn manager


The code is as follows:
Bool COpenLDAP: : AddAttrute (char * AttName, char * AttValue)
{
LDAPMod * * modifications;
//int I;
Modifications=(LDAPMod * *) malloc (sizeof (LDAPMod *) * 1);
Modifications [0]=(LDAPMod *) malloc (sizeof (LDAPMod));
Modifications [0] - & gt; Mod_op=LDAP_MOD_ADD;//here must be set to LDAP_MOD_ADD

//add attributes AttName=AttValue
Modifications [0] - & gt; Mod_type="mobile".
Modifications [0] - & gt; Mod_values=(char * *) malloc (sizeof (char *) * 2);
Modifications [0] - & gt; Mod_values [0]="12345678911";
Modifications [0] - & gt; Mod_values [1]=NULL;

Rc=ldap_modify_s (ld, telephoneNumber="Book1, dc maxcrc, dc=com", modifications).
return true;
}

Bool COpenLDAP: : DeleteAttrute (char * AttName)
{
LDAPMod * * modifications;
//int I;
Modifications=(LDAPMod * *) malloc (sizeof (LDAPMod *) * 1);
Modifications [0]=(LDAPMod *) malloc (sizeof (LDAPMod));
Modifications [0] - & gt; Mod_op=LDAP_MOD_DELETE;//here must be set to LDAP_MOD_DELETE

//delete attribute AttName
Modifications [0] - & gt; Mod_type="givenName";
Modifications [0] - & gt; Mod_values=(char * *) malloc (sizeof (char *));
Modifications [0] - & gt; Mod_values [0]=NULL;

A=LDAPMod * modifications [0];
Rc=ldap_modify_s (ld, telephoneNumber="Book1, dc maxcrc, dc=com", modifications).
return true;
}

Bool COpenLDAP: : ReplaceAttrute (char * AttName, char * AttValue)
{
LDAPMod * * modifications;
//int I;
Modifications=(LDAPMod * *) malloc (sizeof (LDAPMod *) * 1);
Modifications [0]=(LDAPMod *) malloc (sizeof (LDAPMod));
Modifications [0] - & gt; Mod_op=LDAP_MOD_REPLACE;//here must be set to LDAP_MOD_ADD

//replace attribute AttName=AttValue
Modifications [0] - & gt; Mod_type="givenName";
Modifications [0] - & gt; Mod_values=(char * *) malloc (sizeof (char *) * 2);
Modifications [0] - & gt; Mod_values [0]="managers".
Modifications [0] - & gt; Mod_values [1]=NULL;

Rc=ldap_modify_s (ld, telephoneNumber="Book1, dc maxcrc, dc=com", & amp; Modifications [0]);
return true;
}
  • Related