Skip to content

Commit

Permalink
Skip . and .. in root_iterate_callback()
Browse files Browse the repository at this point in the history
This avoids causing problems for other code.
  • Loading branch information
DemiMarie committed Jan 10, 2022
1 parent 42f8932 commit 3b134b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion genfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ static int root_iterate_callback(ext2_ino_t dir __attribute__((unused)),
int const name_len = ext2fs_dirent_name_len(dirent);
errcode_t err;
const char *label = label_modules_object;
if (!strncmp(dirent->name, "firmware", (size_t)name_len)) {
assert(name_len >= 0);
if ((name_len == 1 && dirent->name[0] == '.') ||
(name_len == 2 && dirent->name[0] == '.' && dirent->name[1] == '.')) {
return 0;
} else if (!strncmp(dirent->name, "firmware", (size_t)name_len)) {
struct qubes_genfs_data relabel_data = {
.fs = data->fs,
.uname_or_label = label = label_lib,
Expand Down

0 comments on commit 3b134b7

Please sign in to comment.