aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-16 21:42:00 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-16 22:47:59 +0200
commit74a064d9f15fa2d534e8b2d1ade68d10d5b65dfd (patch)
tree01e4847178600e2e034af4c4c88f49386078bb55 /lib/sqfs
parent14a925f6da442ecade7df75eb46a6edb9a1499af (diff)
Fix directory index creation
Digging around in kernel internals and mksquashfs reveals that it is actually a buffer offset into the raw directory buffer. The error hasn't been noted until now because of the bug fixed by a5428e0. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/write_dir.c2
-rw-r--r--lib/sqfs/write_inode.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfs/write_dir.c b/lib/sqfs/write_dir.c
index 9f8923b..909e0bb 100644
--- a/lib/sqfs/write_dir.c
+++ b/lib/sqfs/write_dir.c
@@ -99,7 +99,7 @@ int meta_writer_write_dir(meta_writer_t *dm, dir_info_t *dir,
i = (*index)->num_nodes++;
(*index)->idx_nodes[i].node = c;
(*index)->idx_nodes[i].block = block;
- (*index)->idx_nodes[i].offset = offset;
+ (*index)->idx_nodes[i].index = dir->size;
hdr.count = htole32(count - 1);
hdr.start_block = htole32(c->inode_ref >> 16);
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 611b0e1..a013d6f 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -101,7 +101,7 @@ static int write_dir_index(dir_index_t *diridx, meta_writer_t *im)
for (i = 0; i < diridx->num_nodes; ++i) {
idx.start_block = htole32(diridx->idx_nodes[i].block);
- idx.index = htole32(diridx->idx_nodes[i].offset);
+ idx.index = htole32(diridx->idx_nodes[i].index);
idx.size = strlen(diridx->idx_nodes[i].node->name) - 1;
idx.size = htole32(idx.size);