Bug 1223818 - /etc/gai.conf is owned by glibc not glibc-common and misses attributes
Summary: /etc/gai.conf is owned by glibc not glibc-common and misses attributes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: glibc
Version: 6.5
Hardware: All
OS: All
low
low
Target Milestone: rc
: ---
Assignee: Florian Weimer
QA Contact: Arjun Shankar
Marc Muehlfeld
URL:
Whiteboard:
Depends On:
Blocks: 1172231 1271375
TreeView+ depends on / blocked
 
Reported: 2015-05-21 13:32 UTC by Paulo Andrade
Modified: 2019-10-10 09:49 UTC (History)
10 users (show)

Fixed In Version: glibc-2.12-1.181.el6
Doc Type: Release Note
Doc Text:
`/etc/gai.conf` no longer listed as belonging to the _glibc-common_ package Previously, the `/etc/gai.conf` configuration file could be flagged as modified when the "rpm -V" command was used to check the _glibc-common_ package, even though that package did not own that file. This update removes the erroneous file entry from _glibc-common_. As a result "rpm -V glibc-common" no longer lists the `/etc/gai.conf` configuration file as modified.
Clone Of:
Environment:
Last Closed: 2016-05-10 21:27:04 UTC
Target Upstream Version:


Attachments (Terms of Use)
01448083.spec (1.12 KB, text/plain)
2015-05-21 14:47 UTC, Paulo Andrade
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0834 0 normal SHIPPED_LIVE glibc bug fix update 2016-05-10 22:41:39 UTC

Description Paulo Andrade 2015-05-21 13:32:28 UTC
The problem does not happen in rhel7, where rpm apparently
works around the bug in the glibc spec.

The problem is that if one customizes /etc/gai.conf,
running something like:

$ /bin/rpm -V glibc glibc-common --nodigest --nosignature --nolinkto --nosize --nouser --nogroup --nomtime --nordev --nocaps --nomode

will output:

..5......    /etc/gai.conf

The pseudo patch for glibc.spec is:

---8<---
   # rpm does not handle %lang() tagged files hardlinked together accross
   # languages very well, temporarily disable
   LIB_LANG=''
   sed -e "$LIB_LANG" -e "$SHARE_LANG" \
-      -e '\,/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\),d' \
+      -e '\,/etc/\(localtime\|nsswitch.conf\|gai.conf\|ld\.so\.conf\|ld\.so\.cache\|default\),d' \
       -e '\,/%{_lib}/lib\(pcprofile\|memusage\)\.so,d' \
       -e '\,bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
 } | sort > rpm.filelist
---8<---

Comment 1 Carlos O'Donell 2015-05-21 13:47:02 UTC
(In reply to Paulo Andrade from comment #0)
> The problem does not happen in rhel7, where rpm apparently
> works around the bug in the glibc spec.
> 
> The problem is that if one customizes /etc/gai.conf,
> running something like:
> 
> $ /bin/rpm -V glibc glibc-common --nodigest --nosignature --nolinkto
> --nosize --nouser --nogroup --nomtime --nordev --nocaps --nomode
> 
> will output:
> 
> ..5......    /etc/gai.conf
> 
> The pseudo patch for glibc.spec is:
> 
> ---8<---
>    # rpm does not handle %lang() tagged files hardlinked together accross
>    # languages very well, temporarily disable
>    LIB_LANG=''
>    sed -e "$LIB_LANG" -e "$SHARE_LANG" \
> -      -e
> '\,/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\),
> d' \
> +      -e
> '\,/etc/\(localtime\|nsswitch.conf\|gai.conf\|ld\.so\.conf\|ld\.so\.
> cache\|default\),d' \
>        -e '\,/%{_lib}/lib\(pcprofile\|memusage\)\.so,d' \
>        -e '\,bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
>  } | sort > rpm.filelist
> ---8<---

The gai.conf file is installed with the following attributes:

%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf

Given "not md5 size mtime", the rpm verification should not print "5" at all.

This looks like an rpm bug?

Comment 2 Carlos O'Donell 2015-05-21 13:48:36 UTC
I think I see what you're trying to say. In that the gai.conf is double listed in glibc and glibc-common. Let me verify.

Comment 3 Carlos O'Donell 2015-05-21 13:55:07 UTC
(In reply to Carlos O'Donell from comment #2)
> I think I see what you're trying to say. In that the gai.conf is double
> listed in glibc and glibc-common. Let me verify.

OK, I verified the spec file and I still don't see a problem.

glibc owns /etc/gai.conf and has attributes for it that should properly account for it being a conf file, just like it owns /etc/ld.so.conf and /etc/nsswitch.conf.

If you still see a problem please specify it in more detail.

Comment 4 Paulo Andrade 2015-05-21 14:41:27 UTC
Please test on rhel6, there it will show the problem.

Note that the pseudo-patch is to remove the file gai.conf
from rpm.filelist, so that it will be owned by glibc-common.

The example in the original bug report is that the problem
does not happen if one customizes nsswitch.conf.

Comment 5 Paulo Andrade 2015-05-21 14:47:58 UTC
Created attachment 1028251 [details]
01448083.spec

This simple spec tries to show the point :)

Just build and install it, then add some contents to
/etc/gai.conf.01448083

and sample test:

[pcpa@rhel-6-6-x86-64 rpmbuild]$ /bin/rpm -V 01448083 --nodigest --nosignature --nolinkto --nosize --nouser --nogroup --nomtime --nordev --nocaps --nomode
..5......    /etc/gai.conf.01448083
[pcpa@rhel-6-6-x86-64 rpmbuild]$ /bin/rpm -V 01448083-common --nodigest --nosignature --nolinkto --nosize --nouser --nogroup --nomtime --nordev --nocaps --nomode
[pcpa@rhel-6-6-x86-64 rpmbuild]$ rpm -qf /etc/gai.conf 
glibc-2.12-1.164.el6.x86_64
glibc-common-2.12-1.164.el6.x86_64
glibc-2.12-1.164.el6.i686
[pcpa@rhel-6-6-x86-64 rpmbuild]$ rpm -qf /etc/gai.conf.01448083 
01448083-1-1.el6.x86_64
01448083-common-1-1.el6.x86_64

Comment 6 Paulo Andrade 2015-05-21 14:53:10 UTC
A minor change I forgot to do "in the last minute"
to the sample is:

-%files -f rpm.filelist
-/etc/%{name}
-/etc/gai.conf.%{name}
+%files -f rpm.filelist

But it will show the problem either way. Just that
the latter would better mimic glibc.spec.

Comment 7 Carlos O'Donell 2015-05-21 15:12:36 UTC
Why not make rhel-6 match rhel-7?

diff --git a/glibc.spec b/glibc.spec
index 2f301bb..a639e0a 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1353,6 +1353,7 @@ rm -f *.filelist*
 %dir %attr(0700,root,root) /var/cache/ldconfig
 %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache
 %attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
+%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
 %doc README NEWS INSTALL FAQ BUGS NOTES PROJECTS CONFORMANCE
 %doc COPYING COPYING.LIB README.libm LICENSES
 %doc hesiod/README.hesiod
@@ -1372,7 +1373,6 @@ rm -f *.filelist*
 %dir %attr(755,root,root) /etc/default
 %verify(not md5 size mtime) %config(noreplace) /etc/default/nss
 %attr(4711,root,root) %{_prefix}/libexec/pt_chown
-%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
 %doc documentation/*
 
 %files -f devel.filelist devel

Comment 8 Paulo Andrade 2015-05-21 16:27:40 UTC
That is fine as well. But I still suggest adding
gai.conf after nsswitch.conf in the regex that remove
config files from rpm.filelist.

Otherwise, it is kind of relying on undefined
behavior. i.e. file listed twice, once as a normal
file, and once as a "special" file.

Comment 16 errata-xmlrpc 2016-05-10 21:27:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0834.html


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