my $filter="(objectClass=dhcpHost)(objectClass=mwcDHCPhost)"; if (defined($config{ip})){$filter.="(dhcpStatements=fixed-address ".$config{ip}.")";}; if (defined($config{user})){$filter.="(mwcDHCPhostAuthedAs=".$config{user}.")";}; if (defined($config{mac})){$filter.="(dhcpHWAddress=ethernet ".$config{mac}.")";};
That is how I originally started building a filter. The problem was it did not work. The problem is it will generate a filter that will work with ldapsearch, but will not work with Net::LDAP. After reading the RFC and doing a bit of testing, I found "(&(objectClass=dhcpHost)(objectClass=mwcDHCPhost))" will work, but it needs to be done in groups of layered. Before I set out to most likely re-invent the well, any one know of any existing solutions for this?
signature.asc
Description: PGP signature