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