]> git.ipfire.org Git - thirdparty/systemd.git/commit
hwdb: strip the root from filenames when generating hwdb.bin 43062/head
authorRoss Burton <ross.burton@arm.com>
Fri, 17 Jul 2026 16:25:31 +0000 (17:25 +0100)
committerRoss Burton <ross.burton@arm.com>
Mon, 20 Jul 2026 13:31:15 +0000 (14:31 +0100)
commitab9be70e94dad2166b4a5b2cf80f6f46ffc9e2c3
treecc46215d5e2b422413a4a7eb51f8310f97ca7c10
parentd024c58b8e9c0ddbed8e02604758b69ae3bd63a2
hwdb: strip the root from filenames when generating hwdb.bin

The modern hwdb.bin format contains the filenames of the input data that
makes up the database.  This is useful but in offline builds where
--root is used, the filenames are the full build paths including the
specified root.  This introduces build paths and thus information
leakage and non-reproducible data.

Solve this by stripping the root prefix off the original path when
passing to import_file.

Add TEST-17-UDEV.hwdb.sh to verify that hwdb.bin files contain the
path inside the root, but not the path of the root.
src/shared/hwdb-util.c
test/units/TEST-17-UDEV.hwdb.sh [new file with mode: 0755]