s4-dsdb_schema: Handle remote ATTIDs based on msDs-IntId value
authorKamen Mazdrashki <kamenim@samba.org>
Fri, 10 Dec 2010 23:59:05 +0000 (01:59 +0200)
committerKamen Mazdrashki <kamenim@samba.org>
Tue, 14 Dec 2010 23:51:19 +0000 (00:51 +0100)
If we get such an msDs-IntId value, then we should just use it,
there is no mapping available for such values

source4/dsdb/schema/schema_syntax.c

index 3f2d3bb62dfd1bb2df539c8bb3cd4198fdf50852..1bb9a4f785810c8426036848fd5e98cb9b250d5a 100644 (file)
@@ -2652,11 +2652,24 @@ WERROR dsdb_attribute_drsuapi_to_ldb(struct ldb_context *ldb,
        dsdb_syntax_ctx_init(&syntax_ctx, ldb, schema);
        syntax_ctx.pfm_remote = pfm_remote;
 
-       /* map remote ATTID to local ATTID */
-       if (!dsdb_syntax_attid_from_remote_attid(&syntax_ctx, mem_ctx, in->attid, &attid_local)) {
-               DEBUG(0,(__location__ "Error: Can't find local ATTID for 0x%08X\n",
+       switch (dsdb_pfm_get_attid_type(in->attid)) {
+       case DSDB_ATTID_TYPE_PFM:
+               /* map remote ATTID to local ATTID */
+               if (!dsdb_syntax_attid_from_remote_attid(&syntax_ctx, mem_ctx, in->attid, &attid_local)) {
+                       DEBUG(0,(__location__ ": Can't find local ATTID for 0x%08X\n",
+                                in->attid));
+                       return WERR_FOOBAR;
+               }
+               break;
+       case DSDB_ATTID_TYPE_INTID:
+               /* use IntId value directly */
+               attid_local = in->attid;
+               break;
+       default:
+               /* we should never get here */
+               DEBUG(0,(__location__ ": Invalid ATTID type passed for conversion - 0x%08X\n",
                         in->attid));
-               return WERR_FOOBAR;
+               return WERR_INVALID_PARAMETER;
        }
 
        sa = dsdb_attribute_by_attributeID_id(schema, attid_local);