Bug 1766487 - libguestfs assumes rpmdb is in Berkeley DB format
Summary: libguestfs assumes rpmdb is in Berkeley DB format
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libguestfs
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1766120 1935181
TreeView+ depends on / blocked
 
Reported: 2019-10-29 09:16 UTC by Panu Matilainen
Modified: 2021-03-26 16:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-26 16:12:32 UTC
Type: Bug


Attachments (Terms of Use)

Description Panu Matilainen 2019-10-29 09:16:50 UTC
libguestfs (as of 1.41.5) assumes the rpmdb is in Berkeley DB format - it looks for particular filenames and then uses db_dump to process those. This assumption is not valid since rpm >= 4.13, as rpm supports multiple different database backends.

The only legitimate way to access the rpmdb is through librpm API.

Comment 1 Richard W.M. Jones 2019-11-11 10:11:12 UTC
I guess we might put librpm into the appliance.  (Actually it turns out the
rpm-libs is already in the appliance - I'm not sure what is pulling it in).
But can librpm be pointed to an RPM db in a subdirectory / mountpoint?

Comment 2 Panu Matilainen 2019-11-11 12:11:04 UTC
Sure, librpm simply uses %{_dbpath} macro to locate the database, there's even a cli shortcut for changing it (--dbpath /some/place)

Comment 3 Richard W.M. Jones 2019-11-11 12:28:57 UTC
I mean is this settable from the librpm API?  Anyway I guess this topic needs
investigation.

Comment 4 Panu Matilainen 2019-11-11 12:49:30 UTC
Oh, of course it is. rpm cli is just any other librpm user really.

Macros can be defined and undefined from the API, see rpmPushMacro()/rpmPopMacro()

Comment 5 Ben Cotton 2020-02-11 17:46:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 6 Richard W.M. Jones 2021-03-26 16:12:32 UTC
Fixed in libguestfs 1.45.3.


Note You need to log in before you can comment on or make changes to this bug.