summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-04-23 16:35:21 +0300
committerKamen Mazdrashki <kamenim@samba.org>2010-04-29 04:54:07 +0300
commit59830d0a6effa6509eae384f08cf3df32cd53359 (patch)
tree35941731960cdab341dfbf77035311d242daaa80
parenta8438015cae6d426bf140feffec46e129688ec8e (diff)
downloadsamba-59830d0a6effa6509eae384f08cf3df32cd53359.tar.gz
samba-59830d0a6effa6509eae384f08cf3df32cd53359.tar.bz2
samba-59830d0a6effa6509eae384f08cf3df32cd53359.zip
s4/dsdb: schemaInfo revision may be 0
In case schemaInfo value is still not set, WinAD supplies schemaInfo blob with revision = 0 and GUID_ZERO
-rw-r--r--source4/dsdb/schema/schema_info_attr.c6
-rw-r--r--source4/torture/drs/unit/schemainfo_tests.c29
2 files changed, 11 insertions, 24 deletions
diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c
index ac5bdc2fa9..ac22eb9b3f 100644
--- a/source4/dsdb/schema/schema_info_attr.c
+++ b/source4/dsdb/schema/schema_info_attr.c
@@ -135,10 +135,6 @@ WERROR dsdb_blob_from_schema_info(const struct dsdb_schema_info *schema_info,
enum ndr_err_code ndr_err;
struct schemaInfoBlob schema_info_blob;
- if (schema_info->revision < 1) {
- return WERR_INVALID_PARAMETER;
- }
-
schema_info_blob.marker = 0xFF;
schema_info_blob.revision = schema_info->revision;
schema_info_blob.invocation_id = schema_info->invocation_id;
@@ -209,7 +205,7 @@ WERROR dsdb_module_schema_info_blob_read(struct ldb_module *ldb_module,
}
/**
- * Pepares ldb_msg to be used for updating schemaInfo value in DB
+ * Prepares ldb_msg to be used for updating schemaInfo value in DB
*/
static WERROR _dsdb_schema_info_write_prepare(struct ldb_context *ldb,
DATA_BLOB *schema_info_blob,
diff --git a/source4/torture/drs/unit/schemainfo_tests.c b/source4/torture/drs/unit/schemainfo_tests.c
index 55d782f86c..d093fa56f0 100644
--- a/source4/torture/drs/unit/schemainfo_tests.c
+++ b/source4/torture/drs/unit/schemainfo_tests.c
@@ -33,10 +33,10 @@
/**
* schemaInfo to init ldb context with
- * Rev: 01
- * GUID: 071c82fd-45c7-4351-a3db-51f75a630a7f
+ * Rev: 0
+ * GUID: 00000000-0000-0000-0000-000000000000
*/
-#define SCHEMA_INFO_INIT_STR "FF0000000100000000000000000000000000000000"
+#define SCHEMA_INFO_INIT_STR "FF0000000000000000000000000000000000000000"
/**
* Default schema_info string to be used for testing
@@ -66,6 +66,13 @@ static const struct {
bool test_both_ways;
} _schemainfo_test_data[] = {
{
+ .schema_info_str = "FF0000000000000000000000000000000000000000",
+ .revision = 0,
+ .guid_str = "00000000-0000-0000-0000-000000000000",
+ .werr_expected = WERR_OK,
+ .test_both_ways = true
+ },
+ {
.schema_info_str = "FF00000001FD821C07C7455143A3DB51F75A630A7F",
.revision = 1,
.guid_str = "071c82fd-45c7-4351-a3db-51f75a630a7f",
@@ -79,18 +86,6 @@ static const struct {
.werr_expected = WERR_OK,
.test_both_ways = true
},
-#if 0
- /* removed until kamen can take a look - revision 0 is sent by
- * w2k8r2, and we need to accept it, possibly only when the
- * other fields are zero */
- { /* revision > 0 */
- .schema_info_str = "FF00000000FD821C07C7455143A3DB51F75A630A7F",
- .revision = 0,
- .guid_str = "071c82fd-45c7-4351-a3db-51f75a630a7f",
- .werr_expected = WERR_INVALID_PARAMETER,
- .test_both_ways = true
- },
-#endif
{ /* len == 21 */
.schema_info_str = "FF00000001FD821C07C7455143A3DB51F75A630A7F00",
.revision = 1,
@@ -333,10 +328,6 @@ static bool test_dsdb_module_schema_info_update(struct torture_context *tctx,
werr = dsdb_schema_info_from_blob(&blob, priv, &schema_info);
torture_assert_werr_ok(tctx, werr, "dsdb_schema_info_from_blob() failed");
- /* decrement revision to be able to compare
- * against default schemaInfo later */
- schema_info->revision--;
-
/* check against default schema_info */
torture_assert_schema_info_equal(tctx, schema_info, priv->schema_info,
"schemaInfo attribute no updated correctly");