[Rpm-maint] [rpm-software-management/rpm] _minimize_writes re-creating unmodified files (Issue #1881)

Ludwig Nussel notifications at github.com
Mon Jan 10 17:52:23 UTC 2022


openSUSE Tumbleweed with rpm 4.17.0 running with `%_minimize_wites 1`. I noticed that some package updates lead to inaccessible dbus services. Rpm intends to only touch unchanged files but ends up replacing them. Eg. (--force doesn't matter, happens on regular updates too)

```
linux:~ # rpm -Uvvh systemd-container-250+git20220110.bf732cf8c5-0.x86_64.rpm --force --fsmdebug 2>log
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:systemd-container-250+git20220110################################# [ 50%]
Cleaning up / removing...
   2:systemd-container-250+git20220110################################# [100%]
linux:~ # grep machine1.conf log
D: touch      100644  1 (   0,   0) 11253 /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
D:  fsmRename (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf, /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf-RPMDELETE) 
D:  fsmUnlink (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf-RPMDELETE) 
D: file /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf vanished unexpectedly
D: create     100644  1 (   0,   0) 11253 /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
D:   fsmOpen (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf [10]) 
D:  fsmUnpack (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf 11253 bytes [10]) 
D:  fsmChown (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf, 0, 0) 
D:  fsmChmod (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf, 00644) 
D:  fsmUtime (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf, 0x61af8a85) 
D: fsverity no signature for: path /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf dest /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
D: lsetfilecon: (/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf, system_u:object_r:usr_t:s0) 
D: skip       100644  1 (   0,   0) 11253 /usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
```

dbus notices that live and tries to parse the file I guess while rpm still works on it:
```
Jan 10 18:53:29 linux dbus-daemon[646]: dbus-daemon[646]: Encountered error 'Failed to open "/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf": Permission denied' while parsing '/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf'
Jan 10 18:53:29 linux dbus-daemon[646]: Encountered error 'Failed to open "/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf": Permission denied' while parsing '/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf'
```

After that access of the affected service is blocked.

I think it's a fallout of 13f70e3 which sets fp->suffx to NULL which means fsmVerify gets called here https://github.com/rpm-software-management/rpm/blob/ae3d2d234ae47ff85229d3fce97a266fa1aa5a61/lib/fsm.c#L947-L948
Contrary to it's name `fsmVerify()` actually renames and unlinks files :-)

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1881
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/1881 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220110/1655d6ef/attachment.html>


More information about the Rpm-maint mailing list