From: Chris R. <chr...@me...> - 2000-11-10 09:39:22
|
Tom Jordan <tj...@do...> wrote: > > Hey folks, > > I'd like to delete some attributes by feeding ldap->modify an arrayref, > but due to my situation I've no guarantee that all of the attributes > listed in arrayref will exist on the target object. > > Does anyone know what the following code will return into $result if one > or more of the attributes in $arrayref do not exist on the target object? > > my $mesg = $ldap->modify($dn, delete => $arrayref); > my $result = $mesg->code; > > Alternately, can anyone think of a better way to go about this (or check > first to see if the attributes exist? > > Thanks much, > > Tom Jordan > University of Wisconsin Madison > If you are connecting to your server using LDAPv3 (*not* LDAPv2) then you could try using 'replace' instead of 'delete'. The semantics of 'replace' changed rather dramatically between LDAPv2 and LDAPv3, and in v3 (see RFC 2251 section 4.6) a replace with no values will delete the entire attribute if it exists, and will be ignored if the attribute does not exist. Cheers, Chris |