diff options
Diffstat (limited to 'source4/param/share_ldb.c')
-rw-r--r-- | source4/param/share_ldb.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c index fe65cb7a58..019b161639 100644 --- a/source4/param/share_ldb.c +++ b/source4/param/share_ldb.c @@ -25,6 +25,7 @@ #include "auth/auth.h" #include "db_wrap.h" #include "param/share.h" +#include "param/param.h" static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct share_context **ctx) { @@ -36,10 +37,10 @@ static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, stru return NT_STATUS_NO_MEMORY; } - sdb = ldb_wrap_connect( *ctx, - private_path(*ctx, "share.ldb"), - system_session(*ctx), - NULL, 0, NULL); + sdb = ldb_wrap_connect(*ctx, global_loadparm, + private_path(*ctx, global_loadparm, "share.ldb"), + system_session(*ctx), + NULL, 0, NULL); if (!sdb) { talloc_free(*ctx); @@ -98,16 +99,16 @@ static int sldb_int_option(struct share_config *scfg, const char *opt_name, int return ret; } -static BOOL sldb_bool_option(struct share_config *scfg, const char *opt_name, BOOL defval) +static bool sldb_bool_option(struct share_config *scfg, const char *opt_name, bool defval) { const char *val; val = sldb_string_option(scfg, opt_name, NULL); if (val == NULL) return defval; - if (strcasecmp(val, "true") == 0) return True; + if (strcasecmp(val, "true") == 0) return true; - return False; + return false; } static const char **sldb_string_list_option(TALLOC_CTX *mem_ctx, struct share_config *scfg, const char *opt_name) @@ -354,9 +355,9 @@ NTSTATUS sldb_create(struct share_context *ctx, const char *name, struct share_i /* TODO: Security Descriptor */ - SHARE_ADD_STRING(SHARE_AVAILABLE, "True"); - SHARE_ADD_STRING(SHARE_BROWSEABLE, "True"); - SHARE_ADD_STRING(SHARE_READONLY, "False"); + SHARE_ADD_STRING(SHARE_AVAILABLE, "true"); + SHARE_ADD_STRING(SHARE_BROWSEABLE, "true"); + SHARE_ADD_STRING(SHARE_READONLY, "false"); SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "unixuid"); SHARE_ADD_STRING(SHARE_NTVFS_HANDLER, "posix"); @@ -428,7 +429,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info struct ldb_message *msg; TALLOC_CTX *tmp_ctx; NTSTATUS ret; - bool do_rename = False; + bool do_rename = false; char *newname; int err, i; @@ -462,7 +463,7 @@ NTSTATUS sldb_set(struct share_context *ctx, const char *name, struct share_info for (i = 0; i < count; i++) { if (strcasecmp(info[i].name, SHARE_NAME) == 0) { if (strcasecmp(name, (char *)info[i].value) != 0) { - do_rename = True; + do_rename = true; newname = (char *)info[i].value; SHARE_MOD_STRING("cn", (char *)info[i].value); } @@ -568,22 +569,21 @@ done: return ret; } +static const struct share_ops ops = { + .name = "ldb", + .init = sldb_init, + .string_option = sldb_string_option, + .int_option = sldb_int_option, + .bool_option = sldb_bool_option, + .string_list_option = sldb_string_list_option, + .list_all = sldb_list_all, + .get_config = sldb_get_config, + .create = sldb_create, + .set = sldb_set, + .remove = sldb_remove +}; + NTSTATUS share_ldb_init(void) { - static struct share_ops ops = { - .name = "ldb", - .init = sldb_init, - .string_option = sldb_string_option, - .int_option = sldb_int_option, - .bool_option = sldb_bool_option, - .string_list_option = sldb_string_list_option, - .list_all = sldb_list_all, - .get_config = sldb_get_config, - .create = sldb_create, - .set = sldb_set, - .remove = sldb_remove - }; - return share_register(&ops); } - |