s3:registry: add db_context argument to regdb_delete_key_with_prefix()
[ira/wip.git] / source3 / registry / reg_backend_db.c
index 30f1db9c530c2bff08d9e57c825768f222f84650..bdb237aafcb11e61b95bcc655d56ad59532e5776 100644 (file)
@@ -239,7 +239,7 @@ WERROR init_registry_data(void)
 {
        WERROR werr;
        TALLOC_CTX *frame = talloc_stackframe();
-       REGVAL_CTR *values;
+       struct regval_ctr *values;
        int i;
        UNISTR2 data;
 
@@ -254,7 +254,7 @@ WERROR init_registry_data(void)
        }
 
        for (i=0; builtin_registry_values[i].path != NULL; i++) {
-               values = TALLOC_ZERO_P(frame, REGVAL_CTR);
+               values = TALLOC_ZERO_P(frame, struct regval_ctr);
                if (values == NULL) {
                        werr = WERR_NOMEM;
                        goto done;
@@ -307,7 +307,7 @@ do_init:
 
        for (i=0; builtin_registry_values[i].path != NULL; i++) {
 
-               values = TALLOC_ZERO_P(frame, REGVAL_CTR);
+               values = TALLOC_ZERO_P(frame, struct regval_ctr);
                if (values == NULL) {
                        werr = WERR_NOMEM;
                        goto fail;
@@ -511,7 +511,8 @@ int regdb_get_seqnum(void)
 }
 
 
-static WERROR regdb_delete_key_with_prefix(const char *keyname,
+static WERROR regdb_delete_key_with_prefix(struct db_context *db,
+                                          const char *keyname,
                                           const char *prefix)
 {
        char *path;
@@ -537,7 +538,7 @@ static WERROR regdb_delete_key_with_prefix(const char *keyname,
                goto done;
        }
 
-       werr = ntstatus_to_werror(dbwrap_delete_bystring(regdb, path));
+       werr = ntstatus_to_werror(dbwrap_delete_bystring(db, path));
 
        /* treat "not" found" as ok */
        if (W_ERROR_EQUAL(werr, WERR_NOT_FOUND)) {
@@ -552,17 +553,17 @@ done:
 
 static WERROR regdb_delete_values(const char *keyname)
 {
-       return regdb_delete_key_with_prefix(keyname, REG_VALUE_PREFIX);
+       return regdb_delete_key_with_prefix(regdb, keyname, REG_VALUE_PREFIX);
 }
 
 static WERROR regdb_delete_secdesc(const char *keyname)
 {
-       return regdb_delete_key_with_prefix(keyname, REG_SECDESC_PREFIX);
+       return regdb_delete_key_with_prefix(regdb, keyname, REG_SECDESC_PREFIX);
 }
 
 static WERROR regdb_delete_subkeylist(const char *keyname)
 {
-       return regdb_delete_key_with_prefix(keyname, NULL);
+       return regdb_delete_key_with_prefix(regdb, keyname, NULL);
 }
 
 static WERROR regdb_delete_key_lists(const char *keyname)
@@ -1398,7 +1399,7 @@ done:
  Unpack a list of registry values frem the TDB
  ***************************************************************************/
 
-static int regdb_unpack_values(REGVAL_CTR *values, uint8 *buf, int buflen)
+static int regdb_unpack_values(struct regval_ctr *values, uint8 *buf, int buflen)
 {
        int             len = 0;
        uint32          type;
@@ -1443,11 +1444,11 @@ static int regdb_unpack_values(REGVAL_CTR *values, uint8 *buf, int buflen)
  Pack all values in all printer keys
  ***************************************************************************/
 
-static int regdb_pack_values(REGVAL_CTR *values, uint8 *buf, int buflen)
+static int regdb_pack_values(struct regval_ctr *values, uint8 *buf, int buflen)
 {
        int             len = 0;
        int             i;
-       REGISTRY_VALUE  *val;
+       struct regval_blob      *val;
        int             num_values;
 
        if ( !values )
@@ -1478,7 +1479,7 @@ static int regdb_pack_values(REGVAL_CTR *values, uint8 *buf, int buflen)
  released by the caller.
  ***********************************************************************/
 
-int regdb_fetch_values( const char* key, REGVAL_CTR *values )
+int regdb_fetch_values(const char* key, struct regval_ctr *values)
 {
        char *keystr = NULL;
        TALLOC_CTX *ctx = talloc_stackframe();
@@ -1513,7 +1514,7 @@ done:
        return ret;
 }
 
-bool regdb_store_values( const char *key, REGVAL_CTR *values )
+bool regdb_store_values(const char *key, struct regval_ctr *values)
 {
        TDB_DATA old_data, data;
        char *keystr = NULL;
@@ -1658,7 +1659,7 @@ bool regdb_subkeys_need_update(struct regsubkey_ctr *subkeys)
        return (regdb_get_seqnum() != regsubkey_ctr_get_seqnum(subkeys));
 }
 
-bool regdb_values_need_update(REGVAL_CTR *values)
+bool regdb_values_need_update(struct regval_ctr *values)
 {
        return (regdb_get_seqnum() != values->seqnum);
 }
@@ -1667,7 +1668,7 @@ bool regdb_values_need_update(REGVAL_CTR *values)
  * Table of function pointers for default access
  */
  
-REGISTRY_OPS regdb_ops = {
+struct registry_ops regdb_ops = {
        .fetch_subkeys = regdb_fetch_keys,
        .fetch_values = regdb_fetch_values,
        .store_subkeys = regdb_store_keys,