/**
process command line options
*/
-struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
+static struct ldb_cmdline *ldb_cmdline_process_internal(struct ldb_context *ldb,
int argc, const char **argv,
- void (*usage)(struct ldb_context *))
+ void (*usage)(struct ldb_context *),
+ bool search)
{
struct ldb_cmdline *ret=NULL;
poptContext pc;
flags |= LDB_FLG_NOSYNC;
}
- if (options.show_binary) {
- flags |= LDB_FLG_SHOW_BINARY;
+ if (search) {
+ /*
+ * For now we're not adding LDB_FLG_RDONLY,
+ * as that would result in no tdb locking.
+ */
+
+ if (options.show_binary) {
+ flags |= LDB_FLG_SHOW_BINARY;
+ }
}
if (options.tracing) {
return NULL;
}
+struct ldb_cmdline *ldb_cmdline_process_search(struct ldb_context *ldb,
+ int argc, const char **argv,
+ void (*usage)(struct ldb_context *))
+{
+ return ldb_cmdline_process_internal(ldb, argc, argv, usage, true);
+}
+
+struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb,
+ int argc, const char **argv,
+ void (*usage)(struct ldb_context *))
+{
+ return ldb_cmdline_process_internal(ldb, argc, argv, usage, false);
+}
+
/* this function check controls reply and determines if more
* processing is needed setting up the request controls correctly
*
int tracing;
};
+struct ldb_cmdline *ldb_cmdline_process_search(struct ldb_context *ldb,
+ int argc, const char **argv,
+ void (*usage)(struct ldb_context *));
struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc,
const char **argv,
void (*usage)(struct ldb_context *));
return LDB_ERR_OPERATIONS_ERROR;
}
- options = ldb_cmdline_process(ldb, argc, argv, usage);
+ options = ldb_cmdline_process_search(ldb, argc, argv, usage);
/* the check for '=' is for compatibility with ldapsearch */
if (!options->interactive &&