allow more types of characters for uci package names
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2008 17:02:56 +0000 (19:02 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 May 2008 17:02:56 +0000 (19:02 +0200)
file.c
util.c

diff --git a/file.c b/file.c
index 13fdd3b..5ec0032 100644 (file)
--- a/file.c
+++ b/file.c
@@ -309,7 +309,7 @@ int uci_import(struct uci_context *ctx, FILE *stream, const char *name, struct u
         * NB: the config file can still override the package name
         */
        if (name) {
-               UCI_ASSERT(ctx, uci_validate_name(name));
+               UCI_ASSERT(ctx, uci_validate_str(name, false));
                pctx->name = name;
        }
 
@@ -350,7 +350,7 @@ static char *uci_config_path(struct uci_context *ctx, const char *name)
 {
        char *filename;
 
-       UCI_ASSERT(ctx, uci_validate_name(name));
+       UCI_ASSERT(ctx, uci_validate_str(name, false));
        filename = uci_malloc(ctx, strlen(name) + strlen(ctx->confdir) + 2);
        sprintf(filename, "%s/%s", ctx->confdir, name);
 
diff --git a/util.c b/util.c
index a85ec9b..8542359 100644 (file)
--- a/util.c
+++ b/util.c
@@ -120,7 +120,7 @@ int uci_parse_tuple(struct uci_context *ctx, char *str, char **package, char **s
        }
 
        *package = strsep(&str, ".");
-       if (!*package || !uci_validate_name(*package))
+       if (!*package || !uci_validate_str(*package, false))
                goto error;
 
        *section = strsep(&str, ".");