You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(200) |
Jun
(129) |
Jul
(184) |
Aug
(204) |
Sep
(106) |
Oct
(79) |
Nov
(72) |
Dec
(54) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(83) |
Feb
(123) |
Mar
(84) |
Apr
(184) |
May
(106) |
Jun
(111) |
Jul
(104) |
Aug
(91) |
Sep
(59) |
Oct
(99) |
Nov
(100) |
Dec
(37) |
2002 |
Jan
(148) |
Feb
(88) |
Mar
(85) |
Apr
(151) |
May
(80) |
Jun
(110) |
Jul
(85) |
Aug
(43) |
Sep
(64) |
Oct
(89) |
Nov
(59) |
Dec
(42) |
2003 |
Jan
(129) |
Feb
(104) |
Mar
(162) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Harri C. <har...@di...> - 2002-04-17 07:46:53
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello there, can anybody help me? I am working on a perl script to read LDIF ( rc2849 ) with the help of Net::LDAP::LDIF. The entries created I want to be written with the help of Net::LDAP or Net::LDAP::Entry into the slapd of openldap v2.1. All works well with $ldap->add($entry) and $ldap->delete($entry) but whatever I try, I can`t make modify or moddn work. Could anybody look through my code and tell me what I am doing wrong? sub ldif2master { use Net::LDAP; use Net::LDAP::LDIF; my ( $ldifdata ) = @_; my ( $ldap, $ldif, $entry, $changetype, $message, $msg, $modrdn ); $ldap = Net::LDAP->new("$Parameter::MASTER_HOST", port => "$Parameter::MASTER_PORT", version => $Parameter::VERSION ) or die "\n\n\tldif2master: Either Host not". " allive or\n\taddress might be wrong.". " Maybe use the wrong Protokoll-Version". " message: $@\n\n"; $ldap->bind ( "$Parameter::MANAGER_DN", password => "$Parameter::MANAGER_PASSWD" ) or die "$@"; $ldif = Net::LDAP::LDIF->new("./LOG/$ldifdata", "r", onerror=>'undef'); while( not $ldif->eof() ) { $entry = $ldif->read_entry(); if ( $ldif->error() ) { print "ERROR MSG: ",$ldif->error(),"\n"; print "ERROR LINES:\n",$ldif->error_lines(),"\n"; print "\nERROR, LDIF-FEHLER\n\n"; } else { my $changetype = $entry->changetype; if ( $changetype eq "add" ) { $message = $ldap->add($entry); } if ( $changetype eq "delete" ) { $message = $ldap->delete($entry); } # everything works to this point: if ( $changetype eq "modify" ) { $message = $ldap->modify($entry); } if ( $changetype eq "moddn" ) { $message = $ldap->moddn($entry); } if ( $changetype eq "modrdn" ) { $message = $ldap->moddn($entry); } # this won`t work if ( $message->code ) { #do something } } } $ldif->done(); $ldap->unbind; } modify will generate no mistake at all but no Modifikation takes place. for moddn I also tried the code below but either the module does not find a DN or it misses NewRDN. my @entrylines = split("\n",$ldif->current_lines()); if ( $changetype eq "moddn" ) { foreach my $line ( @entrylines ) { if ($line =~ /^dn\s*\:\s*(.*)$/i) { #$modrdn = $line; $modrdn = sprintf("'%s'",$1); #$dn = $1; #print "\n$modrdn\n"; next; } if ($line =~ /^newrdn\s*\:\s*(.*)$/i) { $modrdn .= sprintf(", newrdn => '%s'",$1); print "\n$modrdn\n"; next; } if ($line =~ /^deleteoldrdn\s*\:\s*(.*)$/i) { #$modrdn .= ", deleteoldrdn => $1"; #print "\n$modrdn\n"; next; } if ($line =~ /^newsuperior\s*\:\s*(.*)$/i) { $modrdn .= ", newsuperior => \"$1\""; print "\n$modrdn\n"; next; } } $message = $ldap->moddn( $modrdn ); } Please help me if you can. Thank you very much for your effort. Best regards Harri Czesla Harri Czesla ~ ~ Harri Czesla DFN Directory Services + + tel.: +49 (0)7071 29-70285 ZDV Univ. Tuebingen -- / fax: +49 (0)7071 29-5114 D-72074 Tuebingen || har...@di... Germany || http://www.directory.dfn.de - --------------------------^^---------------------------------- This article has been digitally signed, using GnuPG. Get my public key at http://www.keyserver.net/en/ for validating this signature. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Weitere Infos: siehe http://www.gnupg.org iD8DBQE8vShkVW8ZQyo1bk4RAukpAJ4uJCDO4ZYLVGXqwcC/Zsj9xN1uZACfY+xw mrwwIOWptHGp825sm5caSN8= =t0nZ -----END PGP SIGNATURE----- |
From: <CZa...@wi...> - 2002-04-16 22:07:05
|
Does anyone know what this means "Sizelimit exceeded at email_search.pl line 19." I wrote a script that does a search and the does a get_value for "mail". I then attempt to split the email address based on "@". It work fine for a few limes that I get the error about......... Help @OU = ("AusAsia", "Australia", "Canada", "Chichester", "CPA", "Indianapolis", "JosseyBass", "NewYork605", "NewYork909", "Tulsa", "USDC", "VCH"); $ldap = Net::LDAP->new('server.sys.com', port => '389') || die "ERROR: $@"; foreach $i (@OU) { $mesg = $ldap->search( base => "ou=$i,o=Wiley", scope => "subtree", filter => "(cn=*)" ); die ldap_error_desc($mesg->code) if $mesg->code; foreach $entry ($mesg->entries) { $mail = $entry->get_value('mail'); $cn = $entry->get_value('cn'); if ($mail ne "") { @email = split(/@/, $mail); print "$i: $email[0]\n"; } else { print "$i: $cn has no email address.\n"; } } } |
From: Robbie A. <ra...@ci...> - 2002-04-16 21:27:07
|
NetPro is hosting a conference on Active Directory called 'Directory Experts Conference - Running Active Directory Like Your Network Depends On It'. Target audience is experienced AD admins/architects. I will be speaking on "Automated Active Directory Management" and will discuss how we've used Net::LDAP (along with ADSI) at Cisco Systems to automate Active Directory. If you are interested in attending, check out the following site: http://www.netpro.com/welcome/directoryexperts/ Robbie Allen |
From: Graham B. <gb...@po...> - 2002-04-16 16:47:31
|
It you look in the headrs of any Email from this list you would find the details of how to unsubscribe. List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/perl-ldap-dev>, <mailto:per...@li...?subject=unsubscribe> On Tue, Apr 16, 2002 at 09:46:10AM -0700, Prakash Subramanian wrote: > unsubscribe > > Gary Flynn wrote: > > >Lars Skjærlund wrote: > > > >>Is there any way to speedup this initial login? > >> > > > >Encryption is a CPU intensive process. Check your CPU > >utilization to see if your server processor is a > >bottleneck. If so, an obvious solution would be to > >upgrade the processor. On another platform, a hardware > >crypto board may be a solution but I'm not sure if one > >is available for Novell. > > > |
From: Prakash S. <Pra...@ns...> - 2002-04-16 16:36:41
|
unsubscribe Gary Flynn wrote: >Lars Skj=E6rlund wrote: > >>Is there any way to speedup this initial login? >> > >Encryption is a CPU intensive process. Check your CPU >utilization to see if your server processor is a=20 >bottleneck. If so, an obvious solution would be to=20 >upgrade the processor. On another platform, a hardware=20 >crypto board may be a solution but I'm not sure if one=20 >is available for Novell. > |
From: Chris R. <chr...@me...> - 2002-04-16 16:04:19
|
Lars Skj=E6rlund <la...@sp...> wrote: > So: How do one decipher the hex dump and find out about the key sizes? > I've tried a lot of other s_client options, but none seems to disclose > this information. I can't figure out the s_client (or s_server) options either, sorry. I wonder how I got that info before? Cheers, Chris |
From: <la...@sp...> - 2002-04-16 14:26:58
|
Hi Chris, >> Whilst this is not a problem, it=27s rather slow. After login, everything >> runs pretty fast, but it does take quite a while to login. >About the first thing that happens on a TLS connection is a crypto >=22handshake=22, and it sounds like this is what is being slow for you. > >Common reasons for that are that the client wants a different strength >symmetric key than the server has, so the server has to generate a new one >for you. (Something like that anyway, my memory is pretty hazy.) So check >what key lengths and algorithms you=27re asking for, and what the server >supports. > >You can run the openssl s_client program in verbose/debug mode to find out >what the server=27s advertising, which might help. Tried that - but the only extra output I get from the =27-debug=27 option is a hex dump thatReceived: from Skjaerlund-MTA by porter.spinn.dk I unfortunately don=27t know how to interpret ;-). However, I=27ve come as far as this: Running =27openssl s_client=27 against the LDAP server produces output rather quickly - and has done it al the time. Just running the s_client produces an error, though, that the server certificate isn=27t trusted. I eventually figured out how to handle this, and I can now connect to the server with a trusted CA and no errors. I thought that maybe the error might delay Perl::LDAP - but no: My newly generated CA certificate does work with Perl - I can require verification and still connect - but the long delay hasn=27t gone. So: How do one decipher the hex dump and find out about the key sizes? I=27ve tried a lot of other s_client options, but none seems to disclose this information. Regards, Lars Lars Skj=E6rlund, Network Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: lars=40spinn.dk Web: http://www.spinn.dk -- |
From: Chris R. <chr...@me...> - 2002-04-16 12:42:26
|
Lars Skj=E6rlund <la...@sp...> wrote: > Hi Gary, >=20 >>> Is there any way to speedup this initial login? >>=20 >> Encryption is a CPU intensive process. Check your CPU >> utilization to see if your server processor is a=20 >> bottleneck. If so, an obvious solution would be to=20 >> upgrade the processor. On another platform, a hardware=20 >> crypto board may be a solution but I'm not sure if one=20 >> is available for Novell. >=20 > Don't think so. However, utilization isn't the problem: LDAP is _very_ I agree with Lars, since each end is using symmetric encryption to encrypt the traffic, and since symmetric algorithms are supposed to be extremely fast and use little CPU. I looked at a crypto accelerator card recently (Rainbow, or whatever they're called now :-) and it mostly just speeds up the SSL handshake which uses RSA. It certainly makes HTTPS *very* quick, but of course it costs quite a lot of money too. Cheers, Chris |
From: <la...@sp...> - 2002-04-16 12:28:40
|
Hi Gary, >> Is there any way to speedup this initial login? > >Encryption is a CPU intensive process. Check your CPU >utilization to see if your server processor is a=20 >bottleneck. If so, an obvious solution would be to=20 >upgrade the processor. On another platform, a hardware=20 >crypto board may be a solution but I=27m not sure if one=20 >is available for Novell. Don=27t think so. However, utilization isn=27t the problem: LDAP is _very_ fast when using Novells own utilities (still using SSL), and the openssl utilities are quite fast as well - that=27s why I=27m pretty sure it Perl LDAP that=27s the problem. I=27m playing around with it presently - trying to figure out how to import/add/use the trusted CA certificate for the NDS/eDir system in question as a first measure. Regards, Lars Lars Skj=E6rlund, NeReceived: from Skjaerlund-MTA by porter.spinn.dk twork Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: lars=40spinn.dk Web: http://www.spinn.dk -- |
From: Gary F. <fl...@jm...> - 2002-04-16 12:19:52
|
Lars Skj=E6rlund wrote: >=20 > Is there any way to speedup this initial login? Encryption is a CPU intensive process. Check your CPU utilization to see if your server processor is a=20 bottleneck. If so, an obvious solution would be to=20 upgrade the processor. On another platform, a hardware=20 crypto board may be a solution but I'm not sure if one=20 is available for Novell. --=20 Gary Flynn Security Engineer - Technical Services James Madison University Please R.U.N.S.A.F.E. http://www.jmu.edu/computing/runsafe |
From: Chris R. <chr...@me...> - 2002-04-16 09:11:05
|
Lars Skj=E6rlund <la...@sp...> wrote: > Hi again list, >=20 > Working with Novell NDS/eDir, I have to login to my LDAP server using > SSL. >=20 > Whilst this is not a problem, it's rather slow. After login, everything > runs pretty fast, but it does take quite a while to login. >=20 > As I'm on a protected network, I don't really care about the > certificate on the server - it's self-assigned, so I tell Perl LDAP to > ignore it. On the other hand, I want encrypted communication to avoid > evesdropping with a sniffer. >=20 > Is there any way to speedup this initial login? >=20 > Regards, > Lars About the first thing that happens on a TLS connection is a crypto "handshake", and it sounds like this is what is being slow for you. Common reasons for that are that the client wants a different strength symmetric key than the server has, so the server has to generate a new one for you. (Something like that anyway, my memory is pretty hazy.) So check what key lengths and algorithms you're asking for, and what the server supports. You can run the openssl s_client program in verbose/debug mode to find out what the server's advertising, which might help. Cheers, Chris |
From: <la...@sp...> - 2002-04-16 08:55:33
|
Hi again list, Working with Novell NDS/eDir, I have to login to my LDAP server using SSL. Whilst this is not a problem, it=27s rather slow. After login, everything runs pretty fast, but it does take quite a while to login. As I=27m on a protected network, I don=27t really care about the certificate on the server - it=27s self-assigned, so I tell Perl LDAP to ignore it. On the other hand, I want encrypted communication to avoid evesdropping with a sniffer. Is there any way to speedup this initial login? Regards, Lars Lars Skj=E6rlund, Network Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: lars=40spinn.dk Web: http://www.spinn.dk -- |
From: <la...@sp...> - 2002-04-16 08:50:43
|
Hi Lars, >I=27m not quite clear on your problem. Using =27add=27 should just add another >value to the list, regardless of what is there already, and without touching >previous data. Thanks for your help. It works now - I don=27t know what went wrong in the first place. As I don=27t know beforehand whatever combination of add, delete, and/or replace I=27ll have, I was trying to do the following: my =40Adds =3D (); my =40Deletes =3D (); =5B...=5D if (=40Adds) =7B =24result->entry(0)->add(=27ACL=27 =3D> =5C=40Adds); =7D if (=40Deletes) =7B =24result->entry(0)->delete(=27ACL=27 =3D> =5C=40Deletes); =7D if ((=40Adds) =7C=7C (=40Deletes)) =7B =24result->entry(0)->update(=24ldap); =7D As I said, I don=27t know what went wrong - for some reason my reference to =5C=40Received: from Skjaerlund-MTA by porter.spinn.dk Adds (and =5C=40Deletes) didn=27t work - I got errors like =27no = such attribute=27 etc. But it works now. >If you on the other hand mean =27replace=27, here=27s an earlier >discussions from this list: > >--cut-- >> The semantics of LDAP modify=27s =27replace=27 replaces all values of = an >> attribute with a new set of values. >> >> If you want to remove just one value, use the modify =27delete=27 value >> option. >> You can use the =27delete=27 and =27add=27 options in the same modify operation >> to >> get an atomic update of a single value. >--cut-- > >An example: > >--cut-- >=24ldap->modify( =24dn, > changes =3D> =5B > delete =3D> =5B telephoneNumber =3D> =5B=27911=27=5D=5D, =23 delete = phone number 911 > add =3D> =5B telephoneNumber =3D> =5B=27112=27=5D=5D, =23 add = phone number 112 > =5D > ); >--cut-- Again, thanks a lot: That was my next headache ;-). I had started looking for a replace function, but the above works as well. Regards, Lars Lars Skj=E6rlund, Network Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: lars=40spinn.dk Web: http://www.spinn.dk -- |
From: Lars T. <la...@th...> - 2002-04-16 06:43:00
|
I'm not quite clear on your problem. Using 'add' should just add another value to the list, regardless of what is there already, and without touching previous data. If you on the other hand mean 'replace', here's an earlier discussions from this list: --cut-- > The semantics of LDAP modify's 'replace' replaces all values of an > attribute with a new set of values. > > If you want to remove just one value, use the modify 'delete' value > option. > You can use the 'delete' and 'add' options in the same modify operation > to > get an atomic update of a single value. --cut-- An example: --cut-- $ldap->modify( $dn, changes => [ delete => [ telephoneNumber => ['911']], # delete phone number 911 add => [ telephoneNumber => ['112']], # add phone number 112 ] ); --cut-- /Lars ----- Original Message ----- From: "Lars Skjærlund" <la...@sp...> To: <per...@li...> Sent: Tuesday, April 16, 2002 8:13 AM Subject: How to add a value to a multivalued attribute Hi list, I cannot figure out how to add a new value to a multivalued attribute. In my case, I want to add a couple of entries to an ACL (access control list) in Novell NDS/eDir. Typically, there'll be a lot of other values already, so I cannot (well, I do not want) to make a simple replace. I think I've tried all the examples I've been able to find in the documentation, but I only get a bunch of varying error messages as result. Does anyone have a code snippet that works? Regards, Lars Lars Skjærlund, Network Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: la...@sp... Web: http://www.spinn.dk -- |
From: <la...@sp...> - 2002-04-16 06:13:39
|
Hi list, I cannot figure out how to add a new value to a multivalued attribute. In my case, I want to add a couple of entries to an ACL (access control list) in Novell NDS/eDir. Typically, there=27ll be a lot of other values already, so I cannot (well, I do not want) to make a simple replace. I think I=27ve tried all the examples I=27ve been able to find in the documentation, but I only get a bunch of varying error messages as result. Does anyone have a code snippet that works? Regards, Lars Lars Skj=E6rlund, Network Consultant, Spinn International ApS Bukkeballevej 30, 2960 Rungsted Kyst, Denmark Tel.: +45 70 25 88 10, Fax: +45 70 25 88 44 Mail: lars=40spinn.dk Web: http://www.spinn.dk -- |
From: Chris R. <chr...@me...> - 2002-04-15 07:21:12
|
On 12/4/02 8:26 pm, SS...@wi... <SS...@wi...> wrote: > Hi, > I have the following code: > > ######################################### > #!/opt/perl/bin/perl > > use Net::LDAP qw(:all); > use Net::LDAP::Util qw(ldap_error_desc); > use Net::LDAP::LDIF; > > $ldap = Net::LDAP->new('jws-portald', port => '390', version => 3) > || die "ERROR: $@"; > $ldif = Net::LDAP::LDIF->new > ( '/d01/oracle/product/oid301/ldap/odi/data/import/ldapdata.ldif', "r" ); > $bind = $ldap->bind('orcladmin', password => 'welcome'); > > while ($entry = $ldif->read_entry) { > $r = $ldap->add($entry); > warn $entry->dn,": ",$r->error if $r->code; > } > warn "Error reading ldapdata" unless $ldif->eof; > > ############################################# > > And I got the following error message: > > CN=testportald,OU=IT,OU=NewYork605,O=Wiley: Insufficient access at > ./odidominoagent line 30, <GEN3> line 1. > > Can you please let me know where I did wrong? > Thanks for the help!! You didn't check that your bind operation worked. In fact it shouldn't have worked because the first value in the bind method has to be a distinguished name, and 'orcladmin' isn't one of those. So your bind failed, and your directory is rejecting all add operations with "Invalid access", which seems reasonable :-) Cheers, Chris |
From: <SS...@wi...> - 2002-04-12 19:27:11
|
Hi, I have the following code: ######################################### #!/opt/perl/bin/perl use Net::LDAP qw(:all); use Net::LDAP::Util qw(ldap_error_desc); use Net::LDAP::LDIF; $ldap = Net::LDAP->new('jws-portald', port => '390', version => 3) || die "ERROR: $@"; $ldif = Net::LDAP::LDIF->new ( '/d01/oracle/product/oid301/ldap/odi/data/import/ldapdata.ldif', "r" ); $bind = $ldap->bind('orcladmin', password => 'welcome'); while ($entry = $ldif->read_entry) { $r = $ldap->add($entry); warn $entry->dn,": ",$r->error if $r->code; } warn "Error reading ldapdata" unless $ldif->eof; ############################################# And I got the following error message: CN=testportald,OU=IT,OU=NewYork605,O=Wiley: Insufficient access at ./odidominoagent line 30, <GEN3> line 1. Can you please let me know where I did wrong? Thanks for the help!! -- Sue Su 212-850-6724 |
From: Jim H. <ha...@us...> - 2002-04-12 14:43:15
|
Sorry, I typed in haste. Delete the ++ at the start of line 64 and chenge $entryct to %entryct in 66. Also, there is a typo on 68. It should be $entrydn, not $entrycdn. --Jim On Fri, 12 Apr 2002 CZa...@wi... wrote: > > I ran the script with the suggestion below and I get this error: > > <Can't modify preincrement in concatenation at ldap_dup.pl line 64, near > ");" > Type of arg 1 to keys must be hash (not scalar deref) at ldif_parse.pl line > 66, near "$entryct) "> > > > > Jim Harle > <harle@usna.ed To: CZa...@wi... > u> cc: per...@li... > Subject: Re: Checking for duplicate entries > 04/11/2002 > 05:33 PM > > > > > > > I assume that you consider a duplicate entry something with the same > first and last name? In the strict LDAP sense of things, there are no > duplicate entries returned from a given query. I think that what you want > to do is something like: > %seen = (); > $mesg = $ldap->search( > base => "o=base", > scope => "subtree", > filter => "sn=*", > attrs => ["givenname"] > ); > > foreach $entry ($mesg->entries) { > $given = get_value("givenname"); > $sn = get_value("sn"); > ++$entryct{"$sn, $givenname}; > ++$entrydn{"$sn, $givenname} .= ($entry->dn . "\n"); > } > foreach $nameset (keys $entryct) { > next unless $entryct{$nameset} > 1; > print "$entrycdn{$nameset}\n"; > } > > > On Thu, 11 Apr 2002 CZa...@wi... wrote: > > > > > I am try to detect any duplicate entries in my LDAP Service directory and > > print to STDOUT or, to a file. But, I first wanted to see if it would > pass > > back all duplicates. > > > > > > > > > > Jim Harle > > <harle@usna.ed To: CZa...@wi... > > u> cc: > per...@li... > > Subject: Re: Checking for > duplicate entries > > 04/11/2002 > > 05:03 PM > > > > > > > > > > > > > > Please be more precise about what you are trying to do. The code you > > included works fine if I use > > > > $var1 = 'John'; > > $var2 = 'Smith'; > > > > on my server, I get the 2 entries just fine. I would change > > unless $seen{$entry} > > to > > unless $seen{$entry->dn} > > but I don't think that will do anything in this case. > > > > Are you trying to find all sn/givenname combinationss where more than one > > match? > > > > --Jim > > > > On Thu, 11 Apr 2002 CZa...@wi... wrote: > > > > > Hello, can anyone help on this. I am trying to display duplicate > enties > > > that are in > > > the ldap service. > > > > > > %seen = (); > > > $mesg = $ldap->search( > > > base => "o=base", > > > scope => "subtree", > > > filter => "(&(givenname=$var1) (sn > > =$var2))" > > > ); > > > > > > foreach $entry ($mesg->entries) { > > > printf "%s \n", $entry->dn unless $seen{$entry}++ > > > } > > > > > > > > > > > > > > > > > > > > > > > > |
From: <CZa...@wi...> - 2002-04-12 14:30:28
|
I ran the script with the suggestion below and I get this error: <Can't modify preincrement in concatenation at ldap_dup.pl line 64, near ");" Type of arg 1 to keys must be hash (not scalar deref) at ldif_parse.pl line 66, near "$entryct) "> Jim Harle <harle@usna.ed To: CZa...@wi... u> cc: per...@li... Subject: Re: Checking for duplicate entries 04/11/2002 05:33 PM I assume that you consider a duplicate entry something with the same first and last name? In the strict LDAP sense of things, there are no duplicate entries returned from a given query. I think that what you want to do is something like: %seen = (); $mesg = $ldap->search( base => "o=base", scope => "subtree", filter => "sn=*", attrs => ["givenname"] ); foreach $entry ($mesg->entries) { $given = get_value("givenname"); $sn = get_value("sn"); ++$entryct{"$sn, $givenname}; ++$entrydn{"$sn, $givenname} .= ($entry->dn . "\n"); } foreach $nameset (keys $entryct) { next unless $entryct{$nameset} > 1; print "$entrycdn{$nameset}\n"; } On Thu, 11 Apr 2002 CZa...@wi... wrote: > > I am try to detect any duplicate entries in my LDAP Service directory and > print to STDOUT or, to a file. But, I first wanted to see if it would pass > back all duplicates. > > > > > Jim Harle > <harle@usna.ed To: CZa...@wi... > u> cc: per...@li... > Subject: Re: Checking for duplicate entries > 04/11/2002 > 05:03 PM > > > > > > > Please be more precise about what you are trying to do. The code you > included works fine if I use > > $var1 = 'John'; > $var2 = 'Smith'; > > on my server, I get the 2 entries just fine. I would change > unless $seen{$entry} > to > unless $seen{$entry->dn} > but I don't think that will do anything in this case. > > Are you trying to find all sn/givenname combinationss where more than one > match? > > --Jim > > On Thu, 11 Apr 2002 CZa...@wi... wrote: > > > Hello, can anyone help on this. I am trying to display duplicate enties > > that are in > > the ldap service. > > > > %seen = (); > > $mesg = $ldap->search( > > base => "o=base", > > scope => "subtree", > > filter => "(&(givenname=$var1) (sn > =$var2))" > > ); > > > > foreach $entry ($mesg->entries) { > > printf "%s \n", $entry->dn unless $seen{$entry}++ > > } > > > > > > > > > > |
From: Chris F. <cf...@vi...> - 2002-04-12 04:53:34
|
On 03 Apr 2002 00:12:11 +0200 Kjetil Torgrim Homme wrote: +------------------ | Graham Barr <gb...@po...> writes: | | > This is really off-topic for this list, but see Data::Parse and | > Date::Format | | Yeah (and learn to use http://search.cpan.org), but this reminds me | there is no module with code for converting to/from GeneralizedTime. | Not that it's very hard to write, but it would be nice to put routines | for stuff like this in a module. I'm sure there are other syntaxes | who could use utility functions which fit in. | | I can volunteer my code as a start :-) +------------------ Sorry for the late follow up. I tripped over this problem recently and just found the thread while researching a solution. I found no CPAN Time:: or Date:: parser immediately ready for this task. My code to take the timestamp into epoch seconds is below. Comments welcome -- use Time::Local; # # 20020411013841Z # YYYYMMDDhhmmss # 0....+....1....+ # sub timestamp_to_epoch { my $ts = shift; my ( $year, $month, $day, $hour, $minute, $sec ) = ( substr( $ts, 0, 4 ), substr( $ts, 4, 2 ), substr( $ts, 6, 2 ), substr( $ts, 8, 2 ), substr( $ts, 10, 2 ), substr( $ts, 12, 2 ) ); return timegm( $sec, $minute, $hour, $day, $month - 1, $year - 1900 ); } |
From: Said M. (CBN) <ma...@cb...> - 2002-04-12 00:38:07
|
Dear Admin, please unsubscribe me. or tell me how to unsubscribe. thanks in advance ~madrus~ |
From: Jim H. <ha...@us...> - 2002-04-11 21:38:28
|
I assume that you consider a duplicate entry something with the same first and last name? In the strict LDAP sense of things, there are no duplicate entries returned from a given query. I think that what you want to do is something like: %seen = (); $mesg = $ldap->search( base => "o=base", scope => "subtree", filter => "sn=*", attrs => ["givenname"] ); foreach $entry ($mesg->entries) { $given = get_value("givenname"); $sn = get_value("sn"); ++$entryct{"$sn, $givenname}; ++$entrydn{"$sn, $givenname} .= ($entry->dn . "\n"); } foreach $nameset (keys $entryct) { next unless $entryct{$nameset} > 1; print "$entrycdn{$nameset}\n"; } On Thu, 11 Apr 2002 CZa...@wi... wrote: > > I am try to detect any duplicate entries in my LDAP Service directory and > print to STDOUT or, to a file. But, I first wanted to see if it would pass > back all duplicates. > > > > > Jim Harle > <harle@usna.ed To: CZa...@wi... > u> cc: per...@li... > Subject: Re: Checking for duplicate entries > 04/11/2002 > 05:03 PM > > > > > > > Please be more precise about what you are trying to do. The code you > included works fine if I use > > $var1 = 'John'; > $var2 = 'Smith'; > > on my server, I get the 2 entries just fine. I would change > unless $seen{$entry} > to > unless $seen{$entry->dn} > but I don't think that will do anything in this case. > > Are you trying to find all sn/givenname combinationss where more than one > match? > > --Jim > > On Thu, 11 Apr 2002 CZa...@wi... wrote: > > > Hello, can anyone help on this. I am trying to display duplicate enties > > that are in > > the ldap service. > > > > %seen = (); > > $mesg = $ldap->search( > > base => "o=base", > > scope => "subtree", > > filter => "(&(givenname=$var1) (sn > =$var2))" > > ); > > > > foreach $entry ($mesg->entries) { > > printf "%s \n", $entry->dn unless $seen{$entry}++ > > } > > > > > > > > > > |
From: <CZa...@wi...> - 2002-04-11 21:15:09
|
I am try to detect any duplicate entries in my LDAP Service directory and print to STDOUT or, to a file. But, I first wanted to see if it would pass back all duplicates. Jim Harle <harle@usna.ed To: CZa...@wi... u> cc: per...@li... Subject: Re: Checking for duplicate entries 04/11/2002 05:03 PM Please be more precise about what you are trying to do. The code you included works fine if I use $var1 = 'John'; $var2 = 'Smith'; on my server, I get the 2 entries just fine. I would change unless $seen{$entry} to unless $seen{$entry->dn} but I don't think that will do anything in this case. Are you trying to find all sn/givenname combinationss where more than one match? --Jim On Thu, 11 Apr 2002 CZa...@wi... wrote: > Hello, can anyone help on this. I am trying to display duplicate enties > that are in > the ldap service. > > %seen = (); > $mesg = $ldap->search( > base => "o=base", > scope => "subtree", > filter => "(&(givenname=$var1) (sn =$var2))" > ); > > foreach $entry ($mesg->entries) { > printf "%s \n", $entry->dn unless $seen{$entry}++ > } > > |
From: Jim H. <ha...@us...> - 2002-04-11 21:03:21
|
Please be more precise about what you are trying to do. The code you included works fine if I use $var1 = 'John'; $var2 = 'Smith'; on my server, I get the 2 entries just fine. I would change unless $seen{$entry} to unless $seen{$entry->dn} but I don't think that will do anything in this case. Are you trying to find all sn/givenname combinationss where more than one match? --Jim On Thu, 11 Apr 2002 CZa...@wi... wrote: > Hello, can anyone help on this. I am trying to display duplicate enties > that are in > the ldap service. > > %seen = (); > $mesg = $ldap->search( > base => "o=base", > scope => "subtree", > filter => "(&(givenname=$var1) (sn=$var2))" > ); > > foreach $entry ($mesg->entries) { > printf "%s \n", $entry->dn unless $seen{$entry}++ > } > > |