Debian Patches

Status for mtd-utils/1:2.3.1-3

Patch Description Author Forwarded Bugs Origin Last update
fix-sign-extension-of-ioctl-request.diff lib: libmtd: fix sign extension of ioctl request in mtd_xlock
The req parameter of mtd_xlock() was declared as int. On 64-bit
big-endian architectures such as ppc64el, _IOW()-derived ioctl numbers
have bit 31 set (because _IOC_WRITE=4 is placed at bit 29). Storing
such a value in a signed int and then passing it to ioctl(), whose
second argument is unsigned long, causes implicit sign extension:
0x80084d05 becomes 0xffffffff80084d05, which does not match the
expected constant and fails the cmocka check_expected() assertion in
the unit tests for mtd_lock and mtd_unlock.

Fix by declaring req as unsigned long, matching the type used by the
ioctl() syscall interface.
Bastian Germann <bage@debian.org> invalid 2026-04-27
fix-syscall-mocks-on-32-bit-with-time64.diff unittests: fix syscall mocks on 32-bit with time64 glibc
On 32-bit systems (e.g. armhf), building with -D_FORTIFY_SOURCE=2,
-D_FILE_OFFSET_BITS=64, and -D_TIME_BITS=64 CFLAGS fails many tests.
These flags activate glibc symbol redirects that bypass the --wrap
linker interpositions used by the cmocka mocks:

- _FORTIFY_SOURCE=2 + _FILE_OFFSET_BITS=64: open(path, flags) -> open64()
- _FILE_OFFSET_BITS=64: lseek() -> lseek64()
- _TIME_BITS=64 (glibc >= 2.34): ioctl() -> __ioctl_time64()

Add --wrap entries for each redirected symbol and provide thin forwarders
that delegate to the primary __wrap_open / __wrap_lseek / __wrap_ioctl
functions via plain function calls. This ensures that __func__ inside
those functions resolves correctly for cmocka's expectation lookup.
Bastian Germann <bage@debian.org> invalid 2026-04-28
link-with-system-iniparser.diff Link with system iniparser Bastian Germann <bage@debian.org> not-needed 2020-12-16

All known versions for source package 'mtd-utils'

Links