static int regdb_refcount;
static bool regdb_key_exists(const char *key);
+static bool regdb_key_is_base_key(const char *key);
/* List the deepest path into the registry. All part components will be created.*/
}
+/**
+ * check whether a given key name represents a base key,
+ * i.e one without a subkey separator ('/' or '\').
+ */
+static bool regdb_key_is_base_key(const char *key)
+{
+ TALLOC_CTX *mem_ctx = talloc_stackframe();
+ bool ret = false;
+ char *path;
+
+ if (key == NULL) {
+ goto done;
+ }
+
+ path = normalize_reg_path(mem_ctx, key);
+ if (path == NULL) {
+ DEBUG(0, ("out of memory! (talloc failed)\n"));
+ goto done;
+ }
+
+ if (*path == '\0') {
+ goto done;
+ }
+
+ ret = (strrchr(path, '/') == NULL);
+
+done:
+ TALLOC_FREE(mem_ctx);
+ return ret;
+}
+
+
/**
* Check for the existence of a key.
*