diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-12 16:03:11 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-14 15:06:45 +1000 |
commit | 0e4a4c8b19c9962fc8cbdb407ccd7e9a3e7bc536 (patch) | |
tree | 5a0eae5ff1a8dd55d2d12ccace8b6458b1b9c630 /source4/param | |
parent | 07f14aa3a7431ee1bd2994db84e32afddcaaf8dd (diff) | |
download | samba-0e4a4c8b19c9962fc8cbdb407ccd7e9a3e7bc536.tar.gz samba-0e4a4c8b19c9962fc8cbdb407ccd7e9a3e7bc536.tar.bz2 samba-0e4a4c8b19c9962fc8cbdb407ccd7e9a3e7bc536.zip |
s4-param finish services hooks for s4->s3 loadparm context
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/loadparm.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c index 18e2df1c70..b18f8fc429 100644 --- a/source4/param/loadparm.c +++ b/source4/param/loadparm.c @@ -1311,6 +1311,9 @@ struct loadparm_context { struct loadparm_service *lpcfg_default_service(struct loadparm_context *lp_ctx) { + if (lp_ctx->s3_fns) { + return lp_ctx->s3_fns->get_default_loadparm_service(); + } return lp_ctx->sDefault; } @@ -1428,6 +1431,9 @@ static struct loadparm_context *global_loadparm_context; return lp_ctx->globals->var_name; \ } +/* Local parameters don't need the ->s3_fns because the struct + * loadparm_service is shared and lpcfg_service() checks the ->s3_fns + * hook */ #define FN_LOCAL_STRING(fn_name,val) \ _PUBLIC_ const char *lpcfg_ ## fn_name(struct loadparm_service *service, \ struct loadparm_service *sDefault) { \ @@ -2079,6 +2085,10 @@ static struct loadparm_service *getservicebyname(struct loadparm_context *lp_ctx { int iService; + if (lp_ctx->s3_fns) { + return lp_ctx->s3_fns->get_service(pszServiceName); + } + for (iService = lp_ctx->iNumServices - 1; iService >= 0; iService--) if (lp_ctx->services[iService] != NULL && strwicmp(lp_ctx->services[iService]->szService, pszServiceName) == 0) { @@ -2724,9 +2734,15 @@ bool lpcfg_do_global_parameter_var(struct loadparm_context *lp_ctx, bool lpcfg_set_cmdline(struct loadparm_context *lp_ctx, const char *pszParmName, const char *pszParmValue) { - int parmnum = map_parameter(pszParmName); + int parmnum; int i; + if (lp_ctx->s3_fns) { + return lp_ctx->s3_fns->set_cmdline(pszParmName, pszParmValue); + } + + parmnum = map_parameter(pszParmName); + while (isspace((unsigned char)*pszParmValue)) pszParmValue++; @@ -3544,6 +3560,10 @@ bool lpcfg_load(struct loadparm_context *lp_ctx, const char *filename) int lpcfg_numservices(struct loadparm_context *lp_ctx) { + if (lp_ctx->s3_fns) { + return lp_ctx->s3_fns->get_numservices(); + } + return lp_ctx->iNumServices; } @@ -3579,8 +3599,12 @@ void lpcfg_dump_one(FILE *f, bool show_defaults, struct loadparm_service *servic } struct loadparm_service *lpcfg_servicebynum(struct loadparm_context *lp_ctx, - int snum) + int snum) { + if (lp_ctx->s3_fns) { + return lp_ctx->s3_fns->get_servicebynum(snum); + } + return lp_ctx->services[snum]; } |