From patchwork Wed Feb 1 22:44:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Gruenbacher X-Patchwork-Id: 9550757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A86C860236 for ; Wed, 1 Feb 2017 22:44:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EE6E28450 for ; Wed, 1 Feb 2017 22:44:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9053D2845B; Wed, 1 Feb 2017 22:44:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20C5E28450 for ; Wed, 1 Feb 2017 22:44:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754175AbdBAWoX (ORCPT ); Wed, 1 Feb 2017 17:44:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751626AbdBAWoW (ORCPT ); Wed, 1 Feb 2017 17:44:22 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 413E081254; Wed, 1 Feb 2017 22:44:23 +0000 (UTC) Received: from nux.redhat.com (ovpn-117-143.ams2.redhat.com [10.36.117.143]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v11MiKas004860; Wed, 1 Feb 2017 17:44:21 -0500 From: Andreas Gruenbacher To: Olga Kornievskaia Cc: "J. Bruce Fields" , "J. Bruce Fields" , Trond Myklebust , Anna Schumaker , Linux NFS Mailing List Subject: Re: [PATCH 1/2] nfs: add support for the umask attribute Date: Wed, 1 Feb 2017 23:44:19 +0100 Message-Id: <1485989059-28706-1-git-send-email-agruenba@redhat.com> In-Reply-To: References: <1479933700-5743-1-git-send-email-bfields@redhat.com> <1479933700-5743-2-git-send-email-bfields@redhat.com> <20161201220716.GB1589@fieldses.org> <20161202164705.GB20384@parsley.fieldses.org> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 01 Feb 2017 22:44:23 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: "J. Bruce Fields" On Wed, Feb 1, 2017 at 10:31 PM, Olga Kornievskaia wrote: > Any plans to add wireshark support for this? We did, yes. Bruce had posted that together with the very first version. I couldn't find the wireshark patch for the current version of the proposal in the mailing list archive, so here's that. Andreas --- NFSv4.2 umask support --- epan/dissectors/packet-nfs.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c index 6d1dd3b..5f2ce42 100644 --- a/epan/dissectors/packet-nfs.c +++ b/epan/dissectors/packet-nfs.c @@ -420,6 +420,7 @@ static int hf_nfs4_fattr_layout_blksize = -1; static int hf_nfs4_fattr_security_label_lfs = -1; static int hf_nfs4_fattr_security_label_pi = -1; static int hf_nfs4_fattr_security_label_context = -1; +static int hf_nfs4_fattr_umask_mask = -1; static int hf_nfs4_who = -1; static int hf_nfs4_server = -1; static int hf_nfs4_fslocation = -1; @@ -6133,6 +6134,8 @@ static const value_string fattr4_names[] = { { FATTR4_CHANGE_ATTR_TYPE, "Change_Attr_Type" }, #define FATTR4_SECURITY_LABEL 80 { FATTR4_SECURITY_LABEL, "Security_Label" }, +#define FATTR4_MODE_UMASK 81 + { FATTR4_MODE_UMASK, "Mode_Umask" }, { 0, NULL } }; static value_string_ext fattr4_names_ext = VALUE_STRING_EXT_INIT(fattr4_names); @@ -6717,6 +6720,14 @@ dissect_nfs4_security_label(tvbuff_t *tvb, proto_tree *tree, int offset) return offset; } +static int +dissect_nfs4_mode_umask(tvbuff_t *tvb, proto_tree *tree, int offset) +{ + offset = dissect_nfs4_mode(tvb, offset, tree); + offset = dissect_rpc_uint32(tvb, tree, hf_nfs4_fattr_umask_mask, offset); + return offset; +} + #define FATTR4_BITMAP_ONLY 0 #define FATTR4_DISSECT_VALUES 1 @@ -7119,6 +7130,10 @@ dissect_nfs4_fattrs(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *t offset = dissect_nfs4_security_label(tvb, attr_tree, offset); break; + case FATTR4_MODE_UMASK: + offset = dissect_nfs4_mode_umask(tvb, attr_tree, offset); + break; + default: break; } @@ -12509,6 +12524,10 @@ proto_register_nfs(void) "label_format", "nfs.fattr4.security_label.lfs", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }}, + { &hf_nfs4_fattr_umask_mask, { + "umask", "nfs.fattr4.umask", FT_UINT32, BASE_OCT, + NULL, 0, NULL, HFILL }}, + { &hf_nfs4_fattr_security_label_pi, { "policy_id", "nfs.fattr4.security_label.pi", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},