perl.ldap http://www.nntp.perl.org/group/perl.ldap/ Re: map problems by Natxo Asenjo

From: Natxo Asenjo On Thu, May 16, 2013 at 11:27 PM, timothy adigun <2teezperl@gmail.com>wrote:

>
> Hi Natxo,
> Please see my comment below:
>
> On Thu, May 16, 2013 at 8:57 PM, Natxo Asenjo <natxo.asenjo@gmail.com>wrote:
>
>> hi,
>>
>> in a ldap script where I get a list of values of a multivalued attribute
>> like this:
>>
>> @memberof = qw( cn=group1,cn=xxx,dc=domain,dc=tld
>> cn=group2,cn=xxx,d=domain,dc=tld etc etc) ;
>>
>
> Since you use "qw", there is no need to still separate the element of
> your array with comma.
>

yes, I was not separating it, this is a normal ldap object, they contain
commas (weird, I know, it just does not surprise me any longer). So each
element is the string between the blanks. In fact the @memberof the array
is actually never like that black on white, but I get that array from
Net::LDAP after a search operation in the ldap server.

It turns out my regex was greedy and that is why it did not work. Now it is
fixed thanks to this awesome list.

Thanks for taking the time to answer my question.

--
groet,
natxo

2013-05-16T21:40:29Z
Treat attribute names in LDIF change records in a case insensitivemanor. by Raymond S Brand

From: Raymond S Brand

2013-05-13T20:34:58Z
Re: Reading LDIF files containing controls by Doug Wegscheid <p>From: 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/></p> 2013-05-11T19:37:36Z Re: Reading LDIF files containing controls by Peter Marschall

From: Peter Marschall Hi,

On Saturday, 11. May 2013, Doug Wegscheid wrote:
> Thanks for your time. The lack of response to "purity vs real-world
> usability" is disappointing.

I am sorry you see it that way, but my reason was not only "purity" as you
call it, but long term usability & compatibility.

Your patch would have scratched your itch, but the burden to keep perl-ldap
maintainable, understandable & compatible [even for that RFC violation of your
tool] would be on the maintainer(s).

What if another patch came in asking for another RFC violation that would
negatively impact your patch? Which one should then prevail?

Did you at least report the bug to IBM?
Because their non-standards compliant tool is the cause of the whole
discussion.

Best
Peter

--
Peter Marschall
peter@adpm.de

2013-05-11T19:15:10Z
Re: Reading LDIF files containing controls by Doug Wegscheid

From: Doug Wegscheid Thanks for your time. The lack of response to "purity vs real-world usability" is disappointing.
>> I'm dealing with 1G+ LDIFs, and the patch *is* cleaner for me, but

>> preprocessing will work.

>When the dump utility is capable of writing to stdout, you can use a pipe.
>This way you will not need more memory, ...

correct, will not need disk. *will* more CPU, more time.

>> If I put the bug report in, will you incorporate the patch? :)
>No. [I do not want perl-ldap to look like the easier target ;-]]

purity wins over pragmatism :)

>If they do, you can throw away the preprocessor step.

I won't have a preprocessor. I have a patched Net::LDAP::LDIF! thanks to the maintainers for making it easy to patch.


If anyone is in the same situation as I, you have my permission to use the patch in my original posting.

2013-05-11T18:36:56Z
Re: Reading LDIF files containing controls by Peter Marschall

From: Peter Marschall On Saturday, 11. May 2013, you wrote:
> >What I can offer you as some kind of consolation is an idea about a simple
> >preprocessor that filters out the illegal "control:" lines
> >
> > perl -i -p -0040 -e 's/\n //' < RFC-VIOLATING-FILE \
> >
> > | grep -vi ^control: > RFC-CONFORMING-FILE
> >[the first command is required to unwrap the wrapped lines]
> >
> >Alternatively you may add a
> > changetype: add line
> >after each unwrapped dn: line.
>
> all very good suggestions, thanks for offering them.
>
> I'm dealing with 1G+ LDIFs, and the patch *is* cleaner for me, but
> preprocessing will work.

When the dump utility is capable of writing to stdout, you can use a pipe.
This way you will not need more memory, ...

> >Please at least report it to them as a bug in their tool (even if they
> >might not react). Maybe they are not even aware of the issue.
>
> If I put the bug report in, will you incorporate the patch? :)
No. [I do not want perl-ldap to look like the easier target ;-]]

My hope is IBM will fix their bug and adhere to well-established standards.
If they do, you can throw away the preprocessor step.

Best
PEter

--
Peter Marschall
peter@adpm.de

2013-05-11T18:22:01Z
Re: Reading LDIF files containing controls by Doug Wegscheid <p>From: 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/></p> 2013-05-11T17:56:33Z Re: Reading LDIF files containing controls by Doug Wegscheid

From: Doug Wegscheid >How about writing a script to post-process the output from the dump to

>make it compliant?

That would work. At that point, I'll have parsed the 700M file, so I'll not need Net::LDAP::LDIF.

2013-05-11T17:33:43Z
Re: Reading LDIF files containing controls by Peter Marschall

From: Peter Marschall Hi,

On Saturday, 11. May 2013, Doug Wegscheid wrote:
> >You may doubt it, but Quanah is right: your dump utility violates the RFC.
>
> please reread my earlier message: I do NOT doubt it violates the RFC (I
> know it does!). I'm sorry if a misread of what I wrote caused everyone to
> get the idea that I wasn't listening or understood Qaunah's email, and
> possibly caused a lack of sympathy for the situation I'm in and a lack of
> willingness to listen to my position...
>
> >I do not think that adding an option to accept this type of RFC violation
> >is the way to go, as it would be a precedent for further RFC-violations
> >(even if they were hidden behind options).
> >This way lies madness (or option hell).
>
> I'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 "being strict on output, but allowing input
> of common violations" is not unheard of in these cases, and is useful in
> the real world.
>
> There is a middle road between strict adherance to the RFCs and allowing
> anarchy, and "liberal on input, strict on output" seems to be a pretty
> reasonable middle road. It allows Net::LDIF to be useful for more real
> world problems.
>
> I am asking everyone to think about that and see if it makes sense.

I can understand your point of view, but it will not change my stance.

What I can offer you as some kind of consolation is an idea about a simple
preprocessor that filters out the illegal "control:" lines
perl -i -p -0040 -e 's/\n //' < RFC-VIOLATING-FILE \
| grep -vi ^control: > RFC-CONFORMING-FILE
[the first command is required to unwrap the wrapped lines]

Alternatively you may add a
changetype: add line
after each unwrapped dn: line.

> >Instead, please get the dump utility fixed so that it adheres to the RFC.
>
> I don't have that kind of pull with IBM.

Please at least report it to them as a bug in their tool (even if they might
not react). Maybe they are not even aware of the issue.

Best
Peter

--
Peter Marschall
peter@adpm.de

2013-05-11T17:33:28Z
Re: Reading LDIF files containing controls by Rick Sanders

From: Rick Sanders >Instead, please get the dump utility fixed so that it adheres to the RFC.
>
>> I don't have that kind of pull with IBM.

How about writing a script to post-process the output from the dump to
make it compliant?

-Rick

2013-05-11T17:03:00Z
Re: Reading LDIF files containing controls by Doug Wegscheid

From: Doug Wegscheid >You may doubt it, but Quanah is right: your dump utility violates the RFC.

please reread my earlier message: I do NOT doubt it violates the RFC (I know it does!). I'm sorry if a misread of what I wrote caused everyone to get the idea that I wasn't listening or understood Qaunah's email, and possibly caused a lack of sympathy for the situation I'm in and a lack of willingness to listen to my position...

>I do not think that adding an option to accept this type of RFC violation
>is the way to go, as it would be a precedent for further RFC-violations
>(even if they were hidden behind options).
>This way lies madness (or option hell).

I'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 "being strict on output, but allowing input of common violations" is not unheard of in these cases, and is useful in the real world.

There is a middle road between strict adherance to the RFCs and allowing anarchy, and "liberal on input, strict on output" seems to be a pretty reasonable middle road. It allows Net::LDIF to be useful for more real world problems.

I am asking everyone to think about that and see if it makes sense.

>Instead, please get the dump utility fixed so that it adheres to the RFC.


I don't have that kind of pull with IBM.

2013-05-11T16:33:45Z
Re: Reading LDIF files containing controls by Peter Marschall

From: Peter Marschall Hi Doug,

On Tuesday, 7. May 2013, Doug Wegscheid wrote:
> I don't doubt that, but the question is whether or not the patch is
> palatable...

You may doubt it, but Quanah is right: your dump utility violates the RFC.

in the "Formal Syntax Definition of LDIF" section, RFC 2849 explicitly states
that controls may only occur in change records.

I do not think that adding an option to accept this type of RFC violation
is the way to go, as it would be a precedent for further RFC-violations
(even if they were hidden behind options).
This way lies madness (or option hell).

Instead, please get the dump utility fixed so that it adheres to the RFC.

Best
Peter

PS: Please don't top-post

--
Peter Marschall
peter@adpm.de

2013-05-11T16:05:45Z
Re: Reading LDIF files containing controls by Doug Wegscheid <p>From: 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/></p> 2013-05-07T17:53:14Z Re: Reading LDIF files containing controls by Quanah Gibson-Mount

From: Quanah Gibson-Mount --On Tuesday, May 07, 2013 7:00 AM -0700 Doug Wegscheid
<dwegscheid@sbcglobal.net> wrote:

>
> 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't read them, it fails with "Controls only allowed with LDIF change
> entries".
>
> I put a patch on to allow reading of controls for non-change entries by
> specifying controls_always_legal => 1 on the Net::LDAP::LDIF->new() call.

Sounds to me like your dump utility is creating LDIF that violates
<http://tools.ietf.org/html/rfc2849>

--Quanah



--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration

2013-05-07T16:53:17Z
Reading LDIF files containing controls by Doug Wegscheid <p>From: 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/></p> 2013-05-07T14:00:25Z Re: Net::LDAP Search Filter by Chris Ridd

From: Chris Ridd
On 25 Apr 2013, at 15:03, "Zachary, Carlton - Hoboken" <czachary@wiley.com> wrote:

> Thanks David.
>
> -----Original Message-----
> From: david.suarezdelis@telefonica.es [mailto:david.suarezdelis@telefonica.es]
> Sent: Thursday, April 25, 2013 9:35 AM
> To: perl-ldap@perl.org
> Subject: Re: Net::LDAP Search Filter
>
> Hi there, Carlton,
>
> 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.

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.

This sounds like an issue in the LDAP server. [Rushes off to check what ours does... :-)]

Chris

2013-04-26T07:15:52Z
RE: Modify only one attribute that has multiple values of the samename by Brian Gaber

From: Brian Gaber Francis,

I have read it on CPAN. I guess I missed that part.

Thanks.

Brian

-----Original Message-----
From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]
Sent: Thursday, April 25, 2013 1:09 PM
To: Brian Gaber
Cc: perl-ldap@perl.org
Subject: Re: Modify only one attribute that has multiple values of the same name

Brian,

What you really want is:

$del_msg = $ldap->modify( $dn,
changes => [
# delete old value
delete => [ SFTrule => [ "$old_value" ] ],
# add new value
add => [ SFTrule => [ "$new_value" ] ]
]
);

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 -- "at the very least, do no harm")

This is straight out of the perl-ldap documentation, have you read it?

- Frank


On Apr 25, 2013, at 12:56 PM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:

> Or should the syntax be:
>
> $del_mesg = $ldap->modify( $dn,
> delete => {
> SFTrule => [
> "$value" # Remove only this SFTrule value
> ],
> }
> );
>
> This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such
> value
>
> -----Original Message-----
> From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca]
> Sent: Thursday, April 25, 2013 12:33 PM
> To: 'Francis Swasey'
> Cc: perl-ldap@perl.org
> Subject: RE: Modify only one attribute that has multiple values of the
> same name
>
> Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?
>
> $del_mesg = $ldap->modify( $dn,
> delete => {
> member => [
> "SFTrule=$value" # Remove only this member
> ],
> }
> );
>
> I ask because I am getting this error:
>
> LDAP Error Code: 21 - member: value #0 invalid per syntax
>
> Thanks.
>
> -----Original Message-----
> From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]
> Sent: Thursday, April 25, 2013 12:04 PM
> To: Brian Gaber
> Cc: perl-ldap@perl.org
> Subject: Re: Modify only one attribute that has multiple values of the
> same name
>
> On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:
>
>> 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?
>
>
> In pure ldif:
>
> dn: existing dn
> changetype: modify
> delete: SFTrule
> SFTrule: old value
> -
> add: SFTrule
> SFTrule: new value
> -

2013-04-25T17:37:05Z
Re: Modify only one attribute that has multiple values of the same name by Francis Swasey

From: Francis Swasey Brian,

What you really want is:

$del_msg = $ldap->modify( $dn,
changes => [
# delete old value
delete => [ SFTrule => [ "$old_value" ] ],
# add new value
add => [ SFTrule => [ "$new_value" ] ]
]
);

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 -- "at the very least, do no harm")

This is straight out of the perl-ldap documentation, have you read it?

- Frank


On Apr 25, 2013, at 12:56 PM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:

> Or should the syntax be:
>
> $del_mesg = $ldap->modify( $dn,
> delete => {
> SFTrule => [
> "$value" # Remove only this SFTrule value
> ],
> }
> );
>
> This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such value
>
> -----Original Message-----
> From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca]
> Sent: Thursday, April 25, 2013 12:33 PM
> To: 'Francis Swasey'
> Cc: perl-ldap@perl.org
> Subject: RE: Modify only one attribute that has multiple values of the same name
>
> Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?
>
> $del_mesg = $ldap->modify( $dn,
> delete => {
> member => [
> "SFTrule=$value" # Remove only this member
> ],
> }
> );
>
> I ask because I am getting this error:
>
> LDAP Error Code: 21 - member: value #0 invalid per syntax
>
> Thanks.
>
> -----Original Message-----
> From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]
> Sent: Thursday, April 25, 2013 12:04 PM
> To: Brian Gaber
> Cc: perl-ldap@perl.org
> Subject: Re: Modify only one attribute that has multiple values of the same name
>
> On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:
>
>> 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?
>
>
> In pure ldif:
>
> dn: existing dn
> changetype: modify
> delete: SFTrule
> SFTrule: old value
> -
> add: SFTrule
> SFTrule: new value
> -

2013-04-25T17:08:58Z
RE: Modify only one attribute that has multiple values of the samename by Brian Gaber

From: Brian Gaber Or should the syntax be:

$del_mesg = $ldap->modify( $dn,
delete => {
SFTrule => [
"$value" # Remove only this SFTrule value
],
}
);

This produces a LDAP Error Code: 16 - modify/delete: SFTrule: no such value

-----Original Message-----
From: Brian Gaber [mailto:Brian.Gaber@ssc-spc.gc.ca]
Sent: Thursday, April 25, 2013 12:33 PM
To: 'Francis Swasey'
Cc: perl-ldap@perl.org
Subject: RE: Modify only one attribute that has multiple values of the same name

Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?

$del_mesg = $ldap->modify( $dn,
delete => {
member => [
"SFTrule=$value" # Remove only this member
],
}
);

I ask because I am getting this error:

LDAP Error Code: 21 - member: value #0 invalid per syntax

Thanks.

-----Original Message-----
From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]
Sent: Thursday, April 25, 2013 12:04 PM
To: Brian Gaber
Cc: perl-ldap@perl.org
Subject: Re: Modify only one attribute that has multiple values of the same name

On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:

> 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?


In pure ldif:

dn: existing dn
changetype: modify
delete: SFTrule
SFTrule: old value
-
add: SFTrule
SFTrule: new value
-

2013-04-25T16:56:47Z
RE: Modify only one attribute that has multiple values of the samename by Brian Gaber

From: Brian Gaber Would this be the correct Net::LDAP syntax to delete the particular multivalued attribute?

$del_mesg = $ldap->modify( $dn,
delete => {
member => [
"SFTrule=$value" # Remove only this member
],
}
);

I ask because I am getting this error:

LDAP Error Code: 21 - member: value #0 invalid per syntax

Thanks.

-----Original Message-----
From: Francis Swasey [mailto:Frank.Swasey@uvm.edu]
Sent: Thursday, April 25, 2013 12:04 PM
To: Brian Gaber
Cc: perl-ldap@perl.org
Subject: Re: Modify only one attribute that has multiple values of the same name

On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:

> 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?


In pure ldif:

dn: existing dn
changetype: modify
delete: SFTrule
SFTrule: old value
-
add: SFTrule
SFTrule: new value
-

2013-04-25T16:33:17Z
Re: Modify only one attribute that has multiple values of the same name by Jerome Cartagena

From: Jerome Cartagena There is no such thing as "modify" on a multivalued attribute. As
mentioned by Francis, you will have to delete the value you want to change
and add a new one in place of it. The real warning is that you never
really want to use the changetype: replace on a multi-valued attribute.
This is because you will essentially be deleting-all existing value and
replacing it with the new value you are adding. Most often than not, this
is not what you want to do.

-Jerome



On Thu, Apr 25, 2013 at 9:04 AM, Francis Swasey <Frank.Swasey@uvm.edu>wrote:

> On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca>
> wrote:
>
> > 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?
>
>
> In pure ldif:
>
> dn: existing dn
> changetype: modify
> delete: SFTrule
> SFTrule: old value
> -
> add: SFTrule
> SFTrule: new value
> -




--

~Jerome

2013-04-25T16:08:02Z
Re: Modify only one attribute that has multiple values of the same name by Francis Swasey

From: Francis Swasey On Apr 25, 2013, at 11:57 AM, Brian Gaber <Brian.Gaber@ssc-spc.gc.ca> wrote:

> 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?


In pure ldif:

dn: existing dn
changetype: modify
delete: SFTrule
SFTrule: old value
-
add: SFTrule
SFTrule: new value
-

2013-04-25T16:04:21Z
Modify only one attribute that has multiple values of the same name by Brian Gaber

From: 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?

Thanks.

Brian Gaber



2013-04-25T15:58:03Z
RE: Net::LDAP Search Filter by Zachary, Carlton - Hoboken

From: Zachary, Carlton - Hoboken Thanks David.

-----Original Message-----
From: david.suarezdelis@telefonica.es [mailto:david.suarezdelis@telefonica.es]
Sent: Thursday, April 25, 2013 9:35 AM
To: perl-ldap@perl.org
Subject: Re: Net::LDAP Search Filter

Hi there, Carlton,

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.

I am sure you are looking for entries of any type of objetclass and employee type x OR y: (& (objectclass=*) (| (employeetype=x)
(employeetype=y) ) )

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)

Good luck!
dwd



De:
"Zachary, Carlton - Hoboken" <czachary@wiley.com>
Para:
"perl-ldap@perl.org" <perl-ldap@perl.org>
Fecha:
25/04/2013 15:27
Asunto:
Net::LDAP Search Filter



Hello all,

I am trying to run this search against my directory service with the following filter and it returns nothing.

(&(employeetype=x)(employeetype=y)(objectclass=*))

But if I do just:

(&(employeetype=x)(objectclass=*))

Or

(&(employeetype=y)(objectclass=*))

I get search data returned.

Could some point out what's wrong with the first filter?

Thanks

_____________________________________________________________________
Mensaje analizado y protegido por Telefonica Grandes Clientes



2013-04-25T14:09:41Z
RE: Net::LDAP Search Filter by Zachary, Carlton - Hoboken

From: Zachary, Carlton - Hoboken Thanks Graham.

-----Original Message-----
From: Graham Barr [mailto:gbarr@pobox.com]
Sent: Thursday, April 25, 2013 9:31 AM
To: Zachary, Carlton - Hoboken
Cc: perl-ldap@perl.org
Subject: Re: Net::LDAP Search Filter


On Apr 25, 2013, at 08:26 , "Zachary, Carlton - Hoboken" <czachary@wiley.com> wrote:

> Hello all,
>
> I am trying to run this search against my directory service with the following filter and it returns nothing.
>
> (&(employeetype=x)(employeetype=y)(objectclass=*))

that is checking

(employeetype=x) and (employeetype=y) and (objectclass=*)

of course

(employeetype=x) and (employeetype=y)

is always going to return an empty list unless x=y

maybe you wanted

(&(|(employeetype=x)(employeetype=y))(objectclass=*))

to get employees of type x or type y

Graham.



2013-04-25T14:07:38Z
Re: Net::LDAP Search Filter by david.suarezdelis

From: david.suarezdelis Hi there, Carlton,

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.

I am sure you are looking for entries of any type of objetclass and
employee type x OR y: (& (objectclass=*) (| (employeetype=x)
(employeetype=y) ) )

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)

Good luck!
dwd



De:
"Zachary, Carlton - Hoboken" <czachary@wiley.com>
Para:
"perl-ldap@perl.org" <perl-ldap@perl.org>
Fecha:
25/04/2013 15:27
Asunto:
Net::LDAP Search Filter



Hello all,

I am trying to run this search against my directory service with the
following filter and it returns nothing.

(&(employeetype=x)(employeetype=y)(objectclass=*))

But if I do just:

(&(employeetype=x)(objectclass=*))

Or

(&(employeetype=y)(objectclass=*))

I get search data returned.

Could some point out what's wrong with the first filter?

Thanks

_____________________________________________________________________
Mensaje analizado y protegido por Telefonica Grandes Clientes



2013-04-25T13:35:32Z
Re: Net::LDAP Search Filter by Graham Barr

From: Graham Barr
On Apr 25, 2013, at 08:26 , "Zachary, Carlton - Hoboken" <czachary@wiley.com> wrote:

> Hello all,
>
> I am trying to run this search against my directory service with the following filter and it returns nothing.
>
> (&(employeetype=x)(employeetype=y)(objectclass=*))

that is checking

(employeetype=x) and (employeetype=y) and (objectclass=*)

of course

(employeetype=x) and (employeetype=y)

is always going to return an empty list unless x=y

maybe you wanted

(&(|(employeetype=x)(employeetype=y))(objectclass=*))

to get employees of type x or type y

Graham.

2013-04-25T13:31:25Z
Net::LDAP Search Filter by Zachary, Carlton - Hoboken

From: Zachary, Carlton - Hoboken Hello all,

I am trying to run this search against my directory service with the following filter and it returns nothing.

(&(employeetype=x)(employeetype=y)(objectclass=*))

But if I do just:

(&(employeetype=x)(objectclass=*))

Or

(&(employeetype=y)(objectclass=*))

I get search data returned.

Could some point out what's wrong with the first filter?

Thanks

2013-04-25T13:27:13Z
Re: Problem with Net::LDAP by ignatescu.dragos

From: ignatescu.dragos Hi Vladimir,

I tried your solution but it didn't work; the error persists.


Dragos Ignatescu

> On 24 April 2013 10:48, <ignatescu.dragos@stsnet.ro> wrote:
>
> Hi,
>
>> I have a problem with perl-ldap-0.55.
>>
>> Code:
>> #! /usr/bin/perl
>> use Net::LDAP;
>> my $ldap_server = "172.20.1.100";
>
> Will this help?
>
> my $ldap_server = "ldap://172.20.1.100/";
>
> Cheers,
>
> VL
>
>



2013-04-25T12:03:43Z
Re: Problem with Net::LDAP by Vladimir Levijev

From: Vladimir Levijev On 24 April 2013 10:48, <ignatescu.dragos@stsnet.ro> wrote:

Hi,

> I have a problem with perl-ldap-0.55.
>
> Code:
> #! /usr/bin/perl
> use Net::LDAP;
> my $ldap_server = "172.20.1.100";

Will this help?

my $ldap_server = "ldap://172.20.1.100/";

Cheers,

VL

2013-04-25T11:37:34Z
Problem with Net::LDAP by ignatescu.dragos

From: ignatescu.dragos Hi,

I have a problem with perl-ldap-0.55.

Code:
#! /usr/bin/perl
use Net::LDAP;
my $ldap_server = "172.20.1.100";
my ldap = Net::LDAP -> new($ldap_server) or die "$@";


At runnig:
>perl perl_test_ldap.pl
IO::Socket::INET6: getaddrinfo: No such host is known. at
perl_test_ldap.pl line 4, <DATA> line 747.

I use Strawberry Perl 5.16.3.1 32bit on Windos XP Professional SP3


Any suggestion is welcome!

Dragos Ignatescu


2013-04-25T04:11:06Z
perl-ldap 0.55 released by Peter Marschall

From: Peter Marschall Hi folks,

I just released perl-ldap 0.55 to CPAN: http://search.cpan.org/dist/perl-ldap/
(it may take a little until the CPAN mirrors in your region get it)

As usual the changes included are listed at the end of this email.

Of course, the GitHub repository https://github.com/perl-ldap/perl-ldap
has been updated accordingly.

Enjoy
Peter


Bug Fixes:
RT#84410: PersistentSearch.pm: use $message->pop_entry() in example
RT#84774: Constant.pm: unbreak Novell eDirectory constants

Enhancements:
Control/ManageDsaIT.pm: update documentation & simplify a bit
Control/Relax.pm: new
Constant.pm: add LDAP_CONTROL_RELAX
LDAP.pod: omit space from filter in synopsis
FAQ.pod: don't talk of "2 lines" when there's only one
Extra/eDirectory.pm: fix typo, space police

--
Peter Marschall
peter@adpm.de

2013-04-23T09:55:06Z
Re: Released perl-ldap 0.54 by Quanah Gibson-Mount

From: Quanah Gibson-Mount --On Wednesday, April 03, 2013 12:56 PM -0500 Graham Barr <gbarr@pobox.com>
wrote:

> but keepalive is not inherently part of LDAP any more than it is part of
> SMTP or FTP or any other protocol.

OTOH, making long term, *persistent* connections IS a part of the LDAP
protocol, and it is NOT generally something one does with SMTP or FTP. You
are comparing apples to oranges.

I see this as no different than the OpenLDAP C API having already added
support for the extended keepalive parameters ages ago when it is possible,
or otherwise silently ignoring them. It is part of the *nature* of LDAP to
allow, and *encourage* persistent connections, many of which remain idle
for long periods of time.

> 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.

No, this implementation allows the use of it IF it is available. My patch
specifically documents the cases in which it is. This is why documentation
is provided to the end user.

>> I.e., it doesn't in any way make Net::LDAP platform specific,
>
> No, it adds non-ldap specific implementaiton

See above. This is something that is *very* specific to the LDAP protocol.

--Quanah


--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration

2013-04-05T18:07:38Z
Re: Released perl-ldap 0.54 by Graham Barr

From: Graham Barr
On Apr 3, 2013, at 11:58 , Quanah Gibson-Mount <quanah@zimbra.com> wrote:

> --On Friday, March 29, 2013 7:14 PM +0100 Peter Marschall <peter@adpm.de> wrote:
>
>> Hi Quanah,
>>
>> On Friday, 29. March 2013, Quanah Gibson-Mount wrote:
>>> Do you have plans to add the linux TCP keepalive bits I noted in a future
>>> release?
>>
>> I am very much in doubt about the Linux specific TCP keepalive bits.
>> I'd rather keep perl-ldap independent of specific OS peculiarities.
>>
>> Net::LDAP exposes the socket it uses via the socket() method.
>> Can't this be used to implement the things on the application side?
>
> Hi Peter,
>
> 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's exactly what I patched amavis to do:
>
> my $ldap = Net::LDAP->new($self->{hostname},
> localaddr => $self->{localaddr},
> port => $self->{port},
> scheme => $self->{scheme},
> version => $self->{version},
> timeout => $self->{timeout},
> keepalive => 1,
> keepalive_idle => 240,
> keepalive_interval => 30,
> keepalive_probe => 10,
> );
>
> This allows amavis to set keepalive on any platform. If the platform doesn'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).

but keepalive is not inherently part of LDAP any more than it is part of SMTP or FTP or any other protocol.

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.

> I.e., it doesn't in any way make Net::LDAP platform specific,

No, it adds non-ldap specific implementaiton

> 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.

I agree with Peter's comment that it is better, IMO, for an application that cares about this to do so by using the $ldap->socket to get the socket.

Graham.

2013-04-03T17:56:48Z
Re: Released perl-ldap 0.54 by Quanah Gibson-Mount

From: Quanah Gibson-Mount --On Friday, March 29, 2013 7:14 PM +0100 Peter Marschall <peter@adpm.de>
wrote:

> Hi Quanah,
>
> On Friday, 29. March 2013, Quanah Gibson-Mount wrote:
>> Do you have plans to add the linux TCP keepalive bits I noted in a future
>> release?
>
> I am very much in doubt about the Linux specific TCP keepalive bits.
> I'd rather keep perl-ldap independent of specific OS peculiarities.
>
> Net::LDAP exposes the socket it uses via the socket() method.
> Can't this be used to implement the things on the application side?

Hi Peter,

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's exactly what I patched amavis to do:

my $ldap = Net::LDAP->new($self->{hostname},
localaddr => $self->{localaddr},
port => $self->{port},
scheme => $self->{scheme},
version => $self->{version},
timeout => $self->{timeout},
keepalive => 1,
keepalive_idle => 240,
keepalive_interval => 30,
keepalive_probe => 10,
);

This allows amavis to set keepalive on any platform. If the platform
doesn'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).

I.e., it doesn't in any way make Net::LDAP platform specific, 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.

--Quanah


--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration

2013-04-03T16:58:54Z
Re: Released perl-ldap 0.54 by Peter Marschall

From: Peter Marschall Hi Quanah,

On Friday, 29. March 2013, Quanah Gibson-Mount wrote:
> Do you have plans to add the linux TCP keepalive bits I noted in a future
> release?

I am very much in doubt about the Linux specific TCP keepalive bits.
I'd rather keep perl-ldap independent of specific OS peculiarities.

Net::LDAP exposes the socket it uses via the socket() method.
Can't this be used to implement the things on the application side?

Best
PEter
--
Peter Marschall
peter@adpm.de

2013-03-29T18:14:23Z
Re: Released perl-ldap 0.54 by Quanah Gibson-Mount

From: Quanah Gibson-Mount --On Friday, March 29, 2013 5:29 PM +0100 Peter Marschall <peter@adpm.de>
wrote:

> Hi all,
>
> perl-ldap 0.54 has been released to CPAN
> http://search.cpan.org/dist/perl-ldap/
>
> Besides the usual cleanup and bug fixes, it contains some additions
> I'd like to mention:
> * conversion routines between generalizedTime and UNIX's time
> * Net::LDAP::Extra::eDirectory: extensions for use with Novell eDirectory

Hi Peter,

Do you have plans to add the linux TCP keepalive bits I noted in a future
release?

Thanks,
Quanah

--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration

2013-03-29T16:40:00Z
Released perl-ldap 0.54 by Peter Marschall

From: Peter Marschall Hi all,

perl-ldap 0.54 has been released to CPAN
http://search.cpan.org/dist/perl-ldap/

Besides the usual cleanup and bug fixes, it contains some additions
I'd like to mention:
* conversion routines between generalizedTime and UNIX's time
* Net::LDAP::Extra::eDirectory: extensions for use with Novell eDirectory

The detailed changes are listed at the end of this email.

Of course, the GitHub repository https://github.com/perl-ldap/perl-ldap
has been updated accordingly.

Enjoy
Peter

0.54 -- Fri Mar 29 12:07:40 CET 2013

Bug Fixes:
* RT#73202: LDIF.pm: Base64-encode values ending in spaces
* RT#83815: fix typo/bug in example for root_dse

Enhancements:
* FAQ.pod: mention Dancer::Plugin::LDAP, update example
* Extra/eDirectory.pm: new; extensions for eDirectory
* Constant.pm: add constants for Novell eDirectory
* LDIF.pm: clean up handling of mode parameter
* LDIF.pm: partially support controls when reading
* Util.pm: add time conversion functions
* Makefile.PL: update recommends, add comments on core modules
* FAQ.pod: update info on required/optional modules
* LDAP.pod,FAQ.pod: harmonize documentation of scope values

--
Peter Marschall
peter@adpm.de

2013-03-29T16:30:09Z
RE: problems with sasl by Natxo Asenjo

From: Natxo Asenjo hi,

looking at the Authen::SASL cpan page I see questions related to this module should be on this list too.

I have asked for debuggin info to sasl:

$ perl testkerb.pl adm
state(0): The routine must be called again to complete its function;Unknown error; output token sz: 621
state(0): The routine completed successfully;Unknown error; output token sz:
state(1): layermask 7,rsz 2048,lsz 16777215,choice 4
substr outside of string at /opt/perl5/perls/perl-5.14.2/lib/site_perl/5.14.4/Authen/SASL/Perl.pm line 333, <DATA> line 635.

On the ldap server logs I see I logged in and that the query was executed, but it keeps barfing.

Net::LDAP version is 0.53, Authen::SASL is 2.16 (both the latest, I think).

--
natxo

2013-03-23T23:33:56Z
Re: problems with sasl by Natxo Asenjo

From: Natxo Asenjo On Fri, Mar 22, 2013 at 9:06 AM, Natxo Asenjo <natxo@asenjo.nl> wrote:

please ignore this message. I resent it from my gmail address because
it was not reaching the mailing list but it did reach it as I now see.

Too impatient, I guess. The problem is already solved.

--
natxo

2013-03-23T20:43:30Z