[Bug 1112357] New: libzypp does not relay on %_dbpath for rpmdb initialization
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357 Bug ID: 1112357 Summary: libzypp does not relay on %_dbpath for rpmdb initialization Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.0 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: libzypp Assignee: zypp-maintainers@forge.provo.novell.com Reporter: dcassany@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- I noticed in some situations libzypp makes use of a hardcoded rpmdb path ('/var/lib/rpm'). Currently '/var/lib/rpm' is a symlink to '/usr/lib/sysimage/rpm' provided by rpm package, so it nearly most cases it already does the trick. However in bootstrap procedures there might not be any '<root>/var/lib/rpm' symlink yet and the rpmdb gets initialized in '<root>/var/lib/rpm' without checking if this matches %_dbpath and if it was already initialized. We face this issue in KIWI when trying to build an image with signed packages and repositories. KIWI, in order to make use of user provided keys, uses rpm to import them here arises the inconsistency. KIWI does something similar to: rpm --root <root> --import <key> # rpm database initialized in '<root>%{_dbpath}' zypper --non-interactive --root <root> install <bootstrap packages> # checks for the rpm database in '<root>/var/lib/rpm' and initializes a new one Install fails due to untrusted keys. Surfing libzypp code I noticed that 'librpmDb::globalInit()' properly reads rpm macros, however the loaded %_dbpath value is not used. Specifically 'RpmDb::initDatabase' always assumes '/var/lib/rpm' if no dbpath is provided, however I think it should check for %_dbpath value before assuming anything. Currently in this method there is: if ( dbPath_r.empty() ) dbPath_r = "/var/lib/rpm"; but what about something like: if ( dbPath_r.empty() ) dbPath_r = librpmDb::expand("%{_dbpath}"); It could also leave '/var/lib/rpm' as a fallback if no %_dbpath is set. Probably this deserves another bugzilla issue, but I also noticed libsolv always assumes the rpmdb to be present at '/var/lib/rpm'. But preferred not to open and issue without discussing this one first. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357#c1
Benjamin Zeller
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357#c2
--- Comment #2 from Michael Andres
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357
http://bugzilla.opensuse.org/show_bug.cgi?id=1112357#c3
David Cassany
participants (1)
-
bugzilla_noreply@novell.com