svn commit: samba r20231 - in branches/SAMBA_4_0/source:
dsdb/schema torture/ldap
metze at samba.org
metze at samba.org
Sun Dec 17 20:11:41 GMT 2006
Author: metze
Date: 2006-12-17 20:11:40 +0000 (Sun, 17 Dec 2006)
New Revision: 20231
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20231
Log:
- add more oid => uint32 id mappings
- handle the case where mappings for 1.2.3.4. and 1.2.3.4.5. prefixes
exist
- extend test suite for the mappings
metze
Modified:
branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
branches/SAMBA_4_0/source/torture/ldap/schema.c
Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/schema/schema_init.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2006-12-17 19:36:09 UTC (rev 20230)
+++ branches/SAMBA_4_0/source/dsdb/schema/schema_init.c 2006-12-17 20:11:40 UTC (rev 20231)
@@ -41,9 +41,13 @@
_PREFIX(0x00150000, "0.9.2342.19200300.100.1."),
_PREFIX(0x00160000, "2.16.840.1.113730.3.1."),
_PREFIX(0x00170000, "1.2.840.113556.1.5.7000."),
+ _PREFIX(0x00180000, "2.5.21."),
+ _PREFIX(0x00190000, "2.5.18."),
_PREFIX(0x001A0000, "2.5.20."),
+ _PREFIX(0x001B0000, "1.3.6.1.4.1.1466.101.119."),
_PREFIX(0x001C0000, "2.16.840.1.113730.3.2."),
_PREFIX(0x001D0000, "1.3.6.1.4.1.250.1."),
+ _PREFIX(0x001E0000, "1.2.840.113549.1.9."),
_PREFIX(0x001F0000, "0.9.2342.19200300.100.4."),
};
@@ -68,8 +72,19 @@
return WERR_INVALID_PARAM;
}
+ /* two '.' chars are invalid */
+ if (val_str[0] == '.') {
+ return WERR_INVALID_PARAM;
+ }
+
val = strtoul(val_str, &end_str, 10);
- if (end_str[0] != '\0') {
+ if (end_str[0] == '.' && end_str[1] != '\0') {
+ /*
+ * if it's a '.' and not the last char
+ * then maybe an other mapping apply
+ */
+ continue;
+ } else if (end_str[0] != '\0') {
return WERR_INVALID_PARAM;
} else if (val > 0xFFFF) {
return WERR_INVALID_PARAM;
Modified: branches/SAMBA_4_0/source/torture/ldap/schema.c
===================================================================
--- branches/SAMBA_4_0/source/torture/ldap/schema.c 2006-12-17 19:36:09 UTC (rev 20230)
+++ branches/SAMBA_4_0/source/torture/ldap/schema.c 2006-12-17 20:11:40 UTC (rev 20231)
@@ -393,6 +393,24 @@
DEBUG(0,("0x%08X => %s\n", id, oid));
}
+ oid = "1.2.840.113556.1.5.7000";
+ status = dsdb_map_oid2int(oid, &id);
+ if (!W_ERROR_IS_OK(status)) {
+ DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
+ ret = False;
+ } else {
+ DEBUG(0,("%s => 0x%08X\n", oid, id));
+ }
+
+ oid = "1.2.840.113556.1.5.7000.5";
+ status = dsdb_map_oid2int(oid, &id);
+ if (!W_ERROR_IS_OK(status)) {
+ DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
+ ret = False;
+ } else {
+ DEBUG(0,("%s => 0x%08X\n", oid, id));
+ }
+
oid = "1.2.840.113556.1.4.1716.";
status = dsdb_map_oid2int(oid, &id);
if (!W_ERROR_EQUAL(status, WERR_INVALID_PARAM)) {
@@ -402,8 +420,17 @@
DEBUG(0,("%s => %s (ok!)\n", oid, win_errstr(status)));
}
- oid = "1.2.840.113556.1.4.1716.65536";
+ oid = "1.2.840.113556.1.4.65535.34";
status = dsdb_map_oid2int(oid, &id);
+ if (!W_ERROR_EQUAL(status, WERR_DS_NO_MSDS_INTID)) {
+ DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
+ ret = False;
+ } else {
+ DEBUG(0,("%s => %s (ok!)\n", oid, win_errstr(status)));
+ }
+
+ oid = "1.2.840.113556.1.4..";
+ status = dsdb_map_oid2int(oid, &id);
if (!W_ERROR_EQUAL(status, WERR_INVALID_PARAM)) {
DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
ret = False;
@@ -411,8 +438,17 @@
DEBUG(0,("%s => %s (ok!)\n", oid, win_errstr(status)));
}
- oid = "5435.1.2.840.113556.1.4.1716.";
+ oid = "1.2.840.113556.1.4.65536";
status = dsdb_map_oid2int(oid, &id);
+ if (!W_ERROR_EQUAL(status, WERR_INVALID_PARAM)) {
+ DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
+ ret = False;
+ } else {
+ DEBUG(0,("%s => %s (ok!)\n", oid, win_errstr(status)));
+ }
+
+ oid = "5435.1.2.840.113556.1.4.";
+ status = dsdb_map_oid2int(oid, &id);
if (!W_ERROR_EQUAL(status, WERR_DS_NO_MSDS_INTID)) {
DEBUG(0,("%s => %s\n", oid, win_errstr(status)));
ret = False;
More information about the samba-cvs
mailing list