1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-21 20:39:46 +01:00

fixup: squashfs limits number of dirents to 256

The kernel implementation BAILS if a directory header is followed by
more than a hard-coded maximum of entries (currently 256).

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-04-18 21:58:42 +02:00
parent 9402492c16
commit 75e169d06a
2 changed files with 4 additions and 0 deletions

View file

@ -41,6 +41,9 @@ static int write_dir(meta_writer_t *dm, node_t *node)
count += 1;
}
if (count > SQFS_MAX_DIR_ENT)
count = SQFS_MAX_DIR_ENT;
hdr.count = htole32(count - 1);
hdr.start_block = htole32(c->inode_ref >> 16);
hdr.inode_number = htole32(c->inode_num);

View file

@ -10,6 +10,7 @@
#define SQFS_META_BLOCK_SIZE 8192
#define SQFS_DEFAULT_BLOCK_SIZE 131072
#define SQFS_DEVBLK_SIZE 4096
#define SQFS_MAX_DIR_ENT 256
typedef struct {
uint32_t magic;