Re: [PATCH 11/15] cifs: fix cifs_show_options to show "username=" or "multiuser"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 5 Oct 2010 17:01:18 -0500
Steve French <smfrench@xxxxxxxxx> wrote:

> In reviewing this patch which changes the show_options on cifs mounts
> to not display the network username (when multiuser mount flag is
> turned on) ie not display the username sent on SMB SessionSetup.
> 
> 1) Would there be value in showing the network (cifs) username that is
> associated with the uid (fsuid) of this process?  (Presumably the
> username we send in cifs sessionsetup could be slightly different than
> the local username for this unix uid).
> 

That'll make the output of /proc/mounts differ depending on "current".
Also, consider the case where random local user cats /proc/mounts (a
lot of scripts do that). Now we have to go find the tlink for him so we
can get to the session, which might mean an upcall to userspace to try
and establish one, several round trips to the server, etc. That seems
like a bad idea to me.

There might be value in getting at that info eventually but...

1) with krb5 it's absolutely worthless since we generally manufacture a
username based on the fsuid for multiuser mounts.

2) /proc/mounts is probably the wrong interface for such a thing.
When/if we are able to make multiuser mounts using non-krb5 auth, then
the user should be able to get at that info via the keyring...

> 2) In the future can't the domain name differ as well (so should we
> special case the domain name - or perhaps showing the default domain
> is fine?)
> 

Maybe. But for now there aren't multiple domains per mount. I think we
ought to keep this as simple as possible. We can always change that
later if the need arises.

> On Tue, Oct 5, 2010 at 4:59 PM, Steve French <smfrench@xxxxxxxxx> wrote:
> > In reviewing this patch which changes the show_options on cifs mounts to not
> > display the network username (when multiuser mount flag is turned on) ie not
> > display the username sent on SMB SessionSetup.
> >
> > 1) Would there be value in showing the network (cifs) username that is
> > associated with the uid (fsuid) of this process?  (Presumably the username
> > we send in cifs sessionsetup could be slightly different than the local
> > username for this unix uid).
> >
> > 2) In the future can't the domain name differ as well (so should we special
> > case the domain name - or perhaps showing the default domain is fine?)
> >
> > On Mon, Sep 20, 2010 at 6:01 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> >>
> >> ...based on CIFS_MOUNT_MULTIUSER flag.
> >>
> >> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> >> ---
> >>  fs/cifs/cifsfs.c |    6 +++++-
> >>  1 files changed, 5 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
> >> index 2b897e3..51090cec 100644
> >> --- a/fs/cifs/cifsfs.c
> >> +++ b/fs/cifs/cifsfs.c
> >> @@ -371,8 +371,12 @@ cifs_show_options(struct seq_file *s, struct vfsmount
> >> *m)
> >>        srcaddr = (struct sockaddr *)&tcon->ses->server->srcaddr;
> >>
> >>        seq_printf(s, ",unc=%s", tcon->treeName);
> >> -       if (tcon->ses->userName)
> >> +
> >> +       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER)
> >> +               seq_printf(s, ",multiuser");
> >> +       else if (tcon->ses->userName)
> >>                seq_printf(s, ",username=%s", tcon->ses->userName);
> >> +
> >>        if (tcon->ses->domainName)
> >>                seq_printf(s, ",domain=%s", tcon->ses->domainName);
> >>
> >> --
> >> 1.7.2.3
> >>
> >
> >
> >
> > --
> > Thanks,
> >
> > Steve
> >
> 
> 
> 


-- 
Jeff Layton <jlayton@xxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux