Ticket #67 (assigned defect)

Opened 3 years ago

Last modified 2 years ago

Do not open database when querying package

Reported by: nijel Assigned to: pmatilai (accepted)
Priority: major Milestone:
Component: rpm Version: RPM Development
Keywords: Cc: michal@cihar.com

Description

When querying a package, rpm tries to open a database. However there is IMHO no need to have working database when querying file on disk. And rpm also gives the response, just also prints some errors.

$ rpm -qp --queryformat '%{VERSION}\n' ~/archivemail-0.6.1-3.ae.src.rpm error: cannot open Packages index using db3 - No such file or directory (2) error: cannot open Packages database in /var/lib/rpm warning: /home/joey/archivemail-0.6.1-3.ae.src.rpm: Header V3 DSA signature: NOKEY, key ID 4e6c9f5e 0.6.1

(Forwarded from Debian BTS - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=451441)

Change History

06/12/09 07:18:36 changed by pmatilai

  • status changed from new to assigned.

The reason why rpm opens the db even on query is that by default signature checking is done in all modes, and in order to check them rpm needs the gpg pubkeys which are currently stored in the rpmdb.

Various options here, in no particular order:

  • Setting "%_vsflags_query 0xc0c00" will disable signature checking on query. For rpm <= 4.4.2.x this'll avoid the warnings from non-existent rpmdb too. With >= 4.6.0 things are a bit different as rpm always preloads the keyring regardless of the signature checking mode ATM, the intent was moving the pubkeys out of the rpmdb but the change is not completed.. but easily fixed.
  • Change %_dbpath to a user-writable directory by default. Might make sense anyway as on Debian you dont want to be installing with rpm anyway... so something like "%_dbpath %(echo $HOME/.rpmdb)" would silence the warnings as rpm is able to automatically create an empty db there.
  • Have the rpm .deb installation do 'rpm --initdb' in post-install to ensure there's always at least an empty rpmdb

Leaving this open to track the "move pubkeys out of rpmdb" transition status.

06/17/09 12:30:28 changed by nijel

  • cc set to michal@cihar.com.

* This is not a solution for now, but once keys will be moved, rpmdb will not be needed for querying, right? * Polluting home directories with empty rpm databases does not sound like a good idea to me. * The database is not there to complicate installing rpm packages to system, what we do not want to allow. But it looks like only way to get rid of the warning.