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 1475462 - nfsdcltrack -d should log to syslog without -f/--foreground specified
Summary: nfsdcltrack -d should log to syslog without -f/--foreground specified
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils
Version: 7.4
Hardware: All
OS: Linux
medium
unspecified
Target Milestone: rc
: ---
Assignee: Steve Dickson
QA Contact: Yongcheng Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-26 18:05 UTC by ChunYu Wang
Modified: 2018-04-10 18:22 UTC (History)
3 users (show)

Fixed In Version: nfs-utils-1.3.0-0.49.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 18:21:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0981 0 None None None 2018-04-10 18:22:27 UTC

Description ChunYu Wang 2017-07-26 18:05:04 UTC
-- Description of problem:

Upstream nfs-utils has just fixed a minor error of nfsdcltrack, the original nfsdcltrack -d will not write log to the syslog but it will always choose stderr as destination.  

-- Upstream patch
commit 6b8ee0f663c44452a7568a0f2ffb038ee7ae0972
Author: Steve Dickson <steved>
Date:   Wed Jul 19 16:37:56 2017 -0400

    nfsmount: remove a warning
    
    nfsmount.c:684:8: warning: this statement may fall through [-Wimplicit-fallthrough=]
    
    Signed-off-by: Steve Dickson <steved>

-- Behaviour described in nfsdcltrack(8) manual pages
    13	       -d, --debug
    14	           Enable debug level logging.

    15	       -f, --foreground
    16	           Log to stderr instead of syslog.

Without -f/--foreground specified, the nfsdcltrack -d should log to syslog (instead of stderr).

-- Test - Current:

[chunwang@bootp utils]$ nfsdcltrack init -d
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[chunwang@bootp x86_64]$ sudo tail -1 /var/log/messages | grep nfsdcltrack
[chunwang@bootp SOURCES]$ rpm -q nfs-utils
nfs-utils-1.3.0-0.48.el7.x86_64

-- Test - Patched:
[chunwang@bootp x86_64]$ nfsdcltrack init -d
[chunwang@bootp x86_64]$ sudo tail -1 /var/log/messages | grep nfsdcltrack
Jul 27 01:41:34 localhost nfsdcltrack[5002]: Unable to prune capability 0 from bounding set: Operation not permitted
[chunwang@bootp x86_64]$ rpm -q nfs-utils
nfs-utils-1.3.0-0.48.gitf80c998.el7.x86_64
[chunwang@bootp SOURCES]$ cat ./nfs-utils.spec |grep -i patch104
Patch104: 0010-nfsdcltrack.c-remove-a-warning.patch
%patch104 -p1

-- Version-Release number of selected component (if applicable):
nfs-utils-1.3.0-0.48.el7.x86_64

Comment 2 ChunYu Wang 2017-07-27 03:42:36 UTC
Seems I had picked up a wrong patch, the right commit is:

--
Author: Steve Dickson <steved>
Date:   Wed Jul 19 16:42:39 2017 -0400

    nfsdcltrack.c: remove a warning
    
    nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    
    Acked-by: Jeff Layton <jlayton>
    Signed-off-by: Steve Dickson <steved>

diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index 124c923..0baaa3e 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -579,6 +579,7 @@ main(int argc, char **argv)
                switch (arg) {
                case 'd':
                        xlog_config(D_ALL, 1);
+                       break;
                case 'f':
                        xlog_syslog(0);
                        xlog_stderr(1);

So sorry about that.
- Chunyu

Comment 3 Yongcheng Yang 2017-09-20 07:26:22 UTC
Verified with nfs-utils-1.3.0-0.49.el7, it works as expected:

### Previously with nfs-utils-1.3.0-0.48.el7
[root ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.48.el7.x86_64
[root ~]# >/var/log/messages 
[root ~]# useradd tempUser
[root ~]# su - tempUser -c 'nfsdcltrack init -d'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root ~]# echo $?
255
[root ~]# cat /var/log/messages 
Sep 20 03:16:25 localhost su: (to tempUser) root on pts/0
^^^^^^^^^^^^^ always log to foreground (not syslog) even not specified "-f"
[root ~]# 
[root ~]# >/var/log/messages 
[root ~]# su - tempUser -c 'nfsdcltrack init -f'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root ~]# echo $?
255
[root ~]# cat /var/log/messages 
Sep 20 03:17:06 localhost su: (to tempUser) root on pts/0
[root ~]# 

### Updating to nfs-utils-1.3.0-0.49.el7
[root ~]# rpm -Uvh nfs-utils-1.3.0-0.49.el7.x86_64.rpm >/dev/null 
[root ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.49.el7.x86_64
[root ~]# >/var/log/messages 
[root ~]# su - tempUser -c 'nfsdcltrack init -d'
[root ~]# echo $?
255
[root ~]# cat /var/log/messages 
Sep 20 03:17:43 localhost su: (to tempUser) root on pts/0
Sep 20 03:17:44 localhost nfsdcltrack[1021]: Unable to prune capability 0 from bounding set: Operation not permitted
^^^^^^^^^^^^^^^^^^^^^^^ log to syslog (not foreground) with option "-d"
[root ~]# 
[root ~]# >/var/log/messages 
[root ~]# su - tempUser -c 'nfsdcltrack init -f'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root ~]# echo $?
255
[root ~]# cat /var/log/messages 
Sep 20 03:18:02 localhost su: (to tempUser) root on pts/0
^^^^^^^^^^^^^^^^^^^^^^^ log to foreground (not syslog) with option "-f"
[root ~]#

Comment 6 Yongcheng Yang 2017-11-04 04:15:08 UTC
Moving to VERIFIED according to test logs of comment #4.

Comment 9 errata-xmlrpc 2018-04-10 18:21:01 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-2018:0981


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