From: Michael Adam Date: Tue, 8 Mar 2011 06:15:36 +0000 (+0100) Subject: s3:loadparm: deprecate "idmap uid/gid/backend" and have them set "idmap config *... X-Git-Tag: ldb-1.1.0~620 X-Git-Url: http://git.samba.org/samba.git/?p=gd%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=ac8836e77f0f7a15bf52f1dc8860729d2693888f s3:loadparm: deprecate "idmap uid/gid/backend" and have them set "idmap config * : range/backend" --- diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index d0dd3464bab..1a8754918b8 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -699,6 +699,7 @@ static int default_server_announce; static bool handle_include( int snum, const char *pszParmValue, char **ptr); static bool handle_copy( int snum, const char *pszParmValue, char **ptr); static bool handle_netbios_name( int snum, const char *pszParmValue, char **ptr); +static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr); static bool handle_idmap_uid( int snum, const char *pszParmValue, char **ptr); static bool handle_idmap_gid( int snum, const char *pszParmValue, char **ptr); static bool handle_debug_list( int snum, const char *pszParmValue, char **ptr ); @@ -4547,9 +4548,9 @@ static struct parm_struct parm_table[] = { .type = P_STRING, .p_class = P_GLOBAL, .ptr = &Globals.szIdmapBackend, - .special = NULL, + .special = handle_idmap_backend, .enum_list = NULL, - .flags = FLAG_ADVANCED, + .flags = FLAG_ADVANCED | FLAG_DEPRECATED, }, { .label = "idmap cache time", @@ -4576,7 +4577,7 @@ static struct parm_struct parm_table[] = { .ptr = &Globals.szIdmapUID, .special = handle_idmap_uid, .enum_list = NULL, - .flags = FLAG_ADVANCED, + .flags = FLAG_ADVANCED | FLAG_DEPRECATED, }, { .label = "winbind uid", @@ -4594,7 +4595,7 @@ static struct parm_struct parm_table[] = { .ptr = &Globals.szIdmapGID, .special = handle_idmap_gid, .enum_list = NULL, - .flags = FLAG_ADVANCED, + .flags = FLAG_ADVANCED | FLAG_DEPRECATED, }, { .label = "winbind gid", @@ -7655,38 +7656,25 @@ bool lp_idmap_gid(gid_t *low, gid_t *high) return True; } -/* Do some simple checks on "idmap [ug]id" parameter values */ - -static bool handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) +static bool handle_idmap_backend(int snum, const char *pszParmValue, char **ptr) { - uint32 low, high; - - if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) - return False; + lp_do_parameter(snum, "idmap config * : backend", pszParmValue); - /* Parse OK */ + return true; +} - string_set(ptr, pszParmValue); +/* Do some simple checks on "idmap [ug]id" parameter values */ - idmap_uid_low = low; - idmap_uid_high = high; +static bool handle_idmap_uid(int snum, const char *pszParmValue, char **ptr) +{ + lp_do_parameter(snum, "idmap config * : range", pszParmValue); return True; } static bool handle_idmap_gid(int snum, const char *pszParmValue, char **ptr) { - uint32 low, high; - - if (sscanf(pszParmValue, "%u - %u", &low, &high) != 2 || high < low) - return False; - - /* Parse OK */ - - string_set(ptr, pszParmValue); - - idmap_gid_low = low; - idmap_gid_high = high; + lp_do_parameter(snum, "idmap config * : range", pszParmValue); return True; }