]> pilppa.com Git - uci.git/commitdiff
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 803e912b833f742961bebc3acdff0c797159b871..6cc2eae30cf06c6eda5a41750ae9233a58c5085b 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;