Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Paulo Alcantara <pc@manguebit.com>
To: Shyam Prasad N <nspmangalore@gmail.com>
Cc: meetakshisetiyaoss@gmail.com, smfrench@gmail.com,
	sfrench@samba.org, sprasad@microsoft.com, tom@talpey.com,
	linux-cifs@vger.kernel.org, bharathsm.hsk@gmail.com,
	Meetakshi Setiya <msetiya@microsoft.com>
Subject: Re: [PATCH 1/2] cifs: during remount, make sure passwords are in sync
Date: Mon, 11 Nov 2024 09:03:56 -0300	[thread overview]
Message-ID: <b8164b0a49ad6d4cd60142fa55ad3566@manguebit.com> (raw)
In-Reply-To: <CANT5p=pFCbi1H-JzRLx5XqL4Qwy-YbOWAX6XmoWXezSn2i__mQ@mail.gmail.com>

Shyam Prasad N <nspmangalore@gmail.com> writes:

> On Fri, Nov 8, 2024 at 5:47 PM Shyam Prasad N <nspmangalore@gmail.com> wrote:
>> > What about SMB sessions from cifs_tcon::dfs_ses_list?  I don't see their
>> > password getting updated over remount.
>>
>> This is in our to-do list as well.
>
> I did some code reading around how DFS automount works.
> @Paulo Alcantara Correct me if I'm wrong, but it sounds like we make
> an assumption that when a DFS namespace has a junction to another
> share, the same credentials are to be used to perform the mount of
> that share. Is that always the case?

Yes, it inherits fs_context from the parent mount.  For multiuser
mounts, when uid/gid/cruid are unspecified, we need to update its values
to match real uid/gid from the calling process.

> If we go by that assumption, for password2 to work with DFS mounts, we
> only need to make sure that in cifs_do_automount, cur_ctx passwords
> are synced up to the current ses passwords. That should be quite easy.

Correct.  The fs_context for the automount is dup'ed from the parent
mount.  smb3_fs_context_dup() already dups password2, so it should work.

The 'remount' case isn't still handled, that's why I mentioned it above.
You'd need to set password2 for all sessios in @tcon->dfs_ses_list.

I think we need to update password2 for the multiuser sessions as well
and not only for session from master tcon.

  reply	other threads:[~2024-11-11 12:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30 14:27 [PATCH 1/2] cifs: during remount, make sure passwords are in sync meetakshisetiyaoss
2024-10-30 14:27 ` [PATCH 2/2] cifs: support mounting with alternate password to allow password rotation meetakshisetiyaoss
2024-11-07 19:05   ` Paulo Alcantara
2024-11-08 12:13     ` Shyam Prasad N
2024-11-08 15:20       ` Paulo Alcantara
2024-11-13 11:43         ` Meetakshi Setiya
2024-11-07 18:31 ` [PATCH 1/2] cifs: during remount, make sure passwords are in sync Paulo Alcantara
2024-11-08 12:17   ` Shyam Prasad N
2024-11-08 18:19     ` Shyam Prasad N
2024-11-11 12:03       ` Paulo Alcantara [this message]
     [not found]         ` <CAFTVevVGMfkgsr31nN35-p+2nQZEXhHK8hPPF1EhfLmdtKdw+A@mail.gmail.com>
     [not found]           ` <CAFTVevVa81C3u5Wdc+egz8ZbSrNKF7uy6m=6Nd5YnKfeMfo1sA@mail.gmail.com>
2024-11-13 11:48             ` Meetakshi Setiya
2024-11-13 12:20               ` Meetakshi Setiya
2024-11-13 16:51             ` Steve French
2024-11-13 17:53               ` Jeremy Allison

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=b8164b0a49ad6d4cd60142fa55ad3566@manguebit.com \
    --to=pc@manguebit.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=meetakshisetiyaoss@gmail.com \
    --cc=msetiya@microsoft.com \
    --cc=nspmangalore@gmail.com \
    --cc=sfrench@samba.org \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    /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