Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1282029

Summary: [abrt] rpmconf: shutil.py:108:copyfile:PermissionError: [Errno 13] Permission denied: '/etc/pear.conf'
Product: [Fedora] Fedora Reporter: Timothy Ward <timwa1>
Component: rpmconfAssignee: Miroslav Suchý <msuchy>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: craig, msuchy, xjakub
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i686   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/6f11ba5ed39ef9f611da38d084185298faafb50c
Whiteboard: abrt_hash:0d73de5eec3314b740a389210f6d128cb3394cf0;VARIANT_ID=workstation;
Fixed In Version: rpmconf-1.0.14 rpmconf-1.0.16-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-12-07 20:28:34 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:
Attachments:
Description Flags
File: backtrace
none
File: environ none

Description Timothy Ward 2015-11-14 13:33:38 UTC
Description of problem:
1) Started rpmconf in a terminal
2) Tried to install the maintainers config file for the package pear
3) This error occured.

Version-Release number of selected component:
rpmconf-1.0.12-1.fc22

Additional info:
reporter:       libreport-2.6.3
cmdline:        /usr/bin/python3 /usr/sbin/rpmconf -a
executable:     /usr/sbin/rpmconf
kernel:         4.2.5-201.fc22.i686+PAE
runlevel:       N 5
type:           Python3
uid:            1000

Truncated backtrace:
shutil.py:108:copyfile:PermissionError: [Errno 13] Permission denied: '/etc/pear.conf'

Traceback (most recent call last):
  File "/usr/sbin/rpmconf", line 63, in <module>
    main()
  File "/usr/sbin/rpmconf", line 60, in main
    rconf.run()
  File "/usr/lib/python3.4/site-packages/rpmconf/rpmconf.py", line 90, in run
    self._handle_package(pkg_hdr)
  File "/usr/lib/python3.4/site-packages/rpmconf/rpmconf.py", line 264, in _handle_package
    tmp.format(conf_file, "rpmnew"))
  File "/usr/lib/python3.4/site-packages/rpmconf/rpmconf.py", line 310, in _handle_rpmnew
    self._overwrite(other_file, conf_file)
  File "/usr/lib/python3.4/site-packages/rpmconf/rpmconf.py", line 200, in _overwrite
    self._copy(src, dst)
  File "/usr/lib/python3.4/site-packages/rpmconf/rpmconf.py", line 182, in _copy
    shutil.copy2(src, dst)
  File "/usr/lib/python3.4/shutil.py", line 244, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.4/shutil.py", line 108, in copyfile
    with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permission denied: '/etc/pear.conf'

Local variables in innermost frame:
follow_symlinks: True
st: os.stat_result(st_mode=33188, st_ino=1324413, st_dev=64768, st_nlink=1, st_uid=0, st_gid=0, st_size=1141, st_atime=1446950293, st_mtime=1393206197, st_ctime=1393206197)
fsrc: <_io.BufferedReader name='/etc/pear.conf.rpmnew'>
dst: '/etc/pear.conf'
src: '/etc/pear.conf.rpmnew'
fn: '/etc/pear.conf'

Comment 1 Timothy Ward 2015-11-14 13:33:43 UTC
Created attachment 1094046 [details]
File: backtrace

Comment 2 Timothy Ward 2015-11-14 13:33:44 UTC
Created attachment 1094047 [details]
File: environ

Comment 3 Miroslav Suchý 2015-11-16 07:51:57 UTC
Rpmconf must be run under root user.
I should probably put check on top of the script.

Comment 4 Timothy Ward 2015-11-19 06:34:47 UTC
The program is only run infrequently so the check to run under root IMO is worthwhile addition.

Comment 5 Miroslav Suchý 2015-11-22 13:23:41 UTC
Fixed in commit:
* c7040d0 (HEAD -> master, origin/master, origin/HEAD) 1282029 - check for root privileges

Note: It is just warning as some features (like diff) can be still usefull without root.

Comment 6 Miroslav Suchý 2015-11-22 13:52:24 UTC
*** Bug 1217681 has been marked as a duplicate of this bug. ***

Comment 7 Fedora Update System 2015-11-30 10:03:29 UTC
rpmconf-1.0.15-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-8588d401cd

Comment 8 Fedora Update System 2015-12-01 02:22:45 UTC
rpmconf-1.0.15-1.fc23 has been pushed to the Fedora 23 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 'dnf --enablerepo=updates-testing update rpmconf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-8588d401cd

Comment 9 Fedora Update System 2015-12-01 12:23:57 UTC
rpmconf-1.0.16-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-8588d401cd

Comment 10 Fedora Update System 2015-12-01 22:31:17 UTC
rpmconf-1.0.16-1.fc23 has been pushed to the Fedora 23 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 'dnf --enablerepo=updates-testing update rpmconf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-8588d401cd

Comment 11 Fedora Update System 2015-12-07 20:28:21 UTC
rpmconf-1.0.16-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.