RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1699310 - rpm -V setup fail on /var/log/lastlog
Summary: rpm -V setup fail on /var/log/lastlog
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: util-linux
Version: 8.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.1
Assignee: Karel Zak
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks: 1798685 2000477 2044984
TreeView+ depends on / blocked
 
Reported: 2019-04-12 11:50 UTC by David Jež
Modified: 2022-01-25 12:43 UTC (History)
3 users (show)

Fixed In Version: util-linux-2.32.1-10.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1798685 (view as bug list)
Environment:
Last Closed: 2019-11-05 22:26:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-18281 0 None None None 2021-09-02 08:46:56 UTC
Red Hat Product Errata RHBA-2019:3603 0 None None None 2019-11-05 22:27:06 UTC

Description David Jež 2019-04-12 11:50:13 UTC
Description of problem:
File /var/log/lastlog has set root.root 644 permissions in rpm but it is root.utmp 664 on filesystem.

Version-Release number of selected component (if applicable):
setup-2.12.2-1.el8

How reproducible:
Always

Steps to Reproduce:
1. rpm -V setup

Actual results:
.M....G..  g /var/log/lastlog

Expected results:
No error

Additional info:
See for example http://beaker-archive.host.prod.eng.bos.redhat.com/beaker-logs/2019/03/34027/3402722/6601776/89286045/taskout.log

Comment 1 Ondrej Vasik 2019-04-18 08:55:00 UTC
Adding Karel to cc, as lastlog is from util-linux package . Setup package just owns /var/log/lastlog - probably for historic reasons. It doesn't even create the file, so any package which creates the file is actually responsible for the unclean rpm -V output.
Karel, any suspects? (For me either shadow-utils or systemd).

Comment 2 Karel Zak 2019-04-18 09:44:43 UTC
We have in util-linux.spec file:

%post           
# only for minimal buildroots without /var/log
[ -d /var/log ] || mkdir -p /var/log
touch /var/log/lastlog
chown root:root /var/log/lastlog
chmod 0644 /var/log/lastlog
# Fix the file context, do not use restorecon
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
        SECXT=$( /usr/sbin/matchpathcon -n /var/log/lastlog 2> /dev/null )
        if [ -n "$SECXT" ]; then
                # Selinux enabled, but without policy? It's true for buildroots
                # without selinux stuff on host machine with enabled selinux.
                # We don't want to use any RPM dependence on selinux policy for
                # matchpathcon(2). SELinux policy should be optional.
                /usr/bin/chcon "$SECXT"  /var/log/lastlog >/dev/null 2>&1 || :
        fi      
fi 

%files
%ghost %attr(0644,root,root) %verify(not md5 size mtime) /var/log/lastlog

The question is where "root.utmp" comes from. login(1) is able to create the file 
on the fly, but it does not explain "utmp" group.

Anyway, would be better move the file from setup to util-linux?

Comment 3 Karel Zak 2019-04-18 09:46:45 UTC
Ah, I see it:

$ git grep lastlog
...
tmpfiles.d/var.conf.m4:f /var/log/lastlog 0664 root utmp -


... systemd upstream tree :-)

Comment 4 Karel Zak 2019-04-18 09:49:06 UTC
It seems we need to sync
   /usr/lib/tmpfiles.d/var.conf:f /var/log/lastlog 0664 root utmp -

with util-linux spec file.

Comment 5 Karel Zak 2019-04-18 09:51:43 UTC
CC: systemd guys. Any suggestion -- why we need "root.utmp" for lastlog?

Comment 6 Lukáš Nykrýn 2019-04-18 10:57:41 UTC
It seems to be a custom on other distributions that utmp group can write to these files. See https://github.com/systemd/systemd/issues/6994

Comment 13 errata-xmlrpc 2019-11-05 22:26:57 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://access.redhat.com/errata/RHBA-2019:3603


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