Bug 758574

Summary: Permission denied error on 'yum search -C' by unprivileged user
Product: [Fedora] Fedora Reporter: Amit Shah <amit.shah>
Component: yum-langpacksAssignee: Bill Nottingham <notting>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: amit.shah, ffesti, i18n-bugs, james.antill, lonicerae, maxamillion, notting, petersen, pmatilai, rvokal, tla, zpavlas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: yum-langpacks-0.2.4-2.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-17 15:53:20 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
Use the already decompressed comps file. none

Description Amit Shah 2011-11-30 01:06:23 EST
Description of problem:


$ yum search -C jabber
Loaded plugins: langpacks, presto, refresh-packagekit


[Errno 13] Permission denied: '/var/cache/yum/x86_64/16/fedora/8e5f7c264cbd50659a18cd4f87fe75ea728fdc187d4e5e041898070c9dccf5e8-comps-f16.xml'

$ ls -l /var/cache/yum/x86_64/16/fedora/ -lZ

-rw-r--r--. root root unconfined_u:object_r:rpm_var_cache_t:s0 8e5f7c264cbd50659a18cd4f87fe75ea728fdc187d4e5e041898070c9dccf5e8-comps-f16.xml


'yum search' without the -C option works fine.  Also, this used to work on F15.  After the upgrade to F16, this stopped working.
Comment 1 Zdeněk Pavlas 2011-11-30 02:53:38 EST
*** Bug 749239 has been marked as a duplicate of this bug. ***
Comment 2 Amit Shah 2011-11-30 03:01:07 EST
(In reply to comment #1)
> *** Bug 749239 has been marked as a duplicate of this bug. ***

Doesn't look like 749239 is a dup of this one?
Comment 3 Zdeněk Pavlas 2011-11-30 06:31:24 EST
749239 is a bug in error handling of this bug, but really a separate issue.  Reopened that- sorry for the notification noise.
Comment 4 seth vidal 2011-11-30 13:05:59 EST
just don't use the -C option?

given how caching and user-local copies of the repodata have evolved -C is not very much needed
Comment 5 Amit Shah 2011-12-01 00:12:51 EST
(In reply to comment #4)
> just don't use the -C option?
> 
> given how caching and user-local copies of the repodata have evolved -C is not
> very much needed

Without -C, the metadata is downloaded each time, even if the root user had recently downloaded all the metadata.

If things aren't supposed to work this way, maybe some config change is needed, (this is an installation that's been upgraded from previous releases, not a new install)?
Comment 6 Zdeněk Pavlas 2011-12-01 02:55:06 EST
This bug is caused by different handling of group_gz metadata files in Yum and Yum-langpacks.  Yum downloads and keeps the .gz file, opening it with gzip.open().  But Yum-langpacks tries to decompress it to the same (often rdonly) directory.  Possible fixes are:

a) change yum such that it prefers .gz file for download but unpacks it immediately after the download.

b) change yum-langpacks to use in-place decompression.
Comment 7 seth vidal 2011-12-01 09:35:18 EST
Without -C it's not downloaded each time. For the user it is copied from the most recent copy of the systemwide yum cache. If that copy is current enough then it is used, if not  new one is fetched.
Comment 8 Amit Shah 2011-12-15 04:54:59 EST
(In reply to comment #7)
> Without -C it's not downloaded each time. For the user it is copied from the
> most recent copy of the systemwide yum cache. If that copy is current enough
> then it is used, if not  new one is fetched.

OK, I can confirm this behaviour.

However, I'd like for -C to exist.

Example use-cases

1) when I'm on mobile broadband, I just want to query the db for a particular package or look up its info.  In that case, I don't want to use up any bandwidth or incur charges just for querying the db.

2) When I get an rpm from some source (e.g. latest kernel from koji), I want to just 'yum install -C ./kernel*.rpm' without having to fetch latest metadata.
Comment 9 Zdeněk Pavlas 2011-12-15 06:14:24 EST
I think this should be fixed in langpacks.py, patch added.
Comment 10 Zdeněk Pavlas 2011-12-15 06:15:27 EST
Created attachment 547184 [details]
Use the already decompressed comps file.
Comment 11 Bill Nottingham 2011-12-15 14:13:19 EST
Thanks, applied to git.
Comment 12 Fedora Update System 2011-12-15 14:26:56 EST
yum-langpacks-0.2.4-2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/yum-langpacks-0.2.4-2.fc16
Comment 13 Fedora Update System 2011-12-15 14:30:02 EST
yum-langpacks-0.2.4-2.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/yum-langpacks-0.2.4-2.fc15
Comment 14 Fedora Update System 2011-12-16 15:04:15 EST
Package yum-langpacks-0.2.4-2.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-langpacks-0.2.4-2.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-17200/yum-langpacks-0.2.4-2.fc15
then log in and leave karma (feedback).
Comment 15 Fedora Update System 2011-12-17 15:53:20 EST
yum-langpacks-0.2.4-2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 16 Fedora Update System 2012-01-03 20:59:11 EST
yum-langpacks-0.2.4-2.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.