lib/param: use strwicmp instead of strlower_talloc
authorGarming Sam <garming@catalyst.net.nz>
Tue, 25 Feb 2014 02:47:02 +0000 (15:47 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 17:49:17 +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

index 26860515c8e5d12067955e889100e898596beccd..b6f1f85a6ec85f36e64d43b77b8c44e74387017d 100644 (file)
@@ -244,7 +244,6 @@ const char *lpcfg_get_parametric(struct loadparm_context *lp_ctx,
                              struct loadparm_service *service,
                              const char *type, const char *option)
 {
-       char *vfskey_tmp = NULL;
        char *vfskey = NULL;
        struct parmlist_entry *data;
 
@@ -257,13 +256,14 @@ const char *lpcfg_get_parametric(struct loadparm_context *lp_ctx,
 
        data = (service == NULL ? lp_ctx->globals->param_opt : service->param_opt);
 
-       vfskey_tmp = talloc_asprintf(NULL, "%s:%s", type, option);
-       if (vfskey_tmp == NULL) return NULL;
-       vfskey = strlower_talloc(NULL, vfskey_tmp);
-       talloc_free(vfskey_tmp);
+       vfskey = talloc_asprintf(NULL, "%s:%s", type, option);
+       if (vfskey == NULL) {
+               DEBUG(0,("asprintf failed!\n"));
+               return NULL;
+       }
 
        while (data) {
-               if (strcmp(data->key, vfskey) == 0) {
+               if (strwicmp(data->key, vfskey) == 0) {
                        talloc_free(vfskey);
                        return data->value;
                }
@@ -275,7 +275,7 @@ const char *lpcfg_get_parametric(struct loadparm_context *lp_ctx,
                /* but only if we are not already working with globals */
                for (data = lp_ctx->globals->param_opt; data;
                     data = data->next) {
-                       if (strcmp(data->key, vfskey) == 0) {
+                       if (strwicmp(data->key, vfskey) == 0) {
                                talloc_free(vfskey);
                                return data->value;
                        }