]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbconf: add open and close operations to the smbconf_ops.
authorMichael Adam <obnox@samba.org>
Thu, 20 Mar 2008 17:40:09 +0000 (18:40 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 21 Mar 2008 01:25:56 +0000 (02:25 +0100)
Note: currently, reg_init_smbconf opens the registry, but does
not close it. This has to be changed. so that it is closed.
And then libsmbconf will need these open/close functions

Michael

source/lib/smbconf/smbconf.c
source/lib/smbconf/smbconf_private.h

index a9e895a16854192e05784442d220778047d3bec9..4a5cbbd48996b5306fbb1529aa3ac2c960178a92 100644 (file)
@@ -395,7 +395,7 @@ done:
 
 static int smbconf_destroy_ctx(struct smbconf_ctx *ctx)
 {
-       return regdb_close();
+       return ctx->ops->close_conf(ctx);
 }
 
 static WERROR smbconf_global_check(struct smbconf_ctx *ctx)
@@ -436,6 +436,16 @@ done:
        return werr;
 }
 
+static WERROR smbconf_reg_open(struct smbconf_ctx *ctx)
+{
+       return regdb_open();
+}
+
+static int smbconf_reg_close(struct smbconf_ctx *ctx)
+{
+       return regdb_close();
+}
+
 /**
  * Get the change sequence number of the given service/parameter.
  * service and parameter strings may be NULL.
@@ -751,6 +761,8 @@ done:
 
 struct smbconf_ops smbconf_ops_reg = {
        .init                   = smbconf_reg_init,
+       .open_conf              = smbconf_reg_open,
+       .close_conf             = smbconf_reg_close,
        .get_csn                = smbconf_reg_get_csn,
        .drop                   = smbconf_reg_drop,
        .get_share_names        = smbconf_reg_get_share_names,
index d9e0f1396a7c77cc223a5562b158b96f461dbdf5..a8dc23fefc1954c538070a4d28007928cba2be7c 100644 (file)
@@ -22,6 +22,8 @@
 
 struct smbconf_ops {
        WERROR (*init)(struct smbconf_ctx *ctx);
+       WERROR (*open_conf)(struct smbconf_ctx *ctx);
+       int (*close_conf)(struct smbconf_ctx *ctx);
        void (*get_csn)(struct smbconf_ctx *ctx, struct smbconf_csn *csn,
                        const char *service, const char *param);
        WERROR (*drop)(struct smbconf_ctx *ctx);