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 1856881 - /etc/group file is modified/touched after the update for nfs-utils
Summary: /etc/group file is modified/touched after the update for nfs-utils
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nfs-utils
Version: 8.0
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: 8.4
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks: 1856884
TreeView+ depends on / blocked
 
Reported: 2020-07-14 15:51 UTC by Parikshit Khedekar
Modified: 2023-12-15 18:27 UTC (History)
3 users (show)

Fixed In Version: nfs-utils-2.3.3-38.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1856884 (view as bug list)
Environment:
Last Closed: 2021-05-18 15:04:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Parikshit Khedekar 2020-07-14 15:51:10 UTC
Description of problem:

Updating the nfs-utils modifies the /etc/group file. This is not expected if the package is already installed and the 'rpcuser' group is already there.

The if statement for the nfsnobody seems to be fine but the code for rpcuser needs enhancements as,


The problem is with the prescript of the rpm as,

Current spec file:
~~~~~~~~~

# Create rpcuser gid as long as it does not already exist
cat /etc/group | cut -d':' -f 1 | grep --quiet rpcuser 2>/dev/null
if [ "$?" -eq 1 ]; then
    /usr/sbin/groupadd -g 29 rpcuser >/dev/null 2>&1 || :
else
    /usr/sbin/groupmod -g 29 rpcuser >/dev/null 2>&1 || :
fi

~~~~~~~~~

Here even the conditions falses the same command is marked to get executed.

The changes to the spec file should be as for modifying/changing the pre-scripts as,

~~~~~~~~~

# Create rpcuser gid as long as it does not already exist
cat /etc/group | cut -d':' -f 1 | grep --quiet rpcuser 2>/dev/null
if [ "$?" -eq 1 ]; then
    /usr/sbin/groupadd -g 29 rpcuser >/dev/null 2>&1 || :

fi

~~~~~~~~~


Version-Release number of selected component (if applicable):
RHEL 8/RHEL7

Any release of nfs-utils


How reproducible:

#stat /etc/group -->> check file stamp before update of package.

#yum update nfs-utils

#stat /etc/group -->> check file stamp after update of package. 

Steps to Reproduce:
1. check time stamp of the /etc/group file
2. Update the nfs-utils package
3. Check time stamp of the /etc/group file which differs
 
Actual results:

It does modifies the file unnecessorily.


Expected results:

It should not run the command again if the 


Additional info:

Comment 16 Yongcheng Yang 2020-12-14 02:16:41 UTC
Moving to VERIFIED now:

[14:23:03 root@ ~~]# id rpcuser
uid=29(rpcuser) gid=29(rpcuser) groups=29(rpcuser)
[14:23:03 root@ ~~]# stat -c %z /etc/group
2020-12-12 14:22:46.945391977 +0200    <<<<<<<<<<<
[14:23:03 root@ ~~]# yum -y update nfs-utils
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
beaker-AppStream                                1.4 MB/s | 6.4 MB     00:04    
beaker-BaseOS                                   760 kB/s | 2.4 MB     00:03    
beaker-CRB                                      634 kB/s | 2.0 MB     00:03    
Dependencies resolved.
================================================================================
 Package             Arch        Version               Repository          Size
================================================================================
Upgrading:
 nfs-utils           x86_64      1:2.3.3-39.el8        beaker-BaseOS      496 k
Installing dependencies:
 python3-pyyaml      x86_64      3.12-12.el8           beaker-BaseOS      193 k

Transaction Summary
================================================================================
Install  1 Package
Upgrade  1 Package

Total download size: 689 k
Downloading Packages:
(1/2): python3-pyyaml-3.12-12.el8.x86_64.rpm    131 kB/s | 193 kB     00:01    
(2/2): nfs-utils-2.3.3-39.el8.x86_64.rpm        257 kB/s | 496 kB     00:01    
--------------------------------------------------------------------------------
Total                                           357 kB/s | 689 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Running scriptlet: python3-pyyaml-3.12-12.el8.x86_64                      1/1 
  Installing       : python3-pyyaml-3.12-12.el8.x86_64                      1/3 
  Running scriptlet: nfs-utils-1:2.3.3-39.el8.x86_64                        2/3 
  Upgrading        : nfs-utils-1:2.3.3-39.el8.x86_64                        2/3 
  Running scriptlet: nfs-utils-1:2.3.3-39.el8.x86_64                        2/3 
  Running scriptlet: nfs-utils-1:2.3.3-31.el8.x86_64                        3/3 
  Cleanup          : nfs-utils-1:2.3.3-31.el8.x86_64                        3/3 
  Running scriptlet: nfs-utils-1:2.3.3-31.el8.x86_64                        3/3 
  Verifying        : python3-pyyaml-3.12-12.el8.x86_64                      1/3 
  Verifying        : nfs-utils-1:2.3.3-39.el8.x86_64                        2/3 
  Verifying        : nfs-utils-1:2.3.3-31.el8.x86_64                        3/3 
Installed products updated.

Upgraded:
  nfs-utils-1:2.3.3-39.el8.x86_64                                               

Installed:
  python3-pyyaml-3.12-12.el8.x86_64                                             

Complete!
[14:36:37 root@ ~~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 Beta (Ootpa)
[14:36:37 root@ ~~]# test 1607775766 -eq 1607775766
[14:36:37 root@ ~~]# stat -c %z /etc/group
2020-12-12 14:22:46.945391977 +0200              <<<<<<<<<<<<<

Comment 18 errata-xmlrpc 2021-05-18 15:04:48 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 (nfs-utils bug fix and enhancement update), 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-2021:1669


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