if (NT_STATUS_IS_OK(status)) {
xid->id = state.hwm;
- DEBUG(10,("New %s = %d\n", hwmtype, hwm));
+ DEBUG(10,("New %s = %d\n", hwmtype, state.hwm));
} else {
DEBUG(1, ("Error allocating a new %s\n", hwmtype));
}
goto done;
}
+ /* apply filters before returning result */
+ if ((ctx->filter_low_id
+ && (map->xid.id < ctx->filter_low_id)) ||
+ (ctx->filter_high_id
+ && (map->xid.id > ctx->filter_high_id))) {
+ DEBUG(5, ("Script returned id (%u) out of range "
+ "(%u - %u). Filtered!\n",
+ map->xid.id,
+ ctx->filter_low_id, ctx->filter_high_id));
+ ret = NT_STATUS_NONE_MAPPED;
+ goto done;
+ }
+
idstr = talloc_asprintf(tmp_ctx, "%cID %lu",
map->xid.type == ID_TYPE_UID?'U':'G',
(unsigned long)map->xid.id);
} else { /* Unknown record type ! */
DEBUG(2, ("Found INVALID record %s -> %s\n", keystr, (const char *)data.dptr));
ret = NT_STATUS_INTERNAL_DB_ERROR;
+ goto done;
}
/* apply filters before returning result */
goto done;
}
- if (!(ksidstr = sid_string_talloc(ctx, map->sid))) {
+ ksidstr = sid_string_talloc(ctx, map->sid);
+ if (ksidstr == NULL) {
DEBUG(0, ("Out of memory!\n"));
ret = NT_STATUS_NO_MEMORY;
goto done;
return ret;
}
-/*
- remove a mapping.
-*/
-static NTSTATUS idmap_tdb2_remove_mapping(struct idmap_domain *dom, const struct id_map *map)
-{
- /* not supported as it would invalidate the cache tdb on other
- nodes */
- DEBUG(0,("idmap_tdb2_remove_mapping not supported\n"));
- return NT_STATUS_NOT_SUPPORTED;
-}
-
/*
Close the idmap tdb instance
*/
return NT_STATUS_OK;
}
-
-/*
- Dump all mappings out
-*/
-static NTSTATUS idmap_tdb2_dump_data(struct idmap_domain *dom, struct id_map **maps, int *num_maps)
-{
- DEBUG(0,("idmap_tdb2_dump_data not supported\n"));
- return NT_STATUS_NOT_SUPPORTED;
-}
-
static struct idmap_methods db_methods = {
.init = idmap_tdb2_db_init,
.unixids_to_sids = idmap_tdb2_unixids_to_sids,
.sids_to_unixids = idmap_tdb2_sids_to_unixids,
.set_mapping = idmap_tdb2_set_mapping,
- .remove_mapping = idmap_tdb2_remove_mapping,
- .dump_data = idmap_tdb2_dump_data,
.close_fn = idmap_tdb2_close
};