Bug 352911

Summary: yumdownloader does not handle not having write permisions to the destination directory
Product: [Fedora] Fedora Reporter: Russell Harrison <fedora>
Component: yum-utilsAssignee: Seth Vidal <skvidal>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 7CC: pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-25 18:28:38 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 Russell Harrison 2007-10-25 18:12:07 UTC
Description of problem:


Version-Release number of selected component (if applicable):
$ rpm -q yum-utils
yum-utils-1.1.7-1.fc7

How reproducible:
cd to a directory where the user does not have write permisions and attempt to
use yumdownloader to download an rpm to that directory

Steps to Reproduce:
$ /var/opt
$ yumdownloader --source wordpress
  
Actual results:
$ yumdownloader --source wordpress
Loading "fastestmirror" plugin
Loading "skip-broken" plugin
Loading "refresh-updatesd" plugin
Loading "fedorakmod" plugin
Loading "kernel-module" plugin
Loading "protectbase" plugin
Loading "priorities" plugin
Loading mirror speeds from cached hostfile
0 packages excluded due to repository protections
0 packages excluded due to repository priority protections
Enabling livna-source repository
0 packages excluded due to repository protections
0 packages excluded due to repository priority protections
Enabling fedora-source repository
0 packages excluded due to repository protections
0 packages excluded due to repository priority protections
Enabling updates-source repository
0 packages excluded due to repository protections
0 packages excluded due to repository priority protections
wordpress-2.2.3-0.fc7.src 100% |=========================|    0 B    00:00     
Traceback (most recent call last):
  File "/usr/bin/yumdownloader", line 215, in <module>
    util = YumDownloader()
  File "/usr/bin/yumdownloader", line 41, in __init__
    self.main()
  File "/usr/bin/yumdownloader", line 71, in main
    self.downloadPackages(opts)
  File "/usr/bin/yumdownloader", line 175, in downloadPackages
    path = repo.getPackage(download)
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 629, in getPackage
    cache=cache
  File "/usr/lib/python2.5/site-packages/yum/yumRepo.py", line 607, 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: u'./wordpress-2.2.3-0.fc7.src.rpm'

Expected results:

yumdownloader should output an error stating it does not have write permissions
to the destination directory, or something similar.

Additional Information:
Also filed the bug upstream in the yum bugzilla.  Bug 846
https://devel.linux.duke.edu/bugzilla/show_bug.cgi?id=846

Comment 1 Seth Vidal 2007-10-25 18:28:38 UTC
fixed in upstream


Comment 2 Fedora Update System 2007-12-07 21:30:30 UTC
yum-utils-1.1.9-1.fc8 has been pushed to the Fedora 8 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 3 Fedora Update System 2007-12-07 21:33:39 UTC
yum-utils-1.1.9-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-12-23 22:50:21 UTC
yum-utils-1.1.9-1.fc8 has been pushed to the Fedora 8 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 5 Fedora Update System 2007-12-23 22:51:05 UTC
yum-utils-1.1.9-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 6 Fedora Update System 2007-12-26 23:51:51 UTC
yum-utils-1.1.9-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.

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