Opened 14 months ago

Last modified 14 months ago

#24919 new defect

uci config enumeration flaw

Reported by: bolvan Owned by: developers
Priority: normal Milestone:
Component: packages Version: Trunk
Keywords: uci Cc:


Original visible issue is seeing always "Changes: 0" in LUCI UI.

I traced the reason to
(file.c) uci_list_config_files enumerates all files in /etc/config including directories
if directory is found then get_filename returns null
configs[i] remains unset and in most cases contain NULL
all parts of code that use config enumeration stop on first NULL
If a directory exist in /etc/config then all fails

	char **configs = NULL;
	char **p;
	if ((uci_list_configs(ctx, &configs) != UCI_OK) || !configs) {
		goto out;

	for (p = configs; *p; p++) {
		package_cmd(cmd, *p);

Someone need to correct behavior to stop enumerating dirs inside /etc/config

Attachments (0)

Change History (2)

comment:1 Changed 14 months ago by bolvan

This patch to file.c fixes the problem

<       int size, i;
>       int size, i, j;
<       for(i = 0; i < globbuf.gl_pathc; i++) {
>       for(i = 0, j = 0; i < globbuf.gl_pathc; i++) {
<               configs[i] = buf;
>               configs[j++] = buf;

comment:2 Changed 14 months ago by bolvan

LEDE already fixed this

Add Comment

Modify Ticket

as new .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.