On Mon, Apr 18, 2022 at 06:32:07PM +0200, Thomas Lange wrote: > >>>>> On Mon, 18 Apr 2022 16:16:18 +0300, Peter Pentchev <r...@ringlet.net> > >>>>> said: > > > > If you run sudo without the "set_home" option, thus making it preserve > > the HOME environment variable, rpm run as root with HOME set to > > /home/something will indeed do the wrong thing. > I have no set_home entry in /etc/sudoers and everything in > /etc/sudo.conf is commented out. > > Here's a test: > > As normal user > $ export HOME=/tmp/b > $ sudo rpm -qa > > This still creates /root/.rpmdb > and not > /tmp/b/.rpmdb
$ HOME=/tmp/b sudo rpm -q rpm; ls -a /tmp/b package rpm is not installed ls: cannot access '/tmp/b': No such file or directory $ HOME=/tmp/b sudo -E rpm -q rpm; ls -a /tmp/b package rpm is not installed . .. .rpmdb -- mail / xmpp / matrix: tzaf...@cohens.org.il