diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-18 23:38:13 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-19 13:38:13 +0200 |
commit | b94825c4d4371477a3a62cab42038d2a436897c9 (patch) | |
tree | 96c37c4ea2792dc167bebfaadfbce6fa23e360eb /lib/sqfs/src | |
parent | 6a5d2dc7795029acf38862ecaefebc4015400045 (diff) |
libsqfs: Make sure directory iterators always set the size for links
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/src')
-rw-r--r-- | lib/sqfs/src/io/dir_hl.c | 1 | ||||
-rw-r--r-- | lib/sqfs/src/io/dir_unix.c | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/sqfs/src/io/dir_hl.c b/lib/sqfs/src/io/dir_hl.c index 08efaaf..b693a49 100644 --- a/lib/sqfs/src/io/dir_hl.c +++ b/lib/sqfs/src/io/dir_hl.c @@ -134,6 +134,7 @@ static int next(sqfs_dir_iterator_t *base, sqfs_dir_entry_t **out) *out = NULL; } } else { + (*out)->size = strlen(it->link_target); (*out)->mode = SQFS_INODE_MODE_LNK | 0777; (*out)->flags |= SQFS_DIR_ENTRY_FLAG_HARD_LINK; } diff --git a/lib/sqfs/src/io/dir_unix.c b/lib/sqfs/src/io/dir_unix.c index efc9a2a..1cf7beb 100644 --- a/lib/sqfs/src/io/dir_unix.c +++ b/lib/sqfs/src/io/dir_unix.c @@ -115,9 +115,7 @@ static int dir_next(sqfs_dir_iterator_t *base, sqfs_dir_entry_t **out) (*out)->uid = it->sb.st_uid; (*out)->gid = it->sb.st_gid; (*out)->inode = it->sb.st_ino; - - if (S_ISREG(it->sb.st_mode)) - (*out)->size = it->sb.st_size; + (*out)->size = it->sb.st_size; if ((*out)->dev != it->device) (*out)->flags |= SQFS_DIR_ENTRY_FLAG_MOUNT_POINT; |