summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.h
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 03:16:08 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit72aa8e7b1d234b6b68446d42efa1cff22b70c81b (patch)
treeb712144660ce3eb931a173fc2d98f00031ca6a52 /src/db/sysdb.h
parentf2ce4a4a45bfc0c9ba6d1a13348494dd4c49d4fb (diff)
downloadsssd-72aa8e7b1d234b6b68446d42efa1cff22b70c81b.tar.gz
sssd-72aa8e7b1d234b6b68446d42efa1cff22b70c81b.tar.xz
sssd-72aa8e7b1d234b6b68446d42efa1cff22b70c81b.zip
Refactor sysdb initialization
Change the way sysdbs are initialized. Make callers responsible for providing the list of domains. Remove the returned array of sysdb contexts, it was used only by sss_cache and not really necessary there either as that tool can easily iterate the domains. Make sysdb ctx children of their respective domains. Neither sysdb context nor domains are ever freed until a program is done so there shouldn't be any memory hierarchy issue. As plus we simplify the code by removing a destructor and a setter function.
Diffstat (limited to 'src/db/sysdb.h')
-rw-r--r--src/db/sysdb.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 378ce4889..d191dd3d2 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -227,13 +227,6 @@
struct confdb_ctx;
struct sysdb_ctx;
-struct sysdb_ctx_list {
- struct sysdb_ctx **dbs;
- size_t num_dbs;
-
- char *db_path;
-};
-
struct sysdb_attrs {
int num;
struct ldb_message_element *a;
@@ -452,10 +445,9 @@ errno_t sysdb_update_ranges(struct sysdb_ctx *sysdb,
* call this function *only* once to initialize the database and get
* the sysdb ctx */
int sysdb_init(TALLOC_CTX *mem_ctx,
- struct confdb_ctx *cdb,
+ struct sss_domain_info *domains,
const char *alt_db_path,
- bool allow_upgrade,
- struct sysdb_ctx_list **_ctx_list);
+ bool allow_upgrade);
/* used to initialize only one domain database.
* Do NOT use if sysdb_init has already been called */
int sysdb_domain_init(TALLOC_CTX *mem_ctx,
@@ -470,13 +462,6 @@ errno_t sysdb_init_domain_and_sysdb(TALLOC_CTX *mem_ctx,
struct sss_domain_info **_domain,
struct sysdb_ctx **_ctx);
-int sysdb_list_init(TALLOC_CTX *mem_ctx,
- const char *path,
- struct sysdb_ctx *sysdb,
- struct sysdb_ctx_list **_list);
-
-errno_t sysdb_add_to_domain(struct sss_domain_info *domain,
- struct sysdb_ctx *ctx);
/* functions to retrieve information from sysdb
* These functions automatically starts an operation
* therefore they cannot be called within a transaction */