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 1051685 - rpm doesn't read $HOME/.popt
Summary: rpm doesn't read $HOME/.popt
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: popt
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Robert Scheck
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-10 21:34 UTC by Peter Backes
Modified: 2017-10-25 23:10 UTC (History)
10 users (show)

Fixed In Version: popt-1.16-12.fc27 popt-1.16-12.fc25 popt-1.16-12.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-17 00:15:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Patch to handle GLOB_NOMATCH (deleted)
2017-06-09 23:27 UTC, Peter Backes
no flags Details | Diff

Description Peter Backes 2014-01-10 21:34:19 UTC
Description of problem:
I have a popt config under $HOME/.popt containing rpm aliases like

rpm     exec --bp               /usr/bin/rpmbuild -bp
rpm     exec --bc               /usr/bin/rpmbuild -bc
rpm     exec --bi               /usr/bin/rpmbuild -bi
rpm     exec --bl               /usr/bin/rpmbuild -bl
rpm     exec --ba               /usr/bin/rpmbuild -ba
...

When trying to rebuild some rpms after upgrading to f20, I noticed this doesn't work anymore the way it used to.

Version-Release number of selected component (if applicable):
popt-1.16-1.fc20.i686
rpm-4.11.1-7.fc20.i686

How reproducible:
always

Steps to Reproduce:
1. rpm -ba --clean wget.spec

Actual results:
rpm: -ba: unknown option

Expected results:
works fine

Additional info:
workaround: sudo ln -s $HOME/.popt /etc/popt.d/$USER.popt

Comment 1 Panu Matilainen 2014-01-13 11:12:26 UTC
Looks like a regression in popt - with popt-1.13 ~/.popt is read, with popt-1.16 its not.

Comment 2 Fedora End Of Life 2015-05-29 10:26:09 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2015-06-29 14:20:42 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 4 Ed Marshall 2017-02-08 22:39:26 UTC
This is still not working on Fedora 25. It also looks like configuration dropped in /etc/popt.d is also not being read; only /etc/popt and /usr/lib/rpm/rpmpopt-4.13.0 are being inspected.

Comment 5 Peter Backes 2017-06-09 23:27:56 UTC
Created attachment 1286559 [details]
Patch to handle GLOB_NOMATCH

(In reply to Ed Marshall from comment #4)
> This is still not working on Fedora 25. It also looks like configuration
> dropped in /etc/popt.d is also not being read; only /etc/popt and
> /usr/lib/rpm/rpmpopt-4.13.0 are being inspected.

I cannot confirm this.
% strace rpm -ba 2>&1 | grep popt
open("/lib/libpopt.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/rpm/rpmpopt-4.13.0.1", O_RDONLY|O_LARGEFILE) = 3
read(3, "#/*! \\page config_rpmpopt Defaul"..., 10216) = 10216
open("/etc/popt", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/etc/popt.d", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/etc/popt.d", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3

I looked at the source code. Seems that between popt-1.13-14.fc19 and popt-1.16-1.fc20, file globbing was changed. It tries to glob /etc/popt.d/*. In the old version, it ignored the return code of glob. In the new version, it checks for the return code, and if it is not equal to 0, it bails out. This is mostly useful, since a return code of GLOB_NOSPACE or GLOB_ABORTED signals an error. However the valid case that the return code is GLOB_NOMATCH is missed, ie., when no files are matched, which happens if /etc/popt.d is empty.

Simply try to create a dummy file with touch /etc/popt.d/dummy, it will then actually read ~/.popt because the glob returns 0. It also means that the workaround I mentioned above (sudo ln -s $HOME/.popt /etc/popt.d/$USER.popt) is too eager; it will cause the file to be read twice, once as /etc/popt.d/$USER.popt and, because the glob returns 0, once as $HOME/.popt.

I attached a patch that fixes the problem. Hope this annoying bug can soon be closed.

Comment 6 Fedora Update System 2017-10-12 22:03:51 UTC
popt-1.16-12.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-c1b7fbbffe

Comment 7 Fedora Update System 2017-10-12 22:04:24 UTC
popt-1.16-12.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ffd16e2c73

Comment 8 Fedora Update System 2017-10-12 22:04:57 UTC
popt-1.16-12.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-fa32d9cd0c

Comment 9 Fedora Update System 2017-10-13 22:22:02 UTC
popt-1.16-12.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-fa32d9cd0c

Comment 10 Fedora Update System 2017-10-13 22:23:31 UTC
popt-1.16-12.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ffd16e2c73

Comment 11 Fedora Update System 2017-10-13 23:23:34 UTC
popt-1.16-12.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-c1b7fbbffe

Comment 12 Fedora Update System 2017-10-17 00:15:49 UTC
popt-1.16-12.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2017-10-25 21:16:55 UTC
popt-1.16-12.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2017-10-25 23:10:37 UTC
popt-1.16-12.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


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