diff options
author | Simo Sorce <idra@samba.org> | 2004-11-15 11:40:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:51 -0500 |
commit | 679e95db033fd11d17c1f1ac5e44f6cc4df2220e (patch) | |
tree | 2a6138f9c6c66025ac0e68965dc73f32846f0d1b /source4/lib/ldb/tools/ldbdel.c | |
parent | 5b397619ccd3a2189c053209387093b60ff53094 (diff) | |
download | samba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.tar.gz samba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.tar.bz2 samba-679e95db033fd11d17c1f1ac5e44f6cc4df2220e.zip |
r3754: merge in ldb modules support from the tmp branch ldbPlugins
(This used to be commit 71323f424b4561af1fdddd2358629049be3dad8c)
Diffstat (limited to 'source4/lib/ldb/tools/ldbdel.c')
-rw-r--r-- | source4/lib/ldb/tools/ldbdel.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/source4/lib/ldb/tools/ldbdel.c b/source4/lib/ldb/tools/ldbdel.c index d36db5429a..42dc9c19d8 100644 --- a/source4/lib/ldb/tools/ldbdel.c +++ b/source4/lib/ldb/tools/ldbdel.c @@ -72,13 +72,16 @@ static void usage(void) int main(int argc, char * const argv[]) { struct ldb_context *ldb; + const char **options = NULL; + int ldbopts; int ret, i; const char *ldb_url; int opt, recursive=0; ldb_url = getenv("LDB_URL"); - while ((opt = getopt(argc, argv, "hH:r")) != EOF) { + ldbopts = 0; + while ((opt = getopt(argc, argv, "hH:ro:")) != EOF) { switch (opt) { case 'H': ldb_url = optarg; @@ -88,6 +91,21 @@ static void usage(void) recursive=1; break; + case 'o': + ldbopts++; + if (options == NULL) { + options = (const char **)malloc(sizeof(char *) * (ldbopts + 1)); + } else { + options = (const char **)realloc(options, sizeof(char *) * (ldbopts + 1)); + if (options == NULL) { + fprintf(stderr, "Out of memory!\n"); + exit(-1); + } + } + options[ldbopts - 1] = optarg; + options[ldbopts] = NULL; + break; + case 'h': default: usage(); @@ -108,7 +126,7 @@ static void usage(void) exit(1); } - ldb = ldb_connect(ldb_url, 0, NULL); + ldb = ldb_connect(ldb_url, 0, options); if (!ldb) { perror("ldb_connect"); exit(1); |