fix filename validation
authorFelix Fietkau <nbd@openwrt.org>
Sun, 3 Feb 2008 00:17:14 +0000 (01:17 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 3 Feb 2008 00:17:14 +0000 (01:17 +0100)
file.c

diff --git a/file.c b/file.c
index 803e912..6cc2eae 100644 (file)
--- a/file.c
+++ b/file.c
@@ -781,7 +781,6 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac
        FILE *file = NULL;
 
        UCI_HANDLE_ERR(ctx);
-       UCI_ASSERT(ctx, uci_validate_name(name));
 
        switch (name[0]) {
        case '.':
@@ -797,6 +796,7 @@ int uci_load(struct uci_context *ctx, const char *name, struct uci_package **pac
                break;
        default:
                /* config in /etc/config */
+               UCI_ASSERT(ctx, uci_validate_name(name));
                filename = uci_config_path(ctx, name);
                confdir = true;
                break;