Bug 240326 - Cannot use yum as non-root
Cannot use yum as non-root
Status: CLOSED DUPLICATE of bug 222327
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum-rhn-plugin (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Clifford Perry
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-16 11:24 EDT by Jack Neely
Modified: 2007-12-10 15:02 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-12-10 13:43:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jack Neely 2007-05-16 11:24:20 EDT
Description of problem:
Yum has several features and modes of operation for non-root users.  However, as
Yum can't read the RHN configuration as non-root all of these operations fail
regarding any RHN channels. 

For example:
$ yum list 'tomcat5*'
Loading "installonlyn" plugin
Loading "fedorakmod" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up repositories
Reading repository metadata in from local files

Using root or sudo and yum lists out the tomcat5 packages from RHN as would be
expected.

Version-Release number of selected component (if applicable):
yum-rhn-plugin-0.4.3-1.el5
Comment 1 wdc 2007-08-10 13:56:34 EDT
This is going to be disorienting to users at MIT.

People are used to up2date NOT complaining of no RHN registration when run as non-root.
Comment 2 Red Hat Bugzilla 2007-10-25 20:52:12 EDT
User jslagle@redhat.com's account has been closed
Comment 3 wdc 2007-12-03 14:14:33 EST
Is there a status update on this problem?
A month has gone by.
Red Hat customers have been being bit by this problem.
Red Hat support has had to deal with customers being bit by this problem.

Is there a candidtate fix?

Is Red Hat content to look stupid for having dropped up2date and adopted yum?
Is this an easy thing to fix or a difficult thing to fix?
Has anyone even made that assessment yet?
Comment 4 Clifford Perry 2007-12-10 13:43:50 EST
Hi there, 
This is being marked as a dupe of bug 222327. 

Within bug 222327 - we have committed code into the yum-rhn-plugin, which should
unload/remove the plugin if yum is being run as a non-root user. 

This is being tracked for inclusion (pending QA) into the Beta and then final
versions of the Red Hat Enterprise Linux 5 - update 2 release. 

Cliff. 

bz#222327 if yum run as a non-root user notify the user RHN repo is not accessible

--- rhnplugin.py	2007-12-04 18:54:55 UTC (rev 134462)
+++ rhnplugin.py	2007-12-04 19:39:51 UTC (rev 134463)
@@ -51,6 +51,13 @@
    
     RHN_DISABLED = _("RHN support will be disabled.")
 
+    if not os.geteuid()==0:
+        # If non-root notify user RHN repo not accessible
+        conduit.error(0, _("*Note* Red Hat Network repositories are not listed
below. You must run this command as root to access RHN repositories.") + "\n" +
+        RHN_DISABLED)
+        rhn_enabled = False
+        return
+
     up2date_cfg = config.initUp2dateConfig()
     try:
         proxy_url = get_proxy_url(up2date_cfg)

*** This bug has been marked as a duplicate of 222327 ***
Comment 5 wdc 2007-12-10 15:02:50 EST
Thank you very much for the information.  That is EXTREMELY helpful in understanding the root cause of 
the problem, and in knowing when to expect a remedy.

Note You need to log in before you can comment on or make changes to this bug.