[Rpm-maint] [rpm-software-management/rpm] RPM DB query creates DB directory and files (Issue #2572)
Shreenidhi Shedi
notifications at github.com
Wed Jul 12 16:56:37 UTC 2023
If a query is run specifying a non existent dbpath, rpm implictly creates a db directory and db files at the specified location.
For example:
```
mkdir t
cd t
rpm -q rpm --dbpath $PWD/t
```
The above commands result in:
```
root at ph5dev:~ # mkdir t
mkdir: created directory 't'
root at ph5dev:~ # cd t
/root/t
root at ph5dev:~/t # rpm -q rpm --dbpath $PWD/t
package rpm is not installed
root at ph5dev:~/t # ls
t
root at ph5dev:~/t # ls t
rpmdb.sqlite rpmdb.sqlite-shm rpmdb.sqlite-wal
root at ph5dev:~/t # realpath t/*
/root/t/t/rpmdb.sqlite
/root/t/t/rpmdb.sqlite-shm
/root/t/t/rpmdb.sqlite-wal
```
And:
```
rpm -q rpm --dbpath /tmp
```
The above command creates sqlite.* files under /tmp
RPM Version:
```
root at ph5dev:~ # rpm --version
RPM version 4.18.0
```
Is this a feature or an intended behavior?
IMO, query commands should query the db and error out if the directory doesn't exist or DB doesn't exist inside the specified directory with a proper error message. Thanks.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2572
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/2572 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20230712/dfd4d256/attachment.html>
More information about the Rpm-maint
mailing list