forked from rpm-software-management/rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't run plugins on src.rpm unpacking (RhBug:2316785)
Source packages aren't really "installed", just unpacked, and plugins operate on real transactions by design, so disable all hooks for those. This fixes, in particular, src.rpm installations done by a regular user (a fairly common case) on systems equipped with a plugin that needs root privileges (e.g. the ima plugin), which would otherwise cause a spurious warning or even failure (see RhBug:2316785). Do this by setting RPMTRANS_FLAG_NOPLUGINS for the duration of source unpacking. This ensures that ts->plugins, if not populated yet, will remain empty during rpmInstallSource() (rpmtsSetupTransactionPlugins() bails out if the flag is present). However, if any binary packages are among the rpmInstall() arguments, ts->plugins will have been populated by the time rpmInstallSource() is called, so we need to check for the flag in the hooks themselves, too, and prevent them from running if it's present. Reuse the plugin development test, we don't have anything better at the moment and it does the job well.
- Loading branch information
Showing
3 changed files
with
35 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters