Commit Graph

18 Commits

Author SHA1 Message Date
Pete Batard 2a6df95cad
[iso] fix persistence option not being added for Ubuntu 24.04
* Ubuntu changed their GRUB config format yet again, so our search for the kernel
  config no longer works, and the 'persistent' option doesn't get added.
* Switch to a more generic '/casper/vmlinuz' search, though it might have unintended
  consequences...
* Also fix a possible double free in FormatExtFs().
2024-04-28 13:56:18 +01:00
Pete Batard 8a5a5a318a
[misc] improve readability of error code handling
* Also don't pass a read size value in WriteFileWithRetry() if we don't use it.
2024-04-01 02:16:41 +01:00
Pete Batard 07d1fdcc2f
[cmp] update Bled to latest
* Also try to fix the fallthrough Coverity warning in format_ext.c
2022-09-14 23:37:46 +02:00
Pete Batard 2cf183e9f1
[misc] fix Y2K38 related Coverity warnings 2022-09-14 10:58:18 +02:00
Pete Batard 1dcfd69dee
[ext2fs] return a more explicit error on directory corruption 2022-05-14 10:19:36 +02:00
Pete Batard c28f9bc491
[misc] fix PVS-Studio warnings 2022-01-05 12:57:26 +01:00
Dimitri Papadopoulos d840083a32
[misc] fix typos found by codespell
* 3rd party software was left out.
* Most changes are in code comments, but one user-visible string has also been fixed.
* Closes #1817
2021-11-16 18:53:52 +00:00
Pete Batard 3056d54cc1
[ext2fs] update ext2fs to latest
* Also drop nt_io_manager() as a function call and just use a direct ref to the manager.
2021-01-09 16:15:01 +00:00
Pete Batard 460ab5dd73
[core] add log progress report when writing an image/zeroing a drive
* Also simplify a nonsensical condition in format_ext
2020-11-13 17:58:56 +00:00
Pete Batard f8c951f3d7
[ext2fs] don't override FormatStatus on user cancel 2020-11-09 23:44:23 +00:00
Pete Batard f04ed61805
[ext2fs] use physical + offset always for extfs partition creation 2020-09-10 17:50:06 +01:00
Pete Batard bcca9144b7
[misc] fix warnings reported by Cppcheck
* Closes #1520
2020-05-08 01:25:35 +01:00
Pete Batard 083b3db34c
[ext2fs] check for the maximum ext2/ext3 volume size
* Suggested by Marcos Mello
* Closes #1524
2020-04-28 18:34:45 +01:00
Pete Batard cf52f61b9c
[ext2fs] re-enable the sparse_super feature
* Closes #1516
* Also prevent protective message from being written in MBR mode
2020-04-21 10:29:16 +01:00
Tsarevich Dmitry 121257c584
[misc] fix PVS-Studio static analyzer warnings
* Surround macro params to ensure expected results
* Fix copy-paste errors
* Fix a potential buffer overflow in SetSectionHeaders()
* Add const modifier where relevant
* Use GetWindowLongPtr() everywhere
* Use proper sprintf format for unsigned int
* Use %s for printf-like funcs (https://www.viva64.com/en/w/v618/print/)
* Closes #1464
2020-02-28 17:08:11 +00:00
Pete Batard 67d324f82b
[extfs] fix inodes not being initialized above 4 GB
* So, as it happens, when assigning the product of two 32-bit variables into a 64-bit one,
  compilers default to being *DUMB* and, against all reasonable expectations, do not perform
  that multiplication as a 64-bit operation (even when the code is compiled as x64). Wow,
  that's really great decision making by compiler designers if I ever saw some... Whoever
  decided that C developers would much rather want truncation and 32-bit overflows, instead
  of the expected *LOGICAL* behaviour of conducting arithmetic operations as 64-bit when the
  result will be assigned to a 64-bit variable, need to be condemned to a lifetime of trying
  to help elderly folks trying to conduct simple computing tasks as a punishment...
  Anyhoo, nt_write_blk()'s offset.QuadPart = block * channel->block_size + nt_data->offset
  was overflowing 32-bit as soon as block * channel->block_size went over the 4 GB mark,
  with the disastrous results one can expect. Considering that this is code we practically
  lifted verbatim from e2fsprogs, I guess e2fsprogs' NT I/O manager was never properly
  tested with anything larger than a 4 GB. Awesome!
* We fix the above by doing what unix_io.c does and setting the 32-bit read/write_blk()
  calls to be wrappers around their 64-bit counterpart (since, once you deal with a 64-bit
  block variable, the computation is conducted as 64-bit).
* Also remove a bunch of stuff we don't need from config.h
* Closes #1396
2020-02-12 16:27:32 +00:00
Pete Batard 9edd7492db
[ext2fs] improve formatting speed
* Fix use of EXT2_BLOCK_SIZE() instead of EXT2_INODE_SIZE() during inode
  initialization, that made us zero way many more blocks than was needed.
* Also disable sparse_super feature and improve block setup.
* Also explicitly use IS_POWER_OF_2 macro where required.
2020-02-11 19:22:22 +00:00
Pete Batard 35af4cbacb
[misc] move Large FAT32 and ext formatting to their own source
* Also add randomization to test images
2020-02-10 13:04:50 +00:00