[SCM] Samba Shared Repository - branch master updated
Stefan Metzmacher
metze at samba.org
Sat May 22 01:29:06 MDT 2010
The branch, master has been updated
via 796904e... s4:ldb_controls: make it possible to pass arbitrary control via the command line
from d7542b5... If using fake oplocks, use the correct SMB2 type code for "no oplock".
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 796904e983151cfa46a89a0be62f8940b9655f4a
Author: Stefan Metzmacher <metze at samba.org>
Date: Fri May 21 13:29:14 2010 +0200
s4:ldb_controls: make it possible to pass arbitrary control via the command line
--controls=local_oid:1.3.6.1.4.1.7165.4.3.7:1
To specify the DSDB_CONTROL_PASSWORD_HASH_VALUES_OID control as critical.
metze
-----------------------------------------------------------------------
Summary of changes:
source4/lib/ldb/common/ldb_controls.c | 34 +++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/lib/ldb/common/ldb_controls.c b/source4/lib/ldb/common/ldb_controls.c
index ef0e06f..010ed2d 100644
--- a/source4/lib/ldb/common/ldb_controls.c
+++ b/source4/lib/ldb/common/ldb_controls.c
@@ -802,6 +802,40 @@ struct ldb_control **ldb_parse_control_strings(struct ldb_context *ldb, void *me
continue;
}
+ if (strncmp(control_strings[i], "local_oid:", 10) == 0) {
+ const char *p;
+ int crit = 0, ret = 0;
+ char oid[256];
+
+ oid[0] = '\0';
+ p = &(control_strings[i][10]);
+ ret = sscanf(p, "%64[^:]:%d", oid, &crit);
+
+ if ((ret != 2) || strlen(oid) == 0 || (crit < 0) || (crit > 1)) {
+ error_string = talloc_asprintf(mem_ctx, "invalid local_oid control syntax\n");
+ error_string = talloc_asprintf_append(error_string, " syntax: oid(s):crit(b)\n");
+ error_string = talloc_asprintf_append(error_string, " note: b = boolean, s = string");
+ ldb_set_errstring(ldb, error_string);
+ talloc_free(error_string);
+ return NULL;
+ }
+
+ ctrl[i] = talloc(ctrl, struct ldb_control);
+ if (!ctrl[i]) {
+ ldb_oom(ldb);
+ return NULL;
+ }
+ ctrl[i]->oid = talloc_strdup(ctrl[i], oid);
+ if (!ctrl[i]->oid) {
+ ldb_oom(ldb);
+ return NULL;
+ }
+ ctrl[i]->critical = crit;
+ ctrl[i]->data = NULL;
+
+ continue;
+ }
+
/* no controls matched, throw an error */
ldb_asprintf_errstring(ldb, "Invalid control name: '%s'", control_strings[i]);
return NULL;
--
Samba Shared Repository
More information about the samba-cvs
mailing list