Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'history undo/redo/rollback' does not print superuser privileges error like 'install' does #2026

Open
oturpe opened this issue Jan 28, 2025 · 1 comment
Labels
good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors Priority: MEDIUM

Comments

@oturpe
Copy link

oturpe commented Jan 28, 2025

In I try to run dnf install as normal user, I get:

$ dnf upgrade
The requested operation requires superuser privileges. Please log in as a user with elevated rights, or use the "--assumeno" or "--downloadonly" options to run the command without modifying the system state.

That is fine. The same error is also printed for upgrade and remove subcommands. However, sub-subcommands of history similarly require superuser privileges, but do not have the same error. For instance:

$ dnf history undo 45
Updating and loading repositories:
Repositories loaded.
Package
Removing:
 ...
Removing unused dependencies:
 ...

Transaction Summary:
 Removing:          17 packages

After this operation, 36 MiB will be freed (install 0 B, remove 36 MiB).
Is this ok [y/N]: y
Running transaction
Failed to open lock file "/run/dnf/rpmtransaction.lock": (13) - Permission denied

Please add the warning, so it is more clear what went wrong.

@github-project-automation github-project-automation bot moved this to Backlog in DNF team Feb 7, 2025
@jan-kolarik jan-kolarik added this to the Fedora 42 milestone Feb 7, 2025
@jan-kolarik jan-kolarik added Priority: MEDIUM good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors labels Feb 7, 2025
@jan-kolarik jan-kolarik removed this from the Fedora 42 milestone Feb 7, 2025
@kontura
Copy link
Contributor

kontura commented Feb 10, 2025

The issue is also valid for other history commands that perform a transaction (undo,, redo and rollback).

The issue happens due to the way we determine which commands require privileges in cmd_requires_privileges().
We could either add them to the hard coded list of commands or we could add the --store argument to each one.

Personally I would prefer to add the --store argument so that dnf5 can consistently store any transaction.

@kontura kontura changed the title 'history undo' does not print superuser privileges error like 'install' does 'history undo/redo/rollback' does not print superuser privileges error like 'install' does Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors Priority: MEDIUM
Projects
Status: Backlog
Development

No branches or pull requests

3 participants