summaryrefslogtreecommitdiffstats
path: root/lib/param/loadparm.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/param/loadparm.c')
-rw-r--r--lib/param/loadparm.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 5a6b361d9e..636c41bd20 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -98,8 +98,6 @@ static bool defaults_saved = false;
/* prototypes for the special type handlers */
static bool handle_include(struct loadparm_context *lp_ctx, int unused,
const char *pszParmValue, char **ptr);
-static bool handle_realm(struct loadparm_context *lp_ctx, int unused,
- const char *pszParmValue, char **ptr);
static bool handle_copy(struct loadparm_context *lp_ctx, int unused,
const char *pszParmValue, char **ptr);
@@ -1063,16 +1061,32 @@ bool lpcfg_file_list_changed(struct loadparm_context *lp_ctx)
Handle the "realm" parameter
***************************************************************************/
-static bool handle_realm(struct loadparm_context *lp_ctx, int unused,
- const char *pszParmValue, char **ptr)
+bool handle_realm(struct loadparm_context *lp_ctx, int unused,
+ const char *pszParmValue, char **ptr)
{
- lpcfg_string_set(lp_ctx, ptr, pszParmValue);
+ char *upper;
+ char *lower;
+
+ upper = strupper_talloc(lp_ctx, pszParmValue);
+ if (upper == NULL) {
+ return false;
+ }
- talloc_free(lp_ctx->globals->realm);
- talloc_free(lp_ctx->globals->dnsdomain);
+ lower = strlower_talloc(lp_ctx, pszParmValue);
+ if (lower == NULL) {
+ TALLOC_FREE(upper);
+ return false;
+ }
- lp_ctx->globals->realm = strupper_talloc(lp_ctx, pszParmValue);
- lp_ctx->globals->dnsdomain = strlower_talloc(lp_ctx, pszParmValue);
+ if (lp_ctx->s3_fns != NULL) {
+ lp_ctx->s3_fns->lp_string_set(ptr, pszParmValue);
+ lp_ctx->s3_fns->lp_string_set(&lp_ctx->globals->realm, upper);
+ lp_ctx->s3_fns->lp_string_set(&lp_ctx->globals->dnsdomain, lower);
+ } else {
+ lpcfg_string_set(lp_ctx, ptr, pszParmValue);
+ lpcfg_string_set(lp_ctx, &lp_ctx->globals->realm, upper);
+ lpcfg_string_set(lp_ctx, &lp_ctx->globals->dnsdomain, lower);
+ }
return true;
}