Bug 2217842

Summary: dnf install proceeds without sudo
Product: [Fedora] Fedora Reporter: Jens Petersen <petersen>
Component: dnf5Assignee: rpm-software-management
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: unspecified    
Version: 39CC: jkolarik, nsella, pkratoch, rpm-software-management
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jens Petersen 2023-06-27 08:57:20 UTC
If I run `dnf install ...` as a user without sudo,
dnf5 goes ahead but then fails because of permissions.

Reproducible: Always

Steps to Reproduce:
$ dnf install somepkg
Actual Results:  
:
Repositories loaded.
Package                 Arch   Version                 Repository           Size
Installing:                                                                     
 dnf-repo               x86_64 0.5.4-1.fc39            copr:copr.fedor  32.7 MiB

Transaction Summary:
 Installing:        1 packages

Total size of inbound packages is 5 MiB. Need to download 5 MiB.
After this operation 33 MiB will be used (install 33 MiB, remove 0 B).
Is this ok [y/N]: y
[1/1] dnf-repo-0:0.5.4-1.fc39.x86_64    100% |   1.9 MiB/s |   5.1 MiB |  00m03s
--------------------------------------------------------------------------------
[1/1] Total                             100% |   1.9 MiB/s |   5.1 MiB |  00m03s
Verifying PGP signatures

Running transaction
Failed to open lock file "/run/dnf/rpmtransaction.lock": (13) - Permission denied

Expected Results:  
dnf should refuse to attempt install if the instantiation does not have sufficient privilege.

Is there an existing upstream ticket?

Comment 1 Fedora Release Engineering 2023-08-16 08:11:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.