mirror of
https://github.com/samba-team/samba.git
synced 2025-02-03 13:47:25 +03:00
param: use a single special handler for idmap parameters
Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
84ed1853eb
commit
db19d74479
@ -77,13 +77,6 @@ static bool defaults_saved = false;
|
||||
|
||||
#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
|
||||
|
||||
/* these are parameter handlers which are not needed in the
|
||||
* non-source3 code
|
||||
*/
|
||||
#define handle_idmap_backend NULL
|
||||
#define handle_idmap_uid NULL
|
||||
#define handle_idmap_gid NULL
|
||||
|
||||
#ifndef N_
|
||||
#define N_(x) x
|
||||
#endif
|
||||
@ -1308,6 +1301,37 @@ bool handle_netbios_aliases(struct loadparm_context *lp_ctx, int snum, const cha
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* idmap related parameters
|
||||
*/
|
||||
|
||||
bool handle_idmap_backend(struct loadparm_context *lp_ctx, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
if (lp_ctx->s3_fns) {
|
||||
return lp_ctx->s3_fns->lp_do_parameter(snum, "idmap config * : backend", pszParmValue);
|
||||
}
|
||||
|
||||
return lpcfg_string_set(lp_ctx, ptr, pszParmValue);
|
||||
}
|
||||
|
||||
bool handle_idmap_uid(struct loadparm_context *lp_ctx, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
if (lp_ctx->s3_fns) {
|
||||
return lp_ctx->s3_fns->lp_do_parameter(snum, "idmap config * : range", pszParmValue);
|
||||
}
|
||||
|
||||
return lpcfg_string_set(lp_ctx, ptr, pszParmValue);
|
||||
}
|
||||
|
||||
bool handle_idmap_gid(struct loadparm_context *lp_ctx, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
if (lp_ctx->s3_fns) {
|
||||
return lp_ctx->s3_fns->lp_do_parameter(snum, "idmap config * : range", pszParmValue);
|
||||
}
|
||||
|
||||
return lpcfg_string_set(lp_ctx, ptr, pszParmValue);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
Initialise a copymap.
|
||||
***************************************************************************/
|
||||
|
@ -260,11 +260,6 @@ static struct file_lists *file_lists = NULL;
|
||||
|
||||
#define NUMPARAMETERS (sizeof(parm_table) / sizeof(struct parm_struct))
|
||||
|
||||
/* prototypes for the special type handlers */
|
||||
static bool handle_idmap_backend(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
|
||||
static bool handle_idmap_uid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
|
||||
static bool handle_idmap_gid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr);
|
||||
|
||||
static void set_allowed_client_auth(void);
|
||||
|
||||
static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values);
|
||||
@ -2466,31 +2461,6 @@ bool lp_include(struct loadparm_context *unused, int snum, const char *pszParmVa
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* idmap related parameters
|
||||
*/
|
||||
|
||||
static bool handle_idmap_backend(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
lp_do_parameter(snum, "idmap config * : backend", pszParmValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handle_idmap_uid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
lp_do_parameter(snum, "idmap config * : range", pszParmValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handle_idmap_gid(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
|
||||
{
|
||||
lp_do_parameter(snum, "idmap config * : range", pszParmValue);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool lp_idmap_range(const char *domain_name, uint32_t *low, uint32_t *high)
|
||||
{
|
||||
char *config_option = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user