update-smart-drivedb overwrites package installed file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
smartmontools (Debian) |
Fix Released
|
Unknown
|
|||
smartmontools (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
Bionic |
Won't Fix
|
Undecided
|
Unassigned | ||
Focal |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
[SRU]
[Impact]
The "drivedb.h" file is the smartmontools drive database file used to perform the scan actions. This file can be updated through update-
The fix applied here is picked up from upstream and it is present since version 7.2-1, therefore Ubuntu series starting at Impish and later are not affected. What this fix does is that it corrects the current shipping system of "drivedb.h" - the one in /usr belongs to the package and on install it copies it to /var/lib. Any subsequent updates with update-
If users have broken their file a --reinstall or upgrade of smartmontools will restore the packaged version, just as a manual copy from /usr/share/
[Test Plan]
This test plan is for Focal, but applies to Bionic in the same way.
0.Preparing the test environment:
#Preparing the container
lxc launch images:ubuntu/focal focal
lxc shell focal
apt update -y
apt upgrade -y
#Installing necessary tools
apt install -y smartmontools gpg debsums wget
0.1 Preparing scenario:
#At this point, debsums always gives all OK for the package:
root@focal:~# debsums smartmontools
/lib/systemd/
/usr/sbin/smartctl OK
/usr/sbin/smartd OK
/usr/sbin/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/usr/share/
/var/lib/
#Perform an update of the drivedb.h:
root@focal:~# update-
/var/lib/
1. Bad cases:
root@focal:~# debsums smartmontools | grep drivedb.h
/var/lib/
2. Good cases:
# special attention on the new location of the file
root@focal:~# debsums smartmontools | grep drivedb.h
/usr/share/
[Where problems could occur]
We initially thought that if the file or it gets corrupted (bad update by update-
[Other Info]
The fix applied here is picked up from upstream (https:/
[Original Report]
-------
The update-
/var/lib/
The smartctl(8) manpage says that
If /var/lib/
present, the contents of this file is used instead
of the built in table.
So I think we should:
1. Make sure the built-in table is up-to-date with drivedb.h. I suppose that file gets #included in the code when building, so this should be the case.
2. Stop installing /var/lib/
Changed in smartmontools (Debian): | |
status: | Unknown → Fix Released |
Changed in smartmontools (Ubuntu Bionic): | |
status: | New → Confirmed |
Changed in smartmontools (Ubuntu Focal): | |
status: | New → Confirmed |
tags: | added: bionic focal server-todo |
Changed in smartmontools (Ubuntu Bionic): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
Changed in smartmontools (Ubuntu Focal): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
Changed in smartmontools (Ubuntu): | |
assignee: | nobody → Miriam España Acebal (mirespace) |
Changed in smartmontools (Ubuntu Bionic): | |
status: | Confirmed → In Progress |
Changed in smartmontools (Ubuntu Focal): | |
status: | Confirmed → In Progress |
Changed in smartmontools (Ubuntu): | |
status: | New → In Progress |
description: | updated |
description: | updated |
tags: | removed: server-todo |
Fixed in Debian since version 7.2-1 (which is the version we have from Hirsute onwards)
The fix is here [1] and there is also an enhancement related to this here [2] (fixed) and [3].
[1] https:/ /salsa. debian. org/debian/ smartmontools/ -/commit/ 4c422299c8d46bb 46dbee7ba7717a6 77526faeea /www.smartmonto ols.org/ ticket/ 1424 /www.smartmonto ols.org/ ticket/ 1426
[2] https:/
[3] https:/