rpm -qf on a directory with the trailing / returns an error.
This is wrong behavior but not crippling:
[root@localhost mail]# rpm -qf /var/spool/mail/
*** db3 dbcursor->c_get rc -1 Invalid argument
error getting "" records from Basenames index
file /var/spool/mail/ is not owned by any package
[root@localhost mail]# rpm -qf /var/spool/mail
Solution -- if there is a training / chop it off a 'filename' before
running the query.
Fixed in rpm-4.0-0.47. BTW, the following will now work as well
rpm -qf .
Thanks for the report.
*** Bug 9668 has been marked as a duplicate of this bug. ***