Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1475462 - nfsdcltrack -d should log to syslog without -f/--foreground specified
nfsdcltrack -d should log to syslog without -f/--foreground specified
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils (Show other bugs)
7.4
All Linux
medium Severity unspecified
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-26 14:05 EDT by ChunYu Wang
Modified: 2018-04-10 14:22 EDT (History)
3 users (show)

See Also:
Fixed In Version: nfs-utils-1.3.0-0.49.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 14:21:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0981 None None None 2018-04-10 14:22 EDT

  None (edit)
Description ChunYu Wang 2017-07-26 14:05:04 EDT
-- 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@redhat.com>
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@redhat.com>

-- 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-26 23:42:36 EDT
Seems I had picked up a wrong patch, the right commit is:

--
Author: Steve Dickson <steved@redhat.com>
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@redhat.com>
    Signed-off-by: Steve Dickson <steved@redhat.com>

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 03:26:22 EDT
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@rhel-7.4 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.48.el7.x86_64
[root@rhel-7.4 ~]# >/var/log/messages 
[root@rhel-7.4 ~]# useradd tempUser
[root@rhel-7.4 ~]# su - tempUser -c 'nfsdcltrack init -d'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root@rhel-7.4 ~]# echo $?
255
[root@rhel-7.4 ~]# 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@rhel-7.4 ~]# 
[root@rhel-7.4 ~]# >/var/log/messages 
[root@rhel-7.4 ~]# su - tempUser -c 'nfsdcltrack init -f'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root@rhel-7.4 ~]# echo $?
255
[root@rhel-7.4 ~]# cat /var/log/messages 
Sep 20 03:17:06 localhost su: (to tempUser) root on pts/0
[root@rhel-7.4 ~]# 

### Updating to nfs-utils-1.3.0-0.49.el7
[root@rhel-7.4 ~]# rpm -Uvh nfs-utils-1.3.0-0.49.el7.x86_64.rpm >/dev/null 
[root@rhel-7.4 ~]# rpm -q nfs-utils
nfs-utils-1.3.0-0.49.el7.x86_64
[root@rhel-7.4 ~]# >/var/log/messages 
[root@rhel-7.4 ~]# su - tempUser -c 'nfsdcltrack init -d'
[root@rhel-7.4 ~]# echo $?
255
[root@rhel-7.4 ~]# 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@rhel-7.4 ~]# 
[root@rhel-7.4 ~]# >/var/log/messages 
[root@rhel-7.4 ~]# su - tempUser -c 'nfsdcltrack init -f'
nfsdcltrack: Unable to prune capability 0 from bounding set: Operation not permitted
[root@rhel-7.4 ~]# echo $?
255
[root@rhel-7.4 ~]# 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@rhel-7.4 ~]#
Comment 6 Yongcheng Yang 2017-11-04 00:15:08 EDT
Moving to VERIFIED according to test logs of comment #4.
Comment 9 errata-xmlrpc 2018-04-10 14:21:01 EDT
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.