summaryrefslogtreecommitdiff
path: root/apps
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 /apps
parent15fdaa3abc62c327c1fa2117dbf2572852edc4e6 (diff)
downloadrockbox-4a91d376134c918c92348e56d7f5bcb092ba4117.tar.gz
rockbox-4a91d376134c918c92348e56d7f5bcb092ba4117.zip
multiboot_select plugin check volume root for valid firmware
Change-Id: I5feb4b00ae385ff8967de27682d4e4a528dc2ae5
Diffstat (limited to 'apps')
-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)
155 155
156 struct dirent* ent; 156 struct dirent* ent;
157 while((ent = rb->readdir(dir))) { 157 while((ent = rb->readdir(dir))) {
158 const char *dname = ent->d_name;
159 if (*dname == '.' && *(dname + 1) == '\0')
160 dname++; /* skip the dot so we can check root of volume */
158 int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s", 161 int r = rb->snprintf(tmpbuf, sizeof(tmpbuf), "/<%d>/%s/%s/%s",
159 vol, ent->d_name, bootdir, BOOTFILE); 162 vol, dname, bootdir, BOOTFILE);
160 if(r < 0 || (size_t)r >= sizeof(tmpbuf)) 163 if(r < 0 || (size_t)r >= sizeof(tmpbuf))
161 continue; 164 continue;
162 165
163 if(check_firmware(tmpbuf)) { 166 if(check_firmware(tmpbuf)) {
164 rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s", 167 rb->snprintf(roots[nroots], MAX_PATH, "/<%d>/%s",
165 vol, ent->d_name); 168 vol, dname);
166 nroots += 1; 169 nroots += 1;
167 170
168 /* quit if we hit the maximum */ 171 /* quit if we hit the maximum */