From: Boris Protopopov <boris.v.protopopov@gmail.com>
To: Shyam Prasad N <nspmangalore@gmail.com>
Cc: Boris Protopopov <pboris@amazon.com>,
Steven French <sfrench@samba.org>,
CIFS <linux-cifs@vger.kernel.org>,
samba-technical <samba-technical@lists.samba.org>,
LKML <linux-kernel@vger.kernel.org>,
samjonas@amazon.com
Subject: Re: [PATCH 2/2] Add SMB 2 support for getting and setting SACLs
Date: Fri, 18 Dec 2020 13:40:01 -0500 [thread overview]
Message-ID: <CAHhKpQ4qKjZGboa=y=Yq8WAMtDE6UXDr-3vaRvtFJqbmnkXPCQ@mail.gmail.com> (raw)
In-Reply-To: <CANT5p=oMDGHSMOCgOrz6S9tuB3BmbL4mLqsC4vqSPod8pWsTaA@mail.gmail.com>
No objections on my part as far as adding 'if (info & SACL_SECINFO) return'.
I had originally those flags sent from the caller, but that was
confusing at the top level (e.g. in cifsacl.c), so I have opted to
passing only "extra" flags ("additional" was already taken).
-------------
...
> > --- a/fs/cifs/smb2ops.c
> > +++ b/fs/cifs/smb2ops.c
> > @@ -3315,9 +3315,9 @@ get_smb2_acl(struct cifs_sb_info *cifs_sb,
> > struct cifs_ntsd *pntsd = NULL;
> > struct cifsFileInfo *open_file = NULL;
> >
> > - if (inode)
> > + if (inode && !(info & SACL_SECINFO))
> > open_file = find_readable_file(CIFS_I(inode), true);
> > - if (!open_file)
> > + if (!open_file || (info & SACL_SECINFO))
> > return get_smb2_acl_by_path(cifs_sb, path, pacllen, info);
> >
> > pntsd = get_smb2_acl_by_fid(cifs_sb, &open_file->fid, pacllen, info);
> Why not have an if (info & SACL_SECINFO) return
> get_smb2_acl_by_path... right at the beginning?
> Looks cleaner that way IMO.
>
...
> > diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> > index 0aeb63694306..b207e1eb6803 100644
> > --- a/fs/cifs/smb2pdu.c
> > +++ b/fs/cifs/smb2pdu.c
> > @@ -3472,8 +3472,10 @@ SMB311_posix_query_info(const unsigned int xid, struct cifs_tcon *tcon,
> > int
> > SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon,
> > u64 persistent_fid, u64 volatile_fid,
> > - void **data, u32 *plen, u32 additional_info)
> > + void **data, u32 *plen, u32 extra_info)
> > {
> > + __u32 additional_info = OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO |
> > + extra_info;
> I still prefer having these flags set by the caller. That way, the
> caller has the flexibility to query only the subset needed.
> --
> -Shyam
next prev parent reply other threads:[~2020-12-18 18:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 20:42 [PATCH] Add support for getting and setting SACLs Boris Protopopov
2020-12-01 18:49 ` Boris Protopopov
2020-12-02 10:43 ` Shyam Prasad N
2020-12-07 15:27 ` Boris Protopopov
2020-12-07 19:04 ` Pavel Shilovsky
2020-12-07 21:23 ` Boris Protopopov
2020-12-17 20:58 ` [PATCH 2/2] Add SMB 2 " Boris Protopopov
2020-12-18 18:02 ` Shyam Prasad N
2020-12-18 18:40 ` Boris Protopopov [this message]
2020-12-18 19:35 ` Steve French
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHhKpQ4qKjZGboa=y=Yq8WAMtDE6UXDr-3vaRvtFJqbmnkXPCQ@mail.gmail.com' \
--to=boris.v.protopopov@gmail.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nspmangalore@gmail.com \
--cc=pboris@amazon.com \
--cc=samba-technical@lists.samba.org \
--cc=samjonas@amazon.com \
--cc=sfrench@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).