I am able to do a persistent search against the server but I cannot figure out how to
use/extract population of the ENTRYCHANGE control. I was wondering if anyone had any
complete examples about how to start the search properly to return the ENTRYCHANGE
control and how to use it. I am setting the returnECs but it doesn't appear to be
returning anything.
Here is the jist of my current persistent search.
my $asn = Convert::ASN1->new;
$asn->prepare(<<EOASN);
PersistentSearch ::= SEQUENCE {
changeTypes INTEGER,
changesOnly BOOLEAN,
returnECs BOOLEAN
}
EOASN
my $params = $asn->encode(
changeTypes => 15,
changesOnly => 1,
returnECs => 1
);
my $persistctl = Net::LDAP::Control->new(
critical => true,
type => LDAP_CONTROL_PERSISTENTSEARCH,
value => $params
);
my $result = $ldap->search(
base => '',
filter => '(objectclass=person)',
attrs => [ 'cn' ],
control => [ $persistctl ],
callback => \&check_home
);
if ($result->code) {
my $error = $result->code;
my $errstr = $result->error;
print "Error: $error ($errstr)\n";
}
sub check_home {
my $message = shift;
my $entry = shift;
print $entry->dn,"\n";
}
$result->pop_entry;
Thanks!