Pysquashfsimage

Latest version: v0.9.0

Safety actively analyzes 619426 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.9.0

This version drops support for Python 2.6 and 3.0.

Breaking changes
- Remove previously deprecated methods
- Replace `SquashInode` and `SquashedFile` by one class per inode/file type with different attributes and methods
- Remove some `SquashFsImage` attributes: `fragment_buffer_size`, `data_buffer_size`, `block_size`, `block_log`, `all_buffers_size`, `inode_table`, `created_inode`, `total_blocks`, `total_files`, `total_inodes`, `directory_table` and `inode_to_file`. Some were or are now unused, others were simply shortcuts to attributes of the superblock
- Rename `SquashFsImage.sBlk` to `SquashFsImage.sblk` and make it a property
- Rename `SquashFsImage.image_file` to `SquashFsImage._fd`
- All remaining `SquashFsImage` attributes are made "private"
- Root directory's path is now a single slash
- Package layout changes
- Rename command line utility from `pysquashfsimage` to `pysquashfs`
- Change `SquashFsImage` constructor. The signature is now `SquashFsImage(fd, offset=0, closefd=True)`. Calls to `SquashFsImage("/path/to/file", offset=n)` must be replaced by `SquashFsImage.from_file("/path/to/file", offset=n)`
- Remove `SquashFsImage.set_file()`. Use the constructor instead

New API
The most notable changes are:
- Instead of being instances of `SquashedFile`, all files are now instances of a subclass of `File`
- `SquashFsImage` instances can be used as context managers
- Instances of `Directory` emulate a read-only mapping and have 2 new methods `riter()` and `find()`
- Instances of `RegularFile` have 3 methods `iter_bytes()`, `read_bytes()` and `read_text()`
- Iterating over an instance of `SquashFsImage` will yield all its files recursively as if using `root.riter()`

Other changes
- Add `SquashFsImage.from_bytes()`, `SquashFsImage.find()` and `SquashFsImage.select()`
- All file types are now "scanned", not just directories, regular files and symlinks
- All struct-based classes are now ctypes-based
- Add support for LZO compression
- Add support for holes
- Reading large files is a lot faster
- Add functions for image extraction (extended attributes not supported yet)
- Add LRU cache for Python 3.2+ which can greatly speed up file reads in certain conditions
- Add `SquashFsImage.size` property
- Add `find_superblocks()`
- Add support for calling `dict()` on structures (instances of `structure._Base`)
- New CLI with 3 subcommands

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.8.0...v0.9.0

0.8.0

- Formatting, dead code and quick fixes (20)
- Use `stat.filemode()` in `getMode()` when using Python 3 (20)
- All compressors are now a subclass of `_Compressor` (21)
- Use struct (21)
- File names and paths are now instances of `str` (22)
- Replace `fill` by the `from_bytes` class method (22)
- Use `argparse` for command line parsing (22)
- New `pysquashfsimage` command (22)
- Python 2 fixes (23)
- Decompressors fixes (23)
- Change internal classes names to comply with PEP 8 (23)

API changes
- Move towards an API similar to [pathlib](https://docs.python.org/3/library/pathlib.html)'s (#23)
- Add `is_{file,socket,fifo,block_device,char_device}` properties to `SquashedFile` and `SquashInode` (23)
- `SquashedFile.hasAttribute()` and `SquashInode.hasAttribute()` have been removed, use the `is_*` properties instead (23)
- `SquashInode.xattr` is now a property, `SquashInode.getXattr()` is deprecated (23)
- `SquashInode.getContent()` is deprecated, use `SquashInode.read_bytes()` instead (23)
- `SquashedFile.name` is now a property, `SquashedFile.getName()` is deprecated (23)
- `SquashedFile.xattr` is now a property, `SquashedFile.getXattr()` is deprecated (23)
- Add `SquashedFile.path` property, `SquashedFile.getPath()` is deprecated (23)
- Add `SquashedFile.size` property, `SquashedFile.getLength()` is deprecated (23)
- Add `SquashedFile.filemode` property, `SquashedFile.getMode()` is deprecated (23)
- `SquashedFile.findAll()` is deprecated, use `SquashedFile.find_all()` instead (23)
- `SquashedFile.findAllPaths()` is deprecated, use `SquashedFile.find_all_paths()` instead (23)
- `SquashedFile.getContent()` is deprecated, use `SquashedFile.read_bytes()` instead (23)
- `SquashedFile.isFolder()` is deprecated, use the `SquashedFile.is_dir` property instead (23)
- `SquashedFile.isLink()` is deprecated, use the `SquashedFile.is_symlink` property instead (23)
- `SquashedFile.getLink()` is deprecated, use `SquashedFile.readlink()` instead (23)
- `SquashFsImage.root` is now a property, `SquashFsImage.getRoot()` is deprecated (23)
- `SquashFsImage.setFile()` is deprecated, use `SquashFsImage.set_file()` instead (23)
- `SquashFsImage.getFileContent()` is deprecated, use `SquashFsImage.read_file()` instead (23)

The deprecated methods will be removed in a future version.

New Contributors
* AT0myks made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/20

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.7...v0.8.0

0.7

- Add support for LZ4 compression (9) by charles-dyfis-net
- Avoid calling `import` each time we call `uncompress()` (9) by charles-dyfis-net
- Only load decompressors when needed (9) by charles-dyfis-net
- Fix xattrs loading (8) by Dr-Emann
- Use `int.from_bytes()` with Python 3 (10) by nigels-com
- Add support for symlinks (11) by nigels-com
- Fix `select()` to work with Python 3 (12) by nigels-com
- Add `getMode()` to get an ls-style string for file type and permissions (12) by nigels-com
- Add reference links (13) by nigels-com
- Update `getMode()` to also show SUID and SGID (14) by nigels-com
- Fix processing of SQUASHFS_LREG_TYPE entries (15) by darktemplarbasealt
- Add `getXattr()` methods (17) by franksinankaya
- Add support for Zstandard compression (18) by shashank956
- Replace compressors list with dictionary (19) by shashank956

New Contributors
* charles-dyfis-net made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/9
* Dr-Emann made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/8
* nigels-com made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/10
* darktemplarbasealt made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/15
* franksinankaya made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/17
* shashank956 made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/18

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.6...v0.7

0.6

- Fix a few miscellaneous errors (6) by RoliSoft
- Various fixes for Python 2.7 and Python 3.x

Tested with Python 2.7 and Python 3.5.2.

New Contributors
* RoliSoft made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/6

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.5...v0.6

0.5

Allow file system to start at an offset (5) by BotoX.

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.4...v0.5

0.4

- Fix wrong implementation of `read_fragment_table` (4) by BotoX
- Add support for XZ compression (4) by BotoX

New Contributors
* BotoX made their first contribution in https://github.com/matteomattei/PySquashfsImage/pull/4

**Full Changelog**: https://github.com/matteomattei/PySquashfsImage/compare/v0.3...v0.4

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.