summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2024-04-01 23:20:38 -0400
committerWilliam Wilgus <me.theuser@yahoo.com>2024-04-02 19:58:12 -0400
commit4a91d376134c918c92348e56d7f5bcb092ba4117 (patch)
tree46469a362d0971592df131d1e98a45e6697842a7
parent15fdaa3abc62c327c1fa2117dbf2572852edc4e6 (diff)
downloadrockbox-4a91d37613.tar.gz
rockbox-4a91d37613.zip
multiboot_select plugin check volume root for valid firmware
Change-Id: I5feb4b00ae385ff8967de27682d4e4a528dc2ae5
-rw-r--r--apps/plugins/multiboot_select.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/multiboot_select.c b/apps/plugins/multiboot_select.c
index 63babbb2c1..993a47c0e4 100644
--- a/apps/plugins/multiboot_select.c
+++ b/apps/plugins/multiboot_select.c
@@ -155,14 +155,17 @@ static int find_roots(void)
struct dirent* ent;
while((ent = rb->readdir(dir))) {
+ const char *dname = ent->d_name;
+ if (*dname == '.' && *(dname + 1) == '\0')
+ dname++; /* skip the dot so we can check root of volume */
int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s",
- vol, ent->d_name, bootdir, BOOTFILE);
+ vol, dname, bootdir, BOOTFILE);
if(r < 0 || (size_t)r >= sizeof(tmpbuf))
continue;
if(check_firmware(tmpbuf)) {
rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s",
- vol, ent->d_name);
+ vol, dname);
nroots += 1;
/* quit if we hit the maximum */