param: use a single handle_netbios_aliases function
authorGarming Sam <garming@catalyst.net.nz>
Sun, 23 Feb 2014 21:12:48 +0000 (10:12 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:16 +0000 (19:49 +0200)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/param/loadparm.c
source3/param/loadparm.c

index 71aab15a93ae10aa90d721b34f0ef6289ddbaec3..613b41facf494d916074028af9ea6e21951f3350 100644 (file)
@@ -80,7 +80,6 @@ static bool defaults_saved = false;
 /* these are parameter handlers which are not needed in the
  * non-source3 code
  */
-#define handle_netbios_aliases NULL
 #define handle_idmap_backend NULL
 #define handle_idmap_uid NULL
 #define handle_idmap_gid NULL
@@ -1297,6 +1296,18 @@ bool handle_ldap_debug_level(struct loadparm_context *lp_ctx, int snum, const ch
        return true;
 }
 
+bool handle_netbios_aliases(struct loadparm_context *lp_ctx, int snum, const char *pszParmValue, char **ptr)
+{
+       TALLOC_FREE(lp_ctx->globals->netbios_aliases);
+       lp_ctx->globals->netbios_aliases = (const char **)str_list_make_v3(lp_ctx->globals->ctx,
+                                                                          pszParmValue, NULL);
+
+       if (lp_ctx->s3_fns) {
+               return lp_ctx->s3_fns->set_netbios_aliases(lp_ctx->globals->netbios_aliases);
+       }
+       return true;
+}
+
 /***************************************************************************
  Initialise a copymap.
 ***************************************************************************/
index ffec45bce9a64c36e06a23eba4d4e481dda57e2d..038124c309b57df33e9bf05e00ab879328456128 100644 (file)
@@ -264,7 +264,6 @@ static struct file_lists *file_lists = NULL;
 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 bool handle_netbios_aliases(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr );
 
 static void set_allowed_client_auth(void);
 
@@ -2409,13 +2408,6 @@ static void init_iconv(void)
                                                      true, global_iconv_handle);
 }
 
-static bool handle_netbios_aliases(struct loadparm_context *unused, int snum, const char *pszParmValue, char **ptr)
-{
-       TALLOC_FREE(Globals.netbios_aliases);
-       Globals.netbios_aliases = (const char **)str_list_make_v3(NULL, pszParmValue, NULL);
-       return set_netbios_aliases(Globals.netbios_aliases);
-}
-
 /***************************************************************************
  Handle the include operation.
 ***************************************************************************/