diff options
-rw-r--r-- | source3/include/proto.h | 2 | ||||
-rw-r--r-- | source3/param/loadparm.c | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index c097ab19d14..15ed176d11c 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -731,6 +731,8 @@ NTSTATUS trust_pw_change(struct netlogon_creds_cli_context *context, /* The following definitions come from param/loadparm.c */ +const struct loadparm_substitution *loadparm_s3_global_substitution(void); + #include "source3/param/param_proto.h" char *lp_servicename(TALLOC_CTX *ctx, int); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 9a1c6107520..15abf281dd7 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -53,6 +53,7 @@ * */ +#define LOADPARM_SUBSTITUTION_INTERNALS 1 #include "includes.h" #include "system/filesys.h" #include "util_tdb.h" @@ -991,7 +992,11 @@ static struct loadparm_context *setup_lp_context(TALLOC_CTX *mem_ctx) callers without affecting the source string. ********************************************************************/ -char *lp_string(TALLOC_CTX *mem_ctx, const char *s) +static char *loadparm_s3_global_substitution_fn( + TALLOC_CTX *mem_ctx, + const struct loadparm_substitution *lp_sub, + const char *s, + void *private_data) { char *ret; @@ -1023,6 +1028,20 @@ char *lp_string(TALLOC_CTX *mem_ctx, const char *s) return ret; } +static const struct loadparm_substitution s3_global_substitution = { + .substituted_string_fn = loadparm_s3_global_substitution_fn, +}; + +const struct loadparm_substitution *loadparm_s3_global_substitution(void) +{ + return &s3_global_substitution; +} + +char *lp_string(TALLOC_CTX *ctx, const char *s) +{ + return lpcfg_substituted_string(ctx, &s3_global_substitution, s); +} + /* In this section all the functions that are used to access the parameters from the rest of the program are defined |