[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: "Replacing" an attribute's value with "nothing"



Here are a couple of ideas...

We have an application level replace function that is used by all our other application code to do ldap replaces.  If it is passed a blank value, instead of doing a replace it does a delete.

Or

In some cases, we always want the attribute to be present even if it isn't set.  In those cases, we use -1 to mean the attribute is not set.

Kevin

> From: Mudry, Robert (N-aerotek)  robert.mudry@lmco.com                                                                                                                
> Time/Date: 01:27 PM 03/29/02
> 
> 
> Is there a way I can set an attribute in my schema to allow me to "replace"
> its value with ""? (That's nothing) Most of our code was designed for the
> Netscape Directory Server, which allows replace operations of "". But
> OpenLDAP has been complaining:
> 
> Return code: 21 Message: LDAP_INVALID_SYNTAX :Some part of the request
> contained
>  an invalid syntax. It could be a search
> with an invalid filter or a request to modify the schema and the given
> schema has a bad syntax.
> MessageID: 57   DN
> 
> That's a Perl LDAP error message for: $mesg = $ldap->modify( $userdn,
> replace => {'mail' => "" });
> 
> -Robert
>