Bug 830631
Summary: | [Patch] Disables yum-rhn-plugin a little bit safer in %post in client entitlement rpms' spec template | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Update Infrastructure for Cloud Providers | Reporter: | Satoru SATOH <ssato> | ||||
Component: | RHUA | Assignee: | John Matthews <jmatthew> | ||||
Status: | CLOSED ERRATA | QA Contact: | mkovacik | ||||
Severity: | unspecified | Docs Contact: | |||||
Priority: | high | ||||||
Version: | 2.0.3 | CC: | cbillett, ipanova, jmatthew, kbidarka, sclewis, sghai, tsanders, vkuznets, whayutin | ||||
Target Milestone: | --- | Keywords: | Triaged | ||||
Target Release: | 2.1.3 | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2013-12-17 20:08:48 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
The patch I posted may also 'fix' the following rpmlint warning and error, I guess: rhui-client-entitlement-rhui-2.0.noarch: W: dangerous-command-in-%post mv rhui-client-entitlement-rhui-2.0.noarch: E: use-tmp-in-%post I think this has been fixed at least in the rh-amazon-rhui-client. Fix can be pulled from there. Its not fixed in the general rhui code afaik. Applied patch http://axiom.lab.eng.rdu.redhat.com/git/gitweb.cgi?p=cloude/.git;a=commit;h=48ad3a19f2b1859f012165fddc46a119ced6a016 Hi guys, just noticed that using sed leads to the situation that the file date time will be anyway changed regardless it was modified or not. So every time when a client conf rpm will be installed, rhnplugin.conf will be changed even if no changes in fact have been made. And this could be a bit confusing. So maybe it will be better to use something like : grep -iP "enabled = (0|false|off)" rhnplugin.conf || sed ... RHEL-6.4-RHUI-2.1.3-20131118.1-Server-x86_64-DVD1.iso Verified, # rpm -q --scripts rhel5c1 postinstall scriptlet (using /bin/sh): if [ "$1" = "1" ]; then # 'install', not 'upgrade' # Disable RHN plugin if [ -f /etc/yum/pluginconf.d/rhnplugin.conf ]; then grep -iP "enabled = (0|false|off)" /etc/yum/pluginconf.d/rhnplugin.conf || sed -i.save -e 's/^enabled.*/enabled = 0/g' /etc/yum/pluginconf.d/rhnplugin.conf || : fi fi The small issue here is: 'grep -iP "enabled = (0|false|off)"' prints matching line to stdout, so during package install we can see: # rpm -i rhel5c1-2.0-1.noarch.rpm enabled = 0 I would suggest adding '-q' switch to this grep to avoid any output. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1854.html |
Created attachment 590810 [details] Disables yum-rhn-plugin a little bit safer in %post in client entitlement rpms' spec template Description of problem: Currently, client entitlement rpms disabling yum-rhn-plugin in its %post w/ using sed and mv combination anytime but it should become safer like the patch attached, IMHO. Version-Release number of selected component (if applicable): rh-rhui-tools-2.0.64-1.el6_2