docsnyder has asked for the wisdom of the Perl Monks concerning the following question:
As the title suggests, I am trying to figure out whether a given LDAP attribute is single valued or multivalued (I'm using net::ldap).
After doing a search, I am accessing the result via a hash I obtain by $result->as_struct(). Within this hash, attribute values are always an array, i.e. single valued attributes are returned in an array containing a single value.
The problem arises when I am writing a LDAP object back to LDAP. What I want is, that values contained in multivalue attributes get "added" to the existing values. That's why I am calling '$ldap->modify($dn, add => {%attrs})' rather than '$ldap->modify($dn, replace => {%attrs})'. Unfortunately, this results in an error for single value attributes which exist in the target system.
Ok, I could separate single value attributes and multivalue attribues, calling '$ldap->modify($dn, replace => {%attrs})' for single value attributes and '$ldap->modify($dn, add => {%attrs})' for multivalue attributes, but this would require to know, which attribute is single valued and which is multivalued. Is there a way to figure this out?
I would appreciate any hint.
Regards docsnyder
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: net::ldap ->singel valued attributes and multivalued attributes
by karlgoethebier (Abbot) on Aug 28, 2020 at 06:19 UTC | |
Re: net::ldap ->singel valued attributes and multivalued attributes
by jcb (Parson) on Aug 28, 2020 at 01:46 UTC | |
Re: net::ldap ->singel valued attributes and multivalued attributes
by haukex (Archbishop) on Aug 28, 2020 at 14:01 UTC |