Closed Bug 281138 Opened 20 years ago Closed 19 years ago

ldapcmp tool only accepts one host and port, should accept two sets

Categories

(Directory :: LDAP C SDK, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ulf, Assigned: richm)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041231 Firefox/1.0
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041231 Firefox/1.0

ldapcmp compares subtrees in two LDAP servers.  It should accept two set of host
and port arguments.  The usage listing is called correctly like
ldaptool_common_usage(1) for two_hosts mode, but the argument processing is
called in single host mode in the fourth argument, like
ldaptool_process_args(argc, argv, "O:p:t:s", 0, callback).  So it's only
possible to compare subtrees between a specified host and port, and localhost
and 389.

Reproducible: Always

Steps to Reproduce:
1. ldapcmp -b "cn=monitor" -h host1 -p 1389 -h host2 -p 2389

Actual Results:  
ldapcmp: only one host (-h option) should be specified

Expected Results:  
It should connect to both hosts and perform the search.
Assignee: mcs → richm
I wonder if this is a regression?

ldapcmp is not very robust and not widely used.
Ulf, is this a showstopper?  I don't think it's likely to make it into the LDAP
SDK included with DS 7.1.
That's OK, it's not a showstopper.
Attached patch CVS DIffsSplinter Review
This makes ldapcmp call ldaptool_process_args with the "two_hosts" argument set.  I tested this on RHEL4, and ldapcmp appears to work correctly with multiple host arguments:

[nkinder@crunch bin]$ ./ldapcmp -b "dc=sfbay,dc=redhat,dc=com" -h crunch -p 1389 -h crunch -p 2389
1only: ou=Groups, dc=sfbay,dc=redhat,dc=com
1only: ou=People, dc=sfbay,dc=redhat,dc=com
1only: ou=Special Users,dc=sfbay,dc=redhat,dc=com
1only: cn=Accounting Managers,ou=groups,dc=sfbay,dc=redhat,dc=com
1only: cn=HR Managers,ou=groups,dc=sfbay,dc=redhat,dc=com
1only: cn=QA Managers,ou=groups,dc=sfbay,dc=redhat,dc=com
1only: cn=PD Managers,ou=groups,dc=sfbay,dc=redhat,dc=com
Comment on attachment 208655 [details] [diff] [review]
CVS DIffs

The change looks fine to me.  Do you have check in privileges?  If so, please commit.  If not, I will soon.
Attachment #208655 - Flags: review+
Checking in ldapcmp.c;
/cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/ldapcmp.c,v  <--  ldapcmp.c
new revision: 5.6; previous revision: 5.5
done
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: