diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-28 12:06:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:26 -0500 |
commit | b2f9612e5dda513568633d3b11872e0f0395b128 (patch) | |
tree | e2d3d4f706c7c3853b83203868c0804abbac3c28 | |
parent | 4d541b26ea08b45c9e3ab544f6cebd233ede0eee (diff) | |
download | samba-b2f9612e5dda513568633d3b11872e0f0395b128.tar.gz samba-b2f9612e5dda513568633d3b11872e0f0395b128.tar.bz2 samba-b2f9612e5dda513568633d3b11872e0f0395b128.zip |
r2721: added a -b option to ldbtest so it can be used with the new smbd ldap server
without changing realms
(This used to be commit fd2725f5c0a2ea89bbfcb0403d1bc03fa7b7ec25)
-rw-r--r-- | source4/lib/ldb/tools/ldbtest.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c index 63ce738f8c..25b86a8a43 100644 --- a/source4/lib/ldb/tools/ldbtest.c +++ b/source4/lib/ldb/tools/ldbtest.c @@ -35,6 +35,7 @@ #include "includes.h" static const char *ldb_url; +static const char *base_dn = "ou=Ldb Test,ou=People,o=University of Michigan,c=US"; static struct timeval tp1,tp2; @@ -254,10 +255,8 @@ static void search_uid(struct ldb_context *ldb, int nrecords, int nsearches) static void start_test(struct ldb_context *ldb, int nrecords, int nsearches) { - const char *base = "ou=Ldb Test,ou=People,o=University of Michigan,c=US"; - printf("Adding %d records\n", nrecords); - add_records(ldb, base, nrecords); + add_records(ldb, base_dn, nrecords); printf("Starting search on uid\n"); start_timer(); @@ -265,10 +264,10 @@ static void start_test(struct ldb_context *ldb, int nrecords, int nsearches) printf("uid search took %.2f seconds\n", end_timer()); printf("Modifying records\n"); - modify_records(ldb, base, nrecords); + modify_records(ldb, base_dn, nrecords); printf("Deleting records\n"); - delete_records(ldb, base, nrecords); + delete_records(ldb, base_dn, nrecords); } @@ -287,7 +286,6 @@ be indexed */ static void start_test_index(struct ldb_context **ldb) { - const char *base = "ou=Ldb Test,ou=People,o=University of Michigan,c=US"; struct ldb_message msg; struct ldb_message **res; int ret; @@ -306,7 +304,7 @@ static void start_test_index(struct ldb_context **ldb) } memset(&msg, 0, sizeof(msg)); - asprintf(&msg.dn, "cn=%s,%s", "test", base); + asprintf(&msg.dn, "cn=%s,%s", "test", base_dn); ldb_msg_add_string(*ldb, &msg, "cn", strdup("test")); ldb_msg_add_string(*ldb, &msg, "sn", strdup("test")); ldb_msg_add_string(*ldb, &msg, "uid", strdup("test")); @@ -366,7 +364,7 @@ static void usage(void) ldb_url = getenv("LDB_URL"); - while ((opt = getopt(argc, argv, "hH:r:s:")) != EOF) { + while ((opt = getopt(argc, argv, "hH:r:s:b:")) != EOF) { switch (opt) { case 'H': ldb_url = optarg; @@ -376,6 +374,10 @@ static void usage(void) nrecords = atoi(optarg); break; + case 'b': + base_dn = optarg; + break; + case 's': nsearches = atoi(optarg); break; |