s4/drs: Remove unused structures and functions
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>
Thu, 29 Oct 2009 14:28:38 +0000 (16:28 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 6 Nov 2009 13:05:50 +0000 (14:05 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/schema/schema.h
source4/dsdb/schema/schema_init.c

index f3ba25c8644470560002431503f8997676e39e18..033dc6e1e65975d4ea6e7392576b49431d59eb5e 100644 (file)
@@ -158,11 +158,6 @@ struct dsdb_class {
        uint32_t subClass_order;
 };
 
-struct dsdb_schema_oid_prefix {
-       uint32_t id;
-       const char *oid;
-       size_t oid_len;
-};
 
 struct dsdb_schema {
 
index 412ff0ceb35b5c09159894353b5eeff38f5bf530..262ac098df93b5a95fb07f98dd041b120aace2c3 100644 (file)
@@ -252,94 +252,6 @@ WERROR dsdb_create_prefix_mapping(struct ldb_context *ldb, struct dsdb_schema *s
        return status;
 }
 
-WERROR dsdb_prefix_map_update(TALLOC_CTX *mem_ctx, uint32_t *num_prefixes, struct dsdb_schema_oid_prefix **prefixes, const char *oid)
-{
-       uint32_t new_num_prefixes, index_new_prefix, new_entry_id;
-       const char* lastDotOffset;
-       size_t size;
-       
-       new_num_prefixes = *num_prefixes + 1;
-       index_new_prefix = *num_prefixes;
-
-       /*
-        * this is the algorithm we use to create new mappings for now
-        *
-        * TODO: find what algorithm windows use
-        */
-       new_entry_id = (*num_prefixes)<<16;
-
-       /* Extract the prefix from the oid*/
-       lastDotOffset = strrchr(oid, '.');
-       if (lastDotOffset == NULL) {
-               DEBUG(0,("dsdb_prefix_map_update: failed to find the last dot\n"));
-               return WERR_NOT_FOUND;
-       }
-
-       /* Calculate the size of the remainig string that should be the prefix of it */
-       size = strlen(oid) - strlen(lastDotOffset);
-       if (size <= 0) {
-               DEBUG(0,("dsdb_prefix_map_update: size of the remaining string invalid\n"));
-               return WERR_FOOBAR;
-       }
-
-       /* Create a spot in the prefixMap for one more prefix*/
-       (*prefixes) = talloc_realloc(mem_ctx, *prefixes, struct dsdb_schema_oid_prefix, new_num_prefixes);
-       W_ERROR_HAVE_NO_MEMORY(*prefixes);
-
-       /* Add the new prefix entry*/
-       (*prefixes)[index_new_prefix].id = new_entry_id;
-       (*prefixes)[index_new_prefix].oid = talloc_strndup(mem_ctx, oid, size);
-       (*prefixes)[index_new_prefix].oid_len = strlen((*prefixes)[index_new_prefix].oid);
-
-       /* Increase num_prefixes because new prefix has been added */
-       ++(*num_prefixes);
-
-       return WERR_OK;
-}
-
-WERROR dsdb_find_prefix_for_oid(uint32_t num_prefixes, const struct dsdb_schema_oid_prefix *prefixes, const char *in, uint32_t *out)
-{
-       uint32_t i;
-       char *oid_prefix;
-       char *pstr;
-       char *end_str;
-       unsigned val;
-
-       /* make oid prefix, i.e. oid w/o last subidentifier */
-       pstr = strrchr(in, '.');
-       if (!pstr)      return WERR_INVALID_PARAM;
-       if (pstr < in)  return WERR_INVALID_PARAM;
-       if ((pstr - in) < 4) return WERR_INVALID_PARAM;
-
-       oid_prefix = talloc_strndup(0, in, pstr - in);
-
-       for (i=0; i < num_prefixes; i++) {
-               if (strcmp(prefixes[i].oid, oid_prefix) == 0) {
-                       break;
-               }
-       }
-
-       talloc_free(oid_prefix);
-
-       if (i < num_prefixes) {
-               /* move next to '.' char */
-               pstr++;
-
-               val = strtoul(pstr, &end_str, 10);
-               if (end_str[0] != '\0') {
-                       return WERR_INVALID_PARAM;
-               } else if (val > 0xFFFF) {
-                       return WERR_INVALID_PARAM;
-               }
-
-               *out = prefixes[i].id | val;
-               return WERR_OK;
-       }
-
-       DEBUG(5,(__location__ " Failed to find oid %s - have %u prefixes\n", in, num_prefixes));
-
-       return WERR_DS_NO_MSDS_INTID;
-}
 
 WERROR dsdb_write_prefixes_from_schema_to_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
                                              const struct dsdb_schema *schema)