Bug 253352

Summary: package-cleanup can't be run as non-root
Product: [Fedora] Fedora Reporter: Ralf Corsepius <rc040203>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.1.8-1.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-26 18:46:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ralf Corsepius 2007-08-18 04:47:47 UTC
Description of problem:

package-cleanup can't be run as ordinary (non-root) user:

# package-cleanup --orphans
Setting up yum
Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 402, in <module>
    main()
  File "/usr/bin/package-cleanup", line 365, in main
    my = initYum(opts)
  File "/usr/bin/package-cleanup", line 49, in initYum
    my.doSackSetup()
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 356, in doSackSetup
    return self._getSacks(archlist=archlist, thisrepo=thisrepo)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 382, in _getSacks
    self.repos.populateSack(which=repos)
  File "/usr/lib/python2.5/site-packages/yum/repos.py", line 206, in populateSack
    sack.populate(repo, mdtype, callback, cacheonly)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 141, in populate
    if self._check_db_version(repo, mydbtype):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 198, in
_check_db_version
    if repo.repoXML.repoData.has_key(mdtype):
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 684, in <lambda>
    repoXML = property(fget=lambda self: self._getRepoXML(),
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 678, in _getRepoXML
    self._loadRepoXML(text=self)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 661, in _loadRepoXML
    cache=self.http_caching == 'all')
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 565, in _getFile
    http_headers=headers,
  File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 411, in urlgrab
    return self._mirror_try(func, url, kw)
  File "/usr/lib/python2.5/site-packages/urlgrabber/mirror.py", line 397, in
_mirror_try
    return func_ref( *(fullurl,), **kwargs )
  File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 927, in
urlgrab
    return self._retry(opts, retryfunc, url, filename)
  File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 845, in _retry
    r = apply(func, (opts,) + args, {})
  File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 915, in
retryfunc
    fo._do_grab()
  File "/usr/lib/python2.5/site-packages/urlgrabber/grabber.py", line 1196, in
_do_grab
    else: new_fo = open(self.filename, 'wb')
IOError: [Errno 13] Permission denied: '//var/cache/yum/fedora/repomd.xml'

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. login as normal user
2. run 
package-cleanup --orphans
  
Actual results:
a traceback, c.f. above.

Expected results:
I don't understand why checking the package status on a system should require
write access to repomd.xml.

Comment 1 Ralf Corsepius 2007-08-18 04:50:04 UTC
Oops, forgot the version:

# rpm -qf /usr/bin/package-cleanup 
yum-utils-1.1.6-1.fc7


Comment 2 Tim Lauridsen 2007-09-28 12:45:59 UTC
fixed upstream, will be available in yum-utils-1.1.8

Comment 3 Fedora Update System 2007-10-24 07:03:52 UTC
yum-utils-1.1.8-1.fc7 has been pushed to the Fedora 7 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update yum-utils'

Comment 4 Fedora Update System 2007-11-26 18:46:18 UTC
yum-utils-1.1.8-1.fc7 has been pushed to the Fedora 7 stable repository.  If problems still persist, please make note of it in this bug report.