mirror of
https://github.com/samba-team/samba.git
synced 2025-11-15 16:23:49 +03:00
r3754: merge in ldb modules support from the tmp branch ldbPlugins
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
8e7e98ae5f
commit
71323f424b
@@ -51,16 +51,34 @@ static void usage(void)
|
||||
{
|
||||
struct ldb_context *ldb;
|
||||
const char *ldb_url;
|
||||
const char **options = NULL;
|
||||
int ldbopts;
|
||||
int opt, ret;
|
||||
|
||||
ldb_url = getenv("LDB_URL");
|
||||
|
||||
while ((opt = getopt(argc, argv, "hH:")) != EOF) {
|
||||
ldbopts = 0;
|
||||
while ((opt = getopt(argc, argv, "hH:o:")) != EOF) {
|
||||
switch (opt) {
|
||||
case 'H':
|
||||
ldb_url = optarg;
|
||||
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();
|
||||
@@ -76,7 +94,7 @@ static void usage(void)
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
ldb = ldb_connect(ldb_url, 0, NULL);
|
||||
ldb = ldb_connect(ldb_url, 0, options);
|
||||
|
||||
if (!ldb) {
|
||||
perror("ldb_connect");
|
||||
|
||||
Reference in New Issue
Block a user