perl.ldap http://www.nntp.perl.org/group/perl.ldap/ ... Copyright 1998-2013 perl.org Wed, 19 Jun 2013 07:16:31 +0000 ask@perl.org Re: DN Comparison function by Brian Reichert On Thu, Jun 13, 2013 at 04:01:53PM +0100, Christophe Wolfhugel wrote:<br/>&gt; On 13/06/13 15:45, Brian Reichert wrote:<br/>&gt; &gt; Why not do a string compare on the output of Net::LDAP::Util::canonical_dn()?<br/>&gt; <br/>&gt; I am not sure this would work as the canonical_dn would not change case for<br/>&gt; the attribute values, so:<br/>&gt; <br/>&gt; SN=A??roport and SN=A??ROPORT would be different in string comparison, but<br/>&gt; according to the schema still represent the same RDN.<br/><br/>I admit my suggestion was naive. This post says that not all layers<br/>of RDN need be case-insensitive:<br/><br/> http://comments.gmane.org/gmane.comp.ldap.umich/323<br/><br/>And goes on to explain that it&#39;s schema-dependant. I&#39;ve not looked<br/>at the code for canonical_dn(), but I doubt it&#39;s aware of any schema.<br/><br/>&gt; -- <br/>&gt; Christophe Wolfhugel -+- chris@wolfhugel.eu<br/><br/>-- <br/>Brian Reichert &lt;reichert@numachi.com&gt;<br/>BSD admin/developer at large <br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3722.html Thu, 13 Jun 2013 16:41:04 +0000 Re: DN Comparison function by Quanah Gibson-Mount --On Thursday, June 13, 2013 4:01 PM +0100 Christophe Wolfhugel <br/>&lt;chris@wolfhugel.eu&gt; wrote:<br/><br/>&gt; On 13/06/13 15:45, Brian Reichert wrote:<br/>&gt;&gt; Why not do a string compare on the output of<br/>&gt;&gt; Net::LDAP::Util::canonical_dn()?<br/>&gt;<br/>&gt; I am not sure this would work as the canonical_dn would not change case<br/>&gt; for the attribute values, so:<br/>&gt;<br/>&gt; SN=A&eacute;roport and SN=A&Eacute;ROPORT would be different in string comparison, but<br/>&gt; according to the schema still represent the same RDN.<br/><br/>lc()?<br/><br/>--Quanah<br/><br/>--<br/><br/>Quanah Gibson-Mount<br/>Sr. Member of Technical Staff<br/>Zimbra, Inc<br/>A Division of VMware, Inc.<br/>--------------------<br/>Zimbra :: the leader in open source messaging and collaboration<br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3721.html Thu, 13 Jun 2013 15:36:14 +0000 Re: DN Comparison function by Christophe Wolfhugel On 13/06/13 15:45, Brian Reichert wrote:<br/>&gt; Why not do a string compare on the output of Net::LDAP::Util::canonical_dn()?<br/><br/>I am not sure this would work as the canonical_dn would not change case for<br/>the attribute values, so:<br/><br/>SN=A&eacute;roport and SN=A&Eacute;ROPORT would be different in string comparison, but<br/>according to the schema still represent the same RDN.<br/><br/>-- <br/>Christophe Wolfhugel -+- chris@wolfhugel.eu<br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3720.html Thu, 13 Jun 2013 15:02:09 +0000 Re: DN Comparison function by Brian Reichert On Thu, Jun 13, 2013 at 08:36:58AM +0100, Christophe Wolfhugel wrote:<br/>&gt; Good day everyone.<br/>&gt; <br/>&gt; I was wondering if it would make sense to have a DN comparison function<br/>&gt; part of Net::LDAP? Whilst in most cases a simple string comparison could<br/>&gt; make it, there are always cases where this is not so easy, particularly<br/>&gt; when comparison functions are not identical.<br/><br/>Why not do a string compare on the output of Net::LDAP::Util::canonical_dn()?<br/><br/>-- <br/>Brian Reichert &lt;reichert@numachi.com&gt;<br/>BSD admin/developer at large <br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3719.html Thu, 13 Jun 2013 14:57:26 +0000 DN Comparison function by Christophe Wolfhugel Good day everyone.<br/><br/>I was wondering if it would make sense to have a DN comparison function<br/>part of Net::LDAP? Whilst in most cases a simple string comparison could<br/>make it, there are always cases where this is not so easy, particularly<br/>when comparison functions are not identical.<br/><br/>See code below for a proposal on how to do this (this does not integrate<br/>yet &quot;as is&quot; in perl-ldap). One design question I would have is: should<br/>this be part of Net::LDAP::Schema as a metho or Net::LDAP::Util, with the<br/>schema as a provided parameter?<br/><br/>I welcome any thoughts on this and anyone feel free to use the code if<br/>it helps you.<br/><br/>-- <br/>Christophe Wolfhugel -+- chris@wolfhugel.eu<br/><br/>## $SCHEMA is a global to the selected schema we use.<br/><br/>## Compares 2 DNs for either equality or the first being<br/>## part (or equal to) of a subtree represented by the<br/>## second argument. Third argument if set tells a subtree<br/>## comparison should be done. Returns true if identical or<br/>## in the tree, 0 otherwise, undef if not enough arguments.<br/>sub compare_dn { <br/> return unless (@_ &gt;= 2);<br/> return 1 if ($_[0] eq $_[1]);<br/> my $a = ldap_explode_dn($_[0]);<br/> my $b = ldap_explode_dn($_[1]);<br/> my $s = @_ == 3 ? $_[2] : 0;<br/><br/> if ($s) {<br/> return 0 if ($#{$a} &lt; $#${b});<br/> splice(@{$a}, 0, $#{$a} - $#${b});<br/> } elsif ($#{$a} != $#${b}) {<br/> return 0;<br/> }<br/> foreach my $rdn_a (@{$a}) {<br/> my $rdn_b = shift(@{$b});<br/> return 0 if (join(&#39;,&#39;, sort keys %{$rdn_a}) ne join(&#39;,&#39;, sort keys %{$rdn_b}));<br/> while (my($attr, $v_a) = each %{$rdn_a}) {<br/> if (defined(my $v_b = delete($rdn_b-&gt;{$attr}))) {<br/> ## LDAPmatchingrule_for_attribute is my wrapper around matchingrule_for_attribute.<br/> my $mr = defined($SCHEMA) ? LDAPmatchingrule_for_attribute($SCHEMA, $attr, &#39;equality&#39;) : undef;<br/> $mr = defined($mr) &amp;&amp; exists($cmpsubs{$mr}) ? $cmpsubs{$mr} : $cmpsubs{&#39;*&#39;};<br/> return 0 unless (&amp;{$mr}($v_a, $v_b));<br/> } else {<br/> return 0;<br/> }<br/> }<br/> }<br/> return 1;<br/>}<br/><br/>my %cmpsubs = (<br/> &#39;*&#39; =&gt; sub { return $_[0] eq $_[1]; },<br/> &#39;integerMatch&#39; =&gt; sub { return $_[0] == $_[1]; },<br/> &#39;caseIgnoreIA5Match&#39; =&gt; sub { return lc($_[0]) eq lc($_[1]); },<br/> &#39;caseIgnoreMatch&#39; =&gt; sub {<br/> my @a = @_;<br/> utf8::decode($a[0]) if (utf8::valid($a[0]) &amp;&amp; utf8::is_utf8($a[0]) == 0);<br/> utf8::decode($a[1]) if (utf8::valid($a[1]) &amp;&amp; utf8::is_utf8($a[1]) == 0);<br/> return lc($a[0]) eq lc($a[1]);<br/> }<br/>);<br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3718.html Thu, 13 Jun 2013 07:37:14 +0000 perl-ldap 0.56 released by Peter Marschall Hi all,<br/><br/>another month, another lrease of perl-ldap:<br/><br/>A few minutes ago I released perl-ldap 0.56 to CPAN. <br/>Find it at<br/> http://search.cpan.org/dist/perl-ldap/<br/><br/>The changes included are listed at the end of this email.<br/><br/>For those of you directly pulling from GitHub, the repository<br/> https://github.com/perl-ldap/perl-ldap<br/>has been updated accordingly.<br/><br/>Have fun with it<br/>Peter<br/><br/>0.56 -- Sat Jun 8 13:14:47 CEST 2013<br/><br/>Bug Fixes:<br/>* RT#85941: LDAP.pm: new method data_ready()<br/>* RT#84886: Control/Relax.pm: fix typo in documentation<br/><br/>Enhancements:<br/>* FAQ.pod: add more directory servers<br/>* t/07filtermatch.t: skip some tests unless Text::Soundex is installed<br/>* t/74matchedvalues.t: new, tests for MatchedValues control<br/>* t/73assert.t: new, tests for Assertion control<br/>* LDIF.pm: overhaul<br/> - flexibilize mode handling, accept PerlIO layers<br/> - get rid of dependency on Symbol &amp; SelectSaver<br/> - convert _write_... to object methods<br/> - use indirect file handles for URLs<br/>* LWP/Protocol/ldap.pm: use regex as 1st arg to split()<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/06/msg3717.html Sat, 08 Jun 2013 12:00:30 +0000 Re: map problems by Natxo Asenjo On Thu, May 16, 2013 at 11:27 PM, timothy adigun &lt;2teezperl@gmail.com&gt;wrote:<br/><br/>&gt;<br/>&gt; Hi Natxo,<br/>&gt; Please see my comment below:<br/>&gt;<br/>&gt; On Thu, May 16, 2013 at 8:57 PM, Natxo Asenjo &lt;natxo.asenjo@gmail.com&gt;wrote:<br/>&gt;<br/>&gt;&gt; hi,<br/>&gt;&gt;<br/>&gt;&gt; in a ldap script where I get a list of values of a multivalued attribute<br/>&gt;&gt; like this:<br/>&gt;&gt;<br/>&gt;&gt; @memberof = qw( cn=group1,cn=xxx,dc=domain,dc=tld<br/>&gt;&gt; cn=group2,cn=xxx,d=domain,dc=tld etc etc) ;<br/>&gt;&gt;<br/>&gt;<br/>&gt; Since you use &quot;qw&quot;, there is no need to still separate the element of<br/>&gt; your array with comma.<br/>&gt;<br/><br/>yes, I was not separating it, this is a normal ldap object, they contain<br/>commas (weird, I know, it just does not surprise me any longer). So each<br/>element is the string between the blanks. In fact the @memberof the array<br/>is actually never like that black on white, but I get that array from<br/>Net::LDAP after a search operation in the ldap server.<br/><br/>It turns out my regex was greedy and that is why it did not work. Now it is<br/>fixed thanks to this awesome list.<br/><br/>Thanks for taking the time to answer my question.<br/><br/>-- <br/>groet,<br/>natxo<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3716.html Thu, 16 May 2013 21:40:29 +0000 Treat attribute names in LDIF change records in a case insensitivemanor. by Raymond S Brand <br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3715.html Mon, 13 May 2013 20:34:58 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid &gt;Your patch would have scratched your itch, but the burden to keep perl-ldap <br/><br/>&gt;maintainable, understandable &amp; compatible [even for that RFC violation of your <br/>&gt;tool] would be on the maintainer(s).<br/>Understood. I&#39;m not trying to trivialize the job of the maintainer (I&#39;ve been there!), but this is a simpler situation than the one that many maintainers have (this being all Perl!). The patch is not horribly complex. I understand your reservation about <br/>option hell, but think in terms of grey, not black and white, how <br/>terrible of a problem are we really looking at?<br/><br/>&gt;What if another patch came in asking for another RFC violation that would <br/>&gt;negatively impact your patch? Which one should then prevail?<br/><br/>Since the non-standards-enabling is enabled by option, I&#39;m having a hard time thinking of a case where this would be an issue: the choices are &quot;allow controls without change record&quot; or &quot;don&#39;t allow controls without change record&quot;; we&#39;ve already covered both. Not saying it can&#39;t happen, help me find a case here!<br/><br/>In lieu of a concrete example (help me here!): if the other interfering violation were mutually exclusive, one (of several possible) approaches would be to give them different enablement options, and make the enablement options mutually exclusive. Yes, this is the start of a slippery slope into option hell, but again, how often has this come up?.&nbsp; What would a conflicting option be?<br/><br/>&gt;Did you at least report the bug to IBM?<br/>&gt;Because their non-standards compliant tool is the cause of the whole <br/>&gt;discussion.<br/><br/>I offered to as a part of quid quo pro.<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3714.html Sat, 11 May 2013 19:37:36 +0000 Re: Reading LDIF files containing controls by Peter Marschall Hi,<br/><br/>On Saturday, 11. May 2013, Doug Wegscheid wrote:<br/>&gt; Thanks for your time. The lack of response to &quot;purity vs real-world<br/>&gt; usability&quot; is disappointing.<br/><br/>I am sorry you see it that way, but my reason was not only &quot;purity&quot; as you <br/>call it, but long term usability &amp; compatibility.<br/><br/>Your patch would have scratched your itch, but the burden to keep perl-ldap <br/>maintainable, understandable &amp; compatible [even for that RFC violation of your <br/>tool] would be on the maintainer(s).<br/><br/>What if another patch came in asking for another RFC violation that would <br/>negatively impact your patch? Which one should then prevail?<br/><br/>Did you at least report the bug to IBM?<br/>Because their non-standards compliant tool is the cause of the whole <br/>discussion.<br/><br/>Best<br/>Peter<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3713.html Sat, 11 May 2013 19:15:10 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid Thanks for your time. The lack of response to &quot;purity vs real-world usability&quot; is disappointing.<br/>&gt;&gt; I&#39;m dealing with 1G+ LDIFs, and the patch *is* cleaner for me, but<br/><br/>&gt;&gt; preprocessing will work.<br/><br/>&gt;When the dump utility is capable of writing to stdout, you can use a pipe.<br/>&gt;This way you will not need more memory, ...<br/><br/>correct, will not need disk. *will* more CPU, more time.<br/><br/>&gt;&gt; If I put the bug report in, will you incorporate the patch? :)<br/>&gt;No. [I do not want perl-ldap to look like the easier target ;-]]<br/><br/>purity wins over pragmatism :)<br/><br/>&gt;If they do, you can throw away the preprocessor step.<br/><br/>I won&#39;t have a preprocessor. I have a patched Net::LDAP::LDIF! thanks to the maintainers for making it easy to patch.<br/><br/><br/>If anyone is in the same situation as I, you have my permission to use the patch in my original posting.<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3712.html Sat, 11 May 2013 18:36:56 +0000 Re: Reading LDIF files containing controls by Peter Marschall On Saturday, 11. May 2013, you wrote:<br/>&gt; &gt;What I can offer you as some kind of consolation is an idea about a simple<br/>&gt; &gt;preprocessor that filters out the illegal &quot;control:&quot; lines<br/>&gt; &gt;<br/>&gt; &gt; perl -i -p -0040 -e &#39;s/\n //&#39; &lt; RFC-VIOLATING-FILE \<br/>&gt; &gt;<br/>&gt; &gt; | grep -vi ^control: &gt; RFC-CONFORMING-FILE<br/>&gt; &gt;[the first command is required to unwrap the wrapped lines]<br/>&gt; &gt;<br/>&gt; &gt;Alternatively you may add a<br/>&gt; &gt; changetype: add line<br/>&gt; &gt;after each unwrapped dn: line.<br/>&gt; <br/>&gt; all very good suggestions, thanks for offering them.<br/>&gt; <br/>&gt; I&#39;m dealing with 1G+ LDIFs, and the patch *is* cleaner for me, but<br/>&gt; preprocessing will work.<br/><br/>When the dump utility is capable of writing to stdout, you can use a pipe.<br/>This way you will not need more memory, ...<br/><br/>&gt; &gt;Please at least report it to them as a bug in their tool (even if they<br/>&gt; &gt;might not react). Maybe they are not even aware of the issue.<br/>&gt; <br/>&gt; If I put the bug report in, will you incorporate the patch? :)<br/>No. [I do not want perl-ldap to look like the easier target ;-]]<br/><br/>My hope is IBM will fix their bug and adhere to well-established standards.<br/>If they do, you can throw away the preprocessor step.<br/><br/>Best<br/>PEter<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3711.html Sat, 11 May 2013 18:22:01 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid &gt;I can understand your point of view, but it will not change my stance.<br/><br/><br/>not<br/> a problem. I&#39;ll ask you to think carefully the actual downside of<br/> incorporating the option for relaxing RFC compliance versus the value <br/>of said options to the open source community. What is the real downside?<br/><br/>&gt;What I can offer you as some kind of consolation is an idea about a simple <br/>&gt;preprocessor that filters out the illegal &quot;control:&quot; lines<br/>&gt; perl -i -p -0040 -e &#39;s/\n //&#39; &lt; RFC-VIOLATING-FILE \<br/>&gt;&nbsp; | grep -vi ^control: &gt; RFC-CONFORMING-FILE<br/>&gt;[the first command is required to unwrap the wrapped<br/> lines]<br/><br/>&gt;Alternatively you may add a<br/>&gt;&nbsp; changetype: add line<br/>&gt;after each unwrapped dn: line.<br/><br/>all very good suggestions, thanks for offering them.<br/><br/>I&#39;m dealing with 1G+ LDIFs, and the patch *is* cleaner for me, but preprocessing will work.<br/><br/>&gt;Please at least report it to them as a bug in their tool (even if they might <br/>&gt;not react). Maybe they are not even aware of the issue.<br/><br/>If I put the bug report in, will you incorporate the patch? :)<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3710.html Sat, 11 May 2013 17:56:33 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid &gt;How about writing a script to post-process the output from the dump to <br/><br/>&gt;make it compliant?<br/><br/>That would work. At that point, I&#39;ll have parsed the 700M file, so I&#39;ll not need Net::LDAP::LDIF.<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3709.html Sat, 11 May 2013 17:33:43 +0000 Re: Reading LDIF files containing controls by Peter Marschall Hi,<br/><br/>On Saturday, 11. May 2013, Doug Wegscheid wrote:<br/>&gt; &gt;You may doubt it, but Quanah is right: your dump utility violates the RFC.<br/>&gt; <br/>&gt; please reread my earlier message: I do NOT doubt it violates the RFC (I<br/>&gt; know it does!). I&#39;m sorry if a misread of what I wrote caused everyone to<br/>&gt; get the idea that I wasn&#39;t listening or understood Qaunah&#39;s email, and<br/>&gt; possibly caused a lack of sympathy for the situation I&#39;m in and a lack of<br/>&gt; willingness to listen to my position...<br/>&gt; <br/>&gt; &gt;I do not think that adding an option to accept this type of RFC violation<br/>&gt; &gt;is the way to go, as it would be a precedent for further RFC-violations<br/>&gt; &gt;(even if they were hidden behind options).<br/>&gt; &gt;This way lies madness (or option hell).<br/>&gt; <br/>&gt; I&#39;m not asking the maintainer to make a change that causes Net::LDAP to<br/>&gt; create anything that violates an RFC (I would absolutely agree with not<br/>&gt; going that direction). I am asking for a small change to be made to allow<br/>&gt; Net::LDAP to READ something that is in common use, but violates the RFC.<br/>&gt; Whether or not we like it, or if it violates our sense of purity, the use<br/>&gt; cases for dealing with software that does not follow standards is real,<br/>&gt; and sadly common. The model of &quot;being strict on output, but allowing input<br/>&gt; of common violations&quot; is not unheard of in these cases, and is useful in<br/>&gt; the real world.<br/>&gt; <br/>&gt; There is a middle road between strict adherance to the RFCs and allowing<br/>&gt; anarchy, and &quot;liberal on input, strict on output&quot; seems to be a pretty<br/>&gt; reasonable middle road. It allows Net::LDIF to be useful for more real<br/>&gt; world problems.<br/>&gt; <br/>&gt; I am asking everyone to think about that and see if it makes sense.<br/><br/>I can understand your point of view, but it will not change my stance.<br/><br/>What I can offer you as some kind of consolation is an idea about a simple <br/>preprocessor that filters out the illegal &quot;control:&quot; lines<br/> perl -i -p -0040 -e &#39;s/\n //&#39; &lt; RFC-VIOLATING-FILE \<br/> | grep -vi ^control: &gt; RFC-CONFORMING-FILE<br/>[the first command is required to unwrap the wrapped lines]<br/><br/>Alternatively you may add a<br/> changetype: add line<br/>after each unwrapped dn: line.<br/><br/>&gt; &gt;Instead, please get the dump utility fixed so that it adheres to the RFC.<br/>&gt; <br/>&gt; I don&#39;t have that kind of pull with IBM.<br/><br/>Please at least report it to them as a bug in their tool (even if they might <br/>not react). Maybe they are not even aware of the issue.<br/><br/>Best<br/>Peter<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3708.html Sat, 11 May 2013 17:33:28 +0000 Re: Reading LDIF files containing controls by Rick Sanders &gt;Instead, please get the dump utility fixed so that it adheres to the RFC.<br/>&gt; <br/>&gt;&gt; I don&#39;t have that kind of pull with IBM.<br/><br/>How about writing a script to post-process the output from the dump to <br/>make it compliant?<br/><br/>-Rick<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3707.html Sat, 11 May 2013 17:03:00 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid &gt;You may doubt it, but Quanah is right: your dump utility violates the RFC.<br/><br/>please reread my earlier message: I do NOT doubt it violates the RFC (I know it does!). I&#39;m sorry if a misread of what I wrote caused everyone to get the idea that I wasn&#39;t listening or understood Qaunah&#39;s email, and possibly caused a lack of sympathy for the situation I&#39;m in and a lack of willingness to listen to my position...<br/><br/>&gt;I do not think that adding an option to accept this type of RFC violation<br/>&gt;is the way to go, as it would be a precedent for further RFC-violations<br/>&gt;(even if they were hidden behind options).<br/>&gt;This way lies madness (or option hell).<br/><br/>I&#39;m not asking the maintainer to make a change that causes Net::LDAP to create anything that violates an RFC (I would absolutely agree with not going that direction). I am asking for a small change to be made to allow Net::LDAP to READ something that is in common use, but violates the RFC. Whether or not we like it, or if it violates our sense of purity, the use cases for dealing with software that does not follow standards is real, and sadly common. The model of &quot;being strict on output, but allowing input of common violations&quot; is not unheard of in these cases, and is useful in the real world.<br/><br/>There is a middle road between strict adherance to the RFCs and allowing anarchy, and &quot;liberal on input, strict on output&quot; seems to be a pretty reasonable middle road. It allows Net::LDIF to be useful for more real world problems.<br/><br/>I am asking everyone to think about that and see if it makes sense.<br/><br/>&gt;Instead, please get the dump utility fixed so that it adheres to the RFC.<br/><br/><br/>I don&#39;t have that kind of pull with IBM.<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3706.html Sat, 11 May 2013 16:33:45 +0000 Re: Reading LDIF files containing controls by Peter Marschall Hi Doug,<br/><br/>On Tuesday, 7. May 2013, Doug Wegscheid wrote:<br/>&gt; I don&#39;t doubt that, but the question is whether or not the patch is<br/>&gt; palatable...<br/><br/>You may doubt it, but Quanah is right: your dump utility violates the RFC.<br/><br/>in the &quot;Formal Syntax Definition of LDIF&quot; section, RFC 2849 explicitly states <br/>that controls may only occur in change records.<br/><br/>I do not think that adding an option to accept this type of RFC violation<br/>is the way to go, as it would be a precedent for further RFC-violations<br/>(even if they were hidden behind options).<br/>This way lies madness (or option hell).<br/><br/>Instead, please get the dump utility fixed so that it adheres to the RFC.<br/><br/>Best<br/>Peter<br/><br/>PS: Please don&#39;t top-post<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3705.html Sat, 11 May 2013 16:05:45 +0000 Re: Reading LDIF files containing controls by Doug Wegscheid I don&#39;t doubt that, but the question is whether or not the patch is palatable...<br/><br/><br/><br/>________________________________<br/> From: Quanah Gibson-Mount &lt;quanah@zimbra.com&gt;<br/>To: Doug Wegscheid &lt;dwegscheid@sbcglobal.net&gt;; perl-ldap@perl.org <br/>Sent: Tuesday, May 7, 2013 12:52 PM<br/>Subject: Re: Reading LDIF files containing controls<br/> <br/><br/>--On Tuesday, May 07, 2013 7:00 AM -0700 Doug Wegscheid <br/>&lt;dwegscheid@sbcglobal.net&gt; wrote:<br/><br/>&gt;<br/>&gt; I have a use case for analyzing LDIF dumps of our LDAP directory. The<br/>&gt; dump utility puts some controls in the output file, so Net::LDAP::LDIF<br/>&gt; won&#39;t read them, it fails with &quot;Controls only allowed with LDIF change<br/>&gt; entries&quot;.<br/>&gt;<br/>&gt; I put a patch on to allow reading of controls for non-change entries by<br/>&gt; specifying controls_always_legal =&gt; 1 on the Net::LDAP::LDIF-&gt;new() call.<br/><br/>Sounds to me like your dump utility is creating LDIF that violates <br/>&lt;http://tools.ietf.org/html/rfc2849&gt;<br/><br/>--Quanah<br/><br/><br/><br/>--<br/><br/>Quanah Gibson-Mount<br/>Sr. Member of Technical Staff<br/>Zimbra, Inc<br/>A Division of VMware, Inc.<br/>--------------------<br/>Zimbra ::&nbsp; the leader in open source messaging and collaboration<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3704.html Tue, 07 May 2013 17:53:14 +0000 Re: Reading LDIF files containing controls by Quanah Gibson-Mount --On Tuesday, May 07, 2013 7:00 AM -0700 Doug Wegscheid <br/>&lt;dwegscheid@sbcglobal.net&gt; wrote:<br/><br/>&gt;<br/>&gt; I have a use case for analyzing LDIF dumps of our LDAP directory. The<br/>&gt; dump utility puts some controls in the output file, so Net::LDAP::LDIF<br/>&gt; won&#39;t read them, it fails with &quot;Controls only allowed with LDIF change<br/>&gt; entries&quot;.<br/>&gt;<br/>&gt; I put a patch on to allow reading of controls for non-change entries by<br/>&gt; specifying controls_always_legal =&gt; 1 on the Net::LDAP::LDIF-&gt;new() call.<br/><br/>Sounds to me like your dump utility is creating LDIF that violates <br/>&lt;http://tools.ietf.org/html/rfc2849&gt;<br/><br/>--Quanah<br/><br/><br/><br/>--<br/><br/>Quanah Gibson-Mount<br/>Sr. Member of Technical Staff<br/>Zimbra, Inc<br/>A Division of VMware, Inc.<br/>--------------------<br/>Zimbra :: the leader in open source messaging and collaboration<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3703.html Tue, 07 May 2013 16:53:17 +0000 Reading LDIF files containing controls by Doug Wegscheid I have a use case for analyzing LDIF dumps of our LDAP directory. The dump utility puts some controls in the output file, so Net::LDAP::LDIF won&#39;t read them, it fails with &quot;Controls only allowed with LDIF change entries&quot;.<br/><br/>I put a patch on to allow reading of controls for non-change entries by specifying controls_always_legal =&gt; 1 on the Net::LDAP::LDIF-&gt;new() call.<br/><br/>Can we consider including this patch (possibly modified if people see fit) in the next release?<br/><br/>--- LDIF.pm~&nbsp;&nbsp;&nbsp; 2013-05-07 09:07:19.000000000 -0400<br/>+++ LDIF.pm&nbsp;&nbsp;&nbsp;&nbsp; 2013-05-07 08:45:34.000000000 -0400<br/>@@ -15,7 +15,7 @@<br/>&nbsp;&nbsp;&nbsp;&nbsp; if (CHECK_UTF8);<br/>&nbsp;}<br/><br/>-our $VERSION = &#39;0.20&#39;;<br/>+our $VERSION = &#39;0.21&#39;;<br/><br/>&nbsp;# allow the letters r,w,a as well as the well-known operators as modes<br/>&nbsp;my %mode = qw(r &lt; &lt; &lt; w &gt; &gt; &gt; a &gt;&gt; &gt;&gt; &gt;&gt;);<br/>@@ -66,6 +66,7 @@<br/>&nbsp;&nbsp;&nbsp;&nbsp; changetype =&gt; &#39;modify&#39;,<br/>&nbsp;&nbsp;&nbsp;&nbsp; modify =&gt; &#39;add&#39;,<br/>&nbsp;&nbsp;&nbsp;&nbsp; wrap =&gt; 78,<br/>+&nbsp;&nbsp;&nbsp; controls_always_legal =&gt; 0,<br/>&nbsp;&nbsp;&nbsp;&nbsp; %opt,<br/>&nbsp;&nbsp;&nbsp;&nbsp; fh&nbsp;&nbsp; =&gt; $fh,<br/>&nbsp;&nbsp;&nbsp;&nbsp; file =&gt; &quot;$file&quot;,<br/>@@ -352,7 +353,7 @@<br/>&nbsp;&nbsp;&nbsp;&nbsp; my $attr;<br/>&nbsp;&nbsp;&nbsp;&nbsp; my $xattr;<br/><br/>-&nbsp;&nbsp;&nbsp; if (@controls) {<br/>+&nbsp;&nbsp;&nbsp; if (@controls &amp;&amp; !$self-&gt;{controls_always_legal}) {<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $self-&gt;_error(&quot;Controls only allowed with LDIF change entries&quot;, @ldif);<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br/>&nbsp;&nbsp;&nbsp;&nbsp; }<br/>--- LDIF.pod~&nbsp;&nbsp; 2013-05-07 09:07:40.000000000 -0400<br/>+++ LDIF.pod&nbsp;&nbsp;&nbsp; 2013-05-07 08:48:52.000000000 -0400<br/>@@ -135,6 +135,11 @@<br/><br/>&nbsp;Example: raw =E&lt;gt&gt; qr/(?i:^jpegPhoto|;binary)/<br/><br/>+=item controls_always_legal =E&lt;gt&gt; 1<br/>+<br/>+Always allow controls in LDIF input, even if the input LDIF entry is not<br/>+a change entry.<br/>+<br/>&nbsp;=back<br/><br/>&nbsp;=back<br/> http://www.nntp.perl.org/group/perl.ldap/2013/05/msg3702.html Tue, 07 May 2013 14:00:25 +0000 Re: Net::LDAP Search Filter by Chris Ridd <br/>On 25 Apr 2013, at 15:03, &quot;Zachary, Carlton - Hoboken&quot; &lt;czachary@wiley.com&gt; wrote:<br/><br/>&gt; Thanks David.<br/>&gt; <br/>&gt; -----Original Message-----<br/>&gt; From: david.suarezdelis@telefonica.es [mailto:david.suarezdelis@telefonica.es] <br/>&gt; Sent: Thursday, April 25, 2013 9:35 AM<br/>&gt; To: perl-ldap@perl.org<br/>&gt; Subject: Re: Net::LDAP Search Filter<br/>&gt; <br/>&gt; Hi there, Carlton,<br/>&gt; <br/>&gt; The problem is that you are asking for employee types x and y, and assuming they cannot be of more than one type, this means the search will always be false.<br/><br/>RFC 2798 [inetOrgPerson] defines employeeType as a multi-valued attribute, so both filter items could potentially match the same entry. The AND will require the entry to contain both values, which might also be correct.<br/><br/>This sounds like an issue in the LDAP server. [Rushes off to check what ours does... :-)]<br/><br/>Chris http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3701.html Fri, 26 Apr 2013 07:15:52 +0000 RE: Modify only one attribute that has multiple values of the samename by Brian Gaber Francis,<br/><br/>I have read it on CPAN. I guess I missed that part.<br/><br/>Thanks.<br/><br/>Brian <br/><br/>-----Original Message-----<br/>From: Francis Swasey [mailto:Frank.Swasey@uvm.edu] <br/>Sent: Thursday, April 25, 2013 1:09 PM<br/>To: Brian Gaber<br/>Cc: perl-ldap@perl.org<br/>Subject: Re: Modify only one attribute that has multiple values of the same name<br/><br/>Brian,<br/><br/>What you really want is:<br/><br/>$del_msg = $ldap-&gt;modify( $dn,<br/> changes =&gt; [<br/> # delete old value<br/> delete =&gt; [ SFTrule =&gt; [ &quot;$old_value&quot; ] ],<br/> # add new value<br/> add =&gt; [ SFTrule =&gt; [ &quot;$new_value&quot; ] ]<br/> ]<br/>);<br/><br/>Why do both the add and delete in a single modify? So that it is treated as an atom and if EITHER fails, NEITHER happens (which is the creed -- &quot;at the very least, do no harm&quot;)<br/><br/>This is straight out of the perl-ldap documentation, have you read it?<br/><br/>- Frank<br/><br/><br/>On Apr 25, 2013, at 12:56 PM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/><br/>&gt; Or should the syntax be:<br/>&gt; <br/>&gt; $del_mesg = $ldap-&gt;modify( $dn,<br/>&gt; delete =&gt; {<br/>&gt; SFTrule =&gt; [<br/>&gt; &quot;$value&quot; # Remove only this SFTrule value<br/>&gt; ],<br/>&gt; }<br/>&gt; );<br/>&gt; <br/>&gt; This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such <br/>&gt; value<br/>&gt; <br/>&gt; -----Original Message-----<br/>&gt; From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca]<br/>&gt; Sent: Thursday, April 25, 2013 12:33 PM<br/>&gt; To: &#39;Francis Swasey&#39;<br/>&gt; Cc: perl-ldap@perl.org<br/>&gt; Subject: RE: Modify only one attribute that has multiple values of the <br/>&gt; same name<br/>&gt; <br/>&gt; Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?<br/>&gt; <br/>&gt; $del_mesg = $ldap-&gt;modify( $dn,<br/>&gt; delete =&gt; {<br/>&gt; member =&gt; [<br/>&gt; &quot;SFTrule=$value&quot; # Remove only this member<br/>&gt; ],<br/>&gt; }<br/>&gt; );<br/>&gt; <br/>&gt; I ask because I am getting this error:<br/>&gt; <br/>&gt; LDAP Error Code: 21 - member: value #0 invalid per syntax<br/>&gt; <br/>&gt; Thanks.<br/>&gt; <br/>&gt; -----Original Message-----<br/>&gt; From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]<br/>&gt; Sent: Thursday, April 25, 2013 12:04 PM<br/>&gt; To: Brian Gaber<br/>&gt; Cc: perl-ldap@perl.org<br/>&gt; Subject: Re: Modify only one attribute that has multiple values of the <br/>&gt; same name<br/>&gt; <br/>&gt; On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/>&gt; <br/>&gt;&gt; I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/>&gt; <br/>&gt; <br/>&gt; In pure ldif:<br/>&gt; <br/>&gt; dn: existing dn<br/>&gt; changetype: modify<br/>&gt; delete: SFTrule<br/>&gt; SFTrule: old value<br/>&gt; -<br/>&gt; add: SFTrule<br/>&gt; SFTrule: new value<br/>&gt; -<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3700.html Thu, 25 Apr 2013 17:37:05 +0000 Re: Modify only one attribute that has multiple values of the same name by Francis Swasey Brian,<br/><br/>What you really want is:<br/><br/>$del_msg = $ldap-&gt;modify( $dn,<br/> changes =&gt; [<br/> # delete old value<br/> delete =&gt; [ SFTrule =&gt; [ &quot;$old_value&quot; ] ],<br/> # add new value<br/> add =&gt; [ SFTrule =&gt; [ &quot;$new_value&quot; ] ]<br/> ]<br/>);<br/><br/>Why do both the add and delete in a single modify? So that it is treated as an atom and if EITHER fails, NEITHER happens (which is the creed -- &quot;at the very least, do no harm&quot;)<br/><br/>This is straight out of the perl-ldap documentation, have you read it?<br/><br/>- Frank<br/><br/><br/>On Apr 25, 2013, at 12:56 PM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/><br/>&gt; Or should the syntax be:<br/>&gt; <br/>&gt; $del_mesg = $ldap-&gt;modify( $dn,<br/>&gt; delete =&gt; {<br/>&gt; SFTrule =&gt; [<br/>&gt; &quot;$value&quot; # Remove only this SFTrule value<br/>&gt; ],<br/>&gt; }<br/>&gt; );<br/>&gt; <br/>&gt; This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such value<br/>&gt; <br/>&gt; -----Original Message-----<br/>&gt; From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca] <br/>&gt; Sent: Thursday, April 25, 2013 12:33 PM<br/>&gt; To: &#39;Francis Swasey&#39;<br/>&gt; Cc: perl-ldap@perl.org<br/>&gt; Subject: RE: Modify only one attribute that has multiple values of the same name<br/>&gt; <br/>&gt; Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?<br/>&gt; <br/>&gt; $del_mesg = $ldap-&gt;modify( $dn,<br/>&gt; delete =&gt; {<br/>&gt; member =&gt; [<br/>&gt; &quot;SFTrule=$value&quot; # Remove only this member<br/>&gt; ],<br/>&gt; }<br/>&gt; );<br/>&gt; <br/>&gt; I ask because I am getting this error:<br/>&gt; <br/>&gt; LDAP Error Code: 21 - member: value #0 invalid per syntax<br/>&gt; <br/>&gt; Thanks.<br/>&gt; <br/>&gt; -----Original Message-----<br/>&gt; From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]<br/>&gt; Sent: Thursday, April 25, 2013 12:04 PM<br/>&gt; To: Brian Gaber<br/>&gt; Cc: perl-ldap@perl.org<br/>&gt; Subject: Re: Modify only one attribute that has multiple values of the same name<br/>&gt; <br/>&gt; On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/>&gt; <br/>&gt;&gt; I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/>&gt; <br/>&gt; <br/>&gt; In pure ldif:<br/>&gt; <br/>&gt; dn: existing dn<br/>&gt; changetype: modify<br/>&gt; delete: SFTrule<br/>&gt; SFTrule: old value<br/>&gt; -<br/>&gt; add: SFTrule<br/>&gt; SFTrule: new value<br/>&gt; -<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3699.html Thu, 25 Apr 2013 17:08:58 +0000 RE: Modify only one attribute that has multiple values of the samename by Brian Gaber Or should the syntax be:<br/><br/>$del_mesg = $ldap-&gt;modify( $dn,<br/> delete =&gt; {<br/> SFTrule =&gt; [<br/> &quot;$value&quot; # Remove only this SFTrule value<br/> ],<br/> }<br/>);<br/><br/>This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such value<br/><br/>-----Original Message-----<br/>From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca] <br/>Sent: Thursday, April 25, 2013 12:33 PM<br/>To: &#39;Francis Swasey&#39;<br/>Cc: perl-ldap@perl.org<br/>Subject: RE: Modify only one attribute that has multiple values of the same name<br/><br/>Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?<br/><br/>$del_mesg = $ldap-&gt;modify( $dn,<br/> delete =&gt; {<br/> member =&gt; [<br/> &quot;SFTrule=$value&quot; # Remove only this member<br/> ],<br/> }<br/>);<br/><br/>I ask because I am getting this error:<br/><br/>LDAP Error Code: 21 - member: value #0 invalid per syntax<br/><br/>Thanks.<br/><br/>-----Original Message-----<br/>From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]<br/>Sent: Thursday, April 25, 2013 12:04 PM<br/>To: Brian Gaber<br/>Cc: perl-ldap@perl.org<br/>Subject: Re: Modify only one attribute that has multiple values of the same name<br/><br/>On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/><br/>&gt; I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/><br/><br/>In pure ldif:<br/><br/>dn: existing dn<br/>changetype: modify<br/>delete: SFTrule<br/>SFTrule: old value<br/>-<br/>add: SFTrule<br/>SFTrule: new value<br/>- http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3698.html Thu, 25 Apr 2013 16:56:47 +0000 RE: Modify only one attribute that has multiple values of the samename by Brian Gaber Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?<br/><br/>$del_mesg = $ldap-&gt;modify( $dn,<br/> delete =&gt; {<br/> member =&gt; [<br/> &quot;SFTrule=$value&quot; # Remove only this member<br/> ],<br/> }<br/>);<br/><br/>I ask because I am getting this error:<br/><br/>LDAP Error Code: 21 - member: value #0 invalid per syntax<br/><br/>Thanks.<br/><br/>-----Original Message-----<br/>From: Francis Swasey [mailto:Frank.Swasey@uvm.edu] <br/>Sent: Thursday, April 25, 2013 12:04 PM<br/>To: Brian Gaber<br/>Cc: perl-ldap@perl.org<br/>Subject: Re: Modify only one attribute that has multiple values of the same name<br/><br/>On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/><br/>&gt; I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/><br/><br/>In pure ldif:<br/><br/>dn: existing dn<br/>changetype: modify<br/>delete: SFTrule<br/>SFTrule: old value<br/>-<br/>add: SFTrule<br/>SFTrule: new value<br/>- http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3697.html Thu, 25 Apr 2013 16:33:17 +0000 Re: Modify only one attribute that has multiple values of the same name by Jerome Cartagena There is no such thing as &quot;modify&quot; on a multivalued attribute. As<br/>mentioned by Francis, you will have to delete the value you want to change<br/>and add a new one in place of it. The real warning is that you never<br/>really want to use the changetype: replace on a multi-valued attribute.<br/> This is because you will essentially be deleting-all existing value and<br/>replacing it with the new value you are adding. Most often than not, this<br/>is not what you want to do.<br/><br/>-Jerome<br/><br/><br/><br/>On Thu, Apr 25, 2013 at 9:04 AM, Francis Swasey &lt;Frank.Swasey@uvm.edu&gt;wrote:<br/><br/>&gt; On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt;<br/>&gt; wrote:<br/>&gt;<br/>&gt; &gt; I have a LDAP object that contains an attribute SFTrule that can have<br/>&gt; multiple values. How do I change just one of the SFTrule attribute values?<br/>&gt;<br/>&gt;<br/>&gt; In pure ldif:<br/>&gt;<br/>&gt; dn: existing dn<br/>&gt; changetype: modify<br/>&gt; delete: SFTrule<br/>&gt; SFTrule: old value<br/>&gt; -<br/>&gt; add: SFTrule<br/>&gt; SFTrule: new value<br/>&gt; -<br/><br/><br/><br/><br/>-- <br/><br/>~Jerome<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3696.html Thu, 25 Apr 2013 16:08:02 +0000 Re: Modify only one attribute that has multiple values of the same name by Francis Swasey On Apr 25, 2013, at 11:57 AM, Brian Gaber &lt;Brian.Gaber@ssc-spc.gc.ca&gt; wrote:<br/><br/>&gt; I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/><br/><br/>In pure ldif:<br/><br/>dn: existing dn<br/>changetype: modify<br/>delete: SFTrule<br/>SFTrule: old value<br/>-<br/>add: SFTrule<br/>SFTrule: new value<br/>- http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3695.html Thu, 25 Apr 2013 16:04:21 +0000 Modify only one attribute that has multiple values of the same name by Brian Gaber I have a LDAP object that contains an attribute SFTrule that can have multiple values. How do I change just one of the SFTrule attribute values?<br/><br/>Thanks.<br/><br/>Brian Gaber<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3694.html Thu, 25 Apr 2013 15:58:03 +0000 RE: Net::LDAP Search Filter by Zachary, Carlton - Hoboken Thanks David.<br/><br/>-----Original Message-----<br/>From: david.suarezdelis@telefonica.es [mailto:david.suarezdelis@telefonica.es] <br/>Sent: Thursday, April 25, 2013 9:35 AM<br/>To: perl-ldap@perl.org<br/>Subject: Re: Net::LDAP Search Filter<br/><br/>Hi there, Carlton,<br/><br/>The problem is that you are asking for employee types x and y, and assuming they cannot be of more than one type, this means the search will always be false.<br/><br/>I am sure you are looking for entries of any type of objetclass and employee type x OR y: (&amp; (objectclass=*) (| (employeetype=x)<br/>(employeetype=y) ) )<br/><br/>This should do the work... You can probably also omit the objectclass part if the entries are nomal entries (no gruoups, roles or anything weird) and simply ask for (| (employeetype=x) (employeetype=y)<br/><br/>Good luck!<br/>dwd<br/><br/><br/><br/>De:<br/>&quot;Zachary, Carlton - Hoboken&quot; &lt;czachary@wiley.com&gt;<br/>Para:<br/>&quot;perl-ldap@perl.org&quot; &lt;perl-ldap@perl.org&gt;<br/>Fecha:<br/>25/04/2013 15:27<br/>Asunto:<br/>Net::LDAP Search Filter<br/><br/><br/><br/>Hello all,<br/><br/>I am trying to run this search against my directory service with the following filter and it returns nothing.<br/><br/>(&amp;(employeetype=x)(employeetype=y)(objectclass=*))<br/><br/>But if I do just:<br/><br/>(&amp;(employeetype=x)(objectclass=*))<br/><br/>Or<br/><br/>(&amp;(employeetype=y)(objectclass=*))<br/><br/>I get search data returned.<br/><br/>Could some point out what&#39;s wrong with the first filter?<br/><br/>Thanks<br/><br/>_____________________________________________________________________<br/>Mensaje analizado y protegido por Telefonica Grandes Clientes<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3693.html Thu, 25 Apr 2013 14:09:41 +0000 RE: Net::LDAP Search Filter by Zachary, Carlton - Hoboken Thanks Graham.<br/><br/>-----Original Message-----<br/>From: Graham Barr [mailto:gbarr@pobox.com] <br/>Sent: Thursday, April 25, 2013 9:31 AM<br/>To: Zachary, Carlton - Hoboken<br/>Cc: perl-ldap@perl.org<br/>Subject: Re: Net::LDAP Search Filter<br/><br/><br/>On Apr 25, 2013, at 08:26 , &quot;Zachary, Carlton - Hoboken&quot; &lt;czachary@wiley.com&gt; wrote:<br/><br/>&gt; Hello all,<br/>&gt; <br/>&gt; I am trying to run this search against my directory service with the following filter and it returns nothing.<br/>&gt; <br/>&gt; (&amp;(employeetype=x)(employeetype=y)(objectclass=*))<br/><br/>that is checking<br/><br/>(employeetype=x) and (employeetype=y) and (objectclass=*)<br/><br/>of course<br/><br/>(employeetype=x) and (employeetype=y)<br/><br/>is always going to return an empty list unless x=y<br/><br/>maybe you wanted<br/><br/>(&amp;(|(employeetype=x)(employeetype=y))(objectclass=*))<br/><br/>to get employees of type x or type y<br/><br/>Graham.<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3692.html Thu, 25 Apr 2013 14:07:38 +0000 Re: Net::LDAP Search Filter by david.suarezdelis Hi there, Carlton,<br/><br/>The problem is that you are asking for employee types x and y, and <br/>assuming they cannot be of more than one type, this means the search will <br/>always be false.<br/><br/>I am sure you are looking for entries of any type of objetclass and <br/>employee type x OR y: (&amp; (objectclass=*) (| (employeetype=x) <br/>(employeetype=y) ) )<br/><br/>This should do the work... You can probably also omit the objectclass part <br/>if the entries are nomal entries (no gruoups, roles or anything weird) and <br/>simply ask for (| (employeetype=x) (employeetype=y)<br/><br/>Good luck!<br/>dwd<br/><br/><br/><br/>De:<br/>&quot;Zachary, Carlton - Hoboken&quot; &lt;czachary@wiley.com&gt;<br/>Para:<br/>&quot;perl-ldap@perl.org&quot; &lt;perl-ldap@perl.org&gt;<br/>Fecha:<br/>25/04/2013 15:27<br/>Asunto:<br/>Net::LDAP Search Filter<br/><br/><br/><br/>Hello all,<br/><br/>I am trying to run this search against my directory service with the <br/>following filter and it returns nothing.<br/><br/>(&amp;(employeetype=x)(employeetype=y)(objectclass=*))<br/><br/>But if I do just:<br/><br/>(&amp;(employeetype=x)(objectclass=*))<br/><br/>Or<br/><br/>(&amp;(employeetype=y)(objectclass=*))<br/><br/>I get search data returned.<br/><br/>Could some point out what&#39;s wrong with the first filter?<br/><br/>Thanks<br/><br/>_____________________________________________________________________<br/>Mensaje analizado y protegido por Telefonica Grandes Clientes<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3691.html Thu, 25 Apr 2013 13:35:32 +0000 Re: Net::LDAP Search Filter by Graham Barr <br/>On Apr 25, 2013, at 08:26 , &quot;Zachary, Carlton - Hoboken&quot; &lt;czachary@wiley.com&gt; wrote:<br/><br/>&gt; Hello all,<br/>&gt; <br/>&gt; I am trying to run this search against my directory service with the following filter and it returns nothing.<br/>&gt; <br/>&gt; (&amp;(employeetype=x)(employeetype=y)(objectclass=*))<br/><br/>that is checking<br/><br/>(employeetype=x) and (employeetype=y) and (objectclass=*)<br/><br/>of course<br/><br/>(employeetype=x) and (employeetype=y)<br/><br/>is always going to return an empty list unless x=y<br/><br/>maybe you wanted<br/><br/>(&amp;(|(employeetype=x)(employeetype=y))(objectclass=*))<br/><br/>to get employees of type x or type y<br/><br/>Graham.<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3690.html Thu, 25 Apr 2013 13:31:25 +0000 Net::LDAP Search Filter by Zachary, Carlton - Hoboken Hello all,<br/><br/>I am trying to run this search against my directory service with the following filter and it returns nothing.<br/><br/>(&amp;(employeetype=x)(employeetype=y)(objectclass=*))<br/><br/>But if I do just:<br/><br/>(&amp;(employeetype=x)(objectclass=*))<br/><br/>Or<br/><br/>(&amp;(employeetype=y)(objectclass=*))<br/><br/>I get search data returned.<br/><br/>Could some point out what&#39;s wrong with the first filter?<br/><br/>Thanks<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3689.html Thu, 25 Apr 2013 13:27:13 +0000 Re: Problem with Net::LDAP by ignatescu.dragos Hi Vladimir,<br/><br/>I tried your solution but it didn&#39;t work; the error persists.<br/><br/><br/>Dragos Ignatescu<br/><br/>&gt; On 24 April 2013 10:48, &lt;ignatescu.dragos@stsnet.ro&gt; wrote:<br/>&gt;<br/>&gt; Hi,<br/>&gt;<br/>&gt;&gt; I have a problem with perl-ldap-0.55.<br/>&gt;&gt;<br/>&gt;&gt; Code:<br/>&gt;&gt; #! /usr/bin/perl<br/>&gt;&gt; use Net::LDAP;<br/>&gt;&gt; my $ldap_server = &quot;172.20.1.100&quot;;<br/>&gt;<br/>&gt; Will this help?<br/>&gt;<br/>&gt; my $ldap_server = &quot;ldap://172.20.1.100/&quot;;<br/>&gt;<br/>&gt; Cheers,<br/>&gt;<br/>&gt; VL<br/>&gt;<br/>&gt;<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3688.html Thu, 25 Apr 2013 12:03:43 +0000 Re: Problem with Net::LDAP by Vladimir Levijev On 24 April 2013 10:48, &lt;ignatescu.dragos@stsnet.ro&gt; wrote:<br/><br/>Hi,<br/><br/>&gt; I have a problem with perl-ldap-0.55.<br/>&gt;<br/>&gt; Code:<br/>&gt; #! /usr/bin/perl<br/>&gt; use Net::LDAP;<br/>&gt; my $ldap_server = &quot;172.20.1.100&quot;;<br/><br/>Will this help?<br/><br/>my $ldap_server = &quot;ldap://172.20.1.100/&quot;;<br/><br/>Cheers,<br/><br/>VL<br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3687.html Thu, 25 Apr 2013 11:37:34 +0000 Problem with Net::LDAP by ignatescu.dragos Hi,<br/><br/>I have a problem with perl-ldap-0.55.<br/><br/>Code:<br/>#! /usr/bin/perl<br/>use Net::LDAP;<br/>my $ldap_server = &quot;172.20.1.100&quot;;<br/>my ldap = Net::LDAP -&gt; new($ldap_server) or die &quot;$@&quot;;<br/><br/><br/>At runnig:<br/>&gt;perl perl_test_ldap.pl<br/>IO::Socket::INET6: getaddrinfo: No such host is known. at<br/>perl_test_ldap.pl line 4, &lt;DATA&gt; line 747.<br/><br/>I use Strawberry Perl 5.16.3.1 32bit on Windos XP Professional SP3<br/><br/><br/>Any suggestion is welcome!<br/><br/>Dragos Ignatescu<br/><br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3686.html Thu, 25 Apr 2013 04:11:06 +0000 perl-ldap 0.55 released by Peter Marschall Hi folks,<br/><br/>I just released perl-ldap 0.55 to CPAN: http://search.cpan.org/dist/perl-ldap/<br/>(it may take a little until the CPAN mirrors in your region get it)<br/><br/>As usual the changes included are listed at the end of this email.<br/><br/>Of course, the GitHub repository https://github.com/perl-ldap/perl-ldap<br/>has been updated accordingly.<br/><br/>Enjoy<br/>Peter<br/><br/><br/>Bug Fixes:<br/>RT#84410: PersistentSearch.pm: use $message-&gt;pop_entry() in example<br/>RT#84774: Constant.pm: unbreak Novell eDirectory constants<br/><br/>Enhancements:<br/>Control/ManageDsaIT.pm: update documentation &amp; simplify a bit<br/>Control/Relax.pm: new<br/>Constant.pm: add LDAP_CONTROL_RELAX<br/>LDAP.pod: omit space from filter in synopsis<br/>FAQ.pod: don&#39;t talk of &quot;2 lines&quot; when there&#39;s only one<br/>Extra/eDirectory.pm: fix typo, space police<br/><br/>-- <br/>Peter Marschall<br/>peter@adpm.de<br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3685.html Tue, 23 Apr 2013 09:55:06 +0000 Re: Released perl-ldap 0.54 by Quanah Gibson-Mount --On Wednesday, April 03, 2013 12:56 PM -0500 Graham Barr &lt;gbarr@pobox.com&gt; <br/>wrote:<br/><br/>&gt; but keepalive is not inherently part of LDAP any more than it is part of<br/>&gt; SMTP or FTP or any other protocol.<br/><br/>OTOH, making long term, *persistent* connections IS a part of the LDAP <br/>protocol, and it is NOT generally something one does with SMTP or FTP. You <br/>are comparing apples to oranges.<br/><br/>I see this as no different than the OpenLDAP C API having already added <br/>support for the extended keepalive parameters ages ago when it is possible, <br/>or otherwise silently ignoring them. It is part of the *nature* of LDAP to <br/>allow, and *encourage* persistent connections, many of which remain idle <br/>for long periods of time.<br/><br/>&gt; But this implementation gives the impression that it is and may surprised<br/>&gt; someone when it silently does not do what is expected because of the host<br/>&gt; they ran it on.<br/><br/>No, this implementation allows the use of it IF it is available. My patch <br/>specifically documents the cases in which it is. This is why documentation <br/>is provided to the end user.<br/><br/>&gt;&gt; I.e., it doesn&#39;t in any way make Net::LDAP platform specific,<br/>&gt;<br/>&gt; No, it adds non-ldap specific implementaiton<br/><br/>See above. This is something that is *very* specific to the LDAP protocol.<br/><br/>--Quanah<br/><br/><br/>--<br/><br/>Quanah Gibson-Mount<br/>Sr. Member of Technical Staff<br/>Zimbra, Inc<br/>A Division of VMware, Inc.<br/>--------------------<br/>Zimbra :: the leader in open source messaging and collaboration<br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3684.html Fri, 05 Apr 2013 18:07:38 +0000 Re: Released perl-ldap 0.54 by Graham Barr <br/>On Apr 3, 2013, at 11:58 , Quanah Gibson-Mount &lt;quanah@zimbra.com&gt; wrote:<br/><br/>&gt; --On Friday, March 29, 2013 7:14 PM +0100 Peter Marschall &lt;peter@adpm.de&gt; wrote:<br/>&gt; <br/>&gt;&gt; Hi Quanah,<br/>&gt;&gt; <br/>&gt;&gt; On Friday, 29. March 2013, Quanah Gibson-Mount wrote:<br/>&gt;&gt;&gt; Do you have plans to add the linux TCP keepalive bits I noted in a future<br/>&gt;&gt;&gt; release?<br/>&gt;&gt; <br/>&gt;&gt; I am very much in doubt about the Linux specific TCP keepalive bits.<br/>&gt;&gt; I&#39;d rather keep perl-ldap independent of specific OS peculiarities.<br/>&gt;&gt; <br/>&gt;&gt; Net::LDAP exposes the socket it uses via the socket() method.<br/>&gt;&gt; Can&#39;t this be used to implement the things on the application side?<br/>&gt; <br/>&gt; Hi Peter,<br/>&gt; <br/>&gt; In doubt about what exactly? If you look at the patch I wrote, it does nothing unless the related perl module is installed. Any application that used Net::LDAP (such as Amavis) can then trivially set the parameters in its setup block for Net::LDAP, and it will work without error on any system, regardless of whether or not the enhanced keepalive bits are available. In fact, that&#39;s exactly what I patched amavis to do:<br/>&gt; <br/>&gt; my $ldap = Net::LDAP-&gt;new($self-&gt;{hostname},<br/>&gt; localaddr =&gt; $self-&gt;{localaddr},<br/>&gt; port =&gt; $self-&gt;{port},<br/>&gt; scheme =&gt; $self-&gt;{scheme},<br/>&gt; version =&gt; $self-&gt;{version},<br/>&gt; timeout =&gt; $self-&gt;{timeout},<br/>&gt; keepalive =&gt; 1,<br/>&gt; keepalive_idle =&gt; 240,<br/>&gt; keepalive_interval =&gt; 30,<br/>&gt; keepalive_probe =&gt; 10,<br/>&gt; );<br/>&gt; <br/>&gt; This allows amavis to set keepalive on any platform. If the platform doesn&#39;t support the enhanced directives, Net::LDAP just ignores them. It allows for future expansion if/when other platforms add support for the enhanced keepalive directives and someone adds a perl module for it ( OSX has some but not all last I checked).<br/><br/>but keepalive is not inherently part of LDAP any more than it is part of SMTP or FTP or any other protocol.<br/><br/>But this implementation gives the impression that it is and may surprised someone when it silently does not do what is expected because of the host they ran it on.<br/><br/>&gt; I.e., it doesn&#39;t in any way make Net::LDAP platform specific,<br/><br/>No, it adds non-ldap specific implementaiton<br/><br/>&gt; but it allows enhanced functionality if it is supported on the platform in a way that application authors can trivially add it to their existing code, keeping it clearly organized in their Net::LDAP instantiation blocks.<br/><br/>I agree with Peter&#39;s comment that it is better, IMO, for an application that cares about this to do so by using the $ldap-&gt;socket to get the socket.<br/><br/>Graham.<br/><br/> http://www.nntp.perl.org/group/perl.ldap/2013/04/msg3683.html Wed, 03 Apr 2013 17:56:48 +0000