Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Alexander Bokovoy <ab@samba.org>
To: Steve French <smfrench@gmail.com>
Cc: "Till Dörges" <doerges@pre-sense.de>,
	linux-cifs <linux-cifs@vger.kernel.org>,
	samba-technical <samba-technical@lists.samba.org>
Subject: Re: Using UPN with mount.cifs?
Date: Tue, 15 Jul 2025 08:59:36 +0300	[thread overview]
Message-ID: <aHXuSKMsQsPWd5NC@toolbx> (raw)
In-Reply-To: <CAH2r5mtgWfxQtoy2gwnMiWM3HXno2icuWmiuhMJ64yTAi_jsyQ@mail.gmail.com>

On Пан, 14 ліп 2025, Steve French via samba-technical wrote:
> This is an interesting question.
> 
> mount.cifs will pass it (the UPN) down to cifs.ko so it will get sent
> on the wire, so behavior will vary by server.

Is this with GSSAPI krb5 or NTLMSSP?

For GSSAPI we either expect already existing credential or initialize it
from a keytab. In the first case cifs.upcall is not doing anything to
enable enteprise principal because it is not handling the initial ticket
acquisition. In the second case it doesn't do anything to mark the
client principal as an enteprise one.

The difference is by how that client principal is marked down in GSSAPI
negotiation. It needs two parts:

 - a client name should be an enterprise principal,
 - client code should make sure it sets a flag to accept rewrites of
   its own client principal name by the KDC in the returned ticket
   (principal canonicalization).

Neither is done by the cifs.upcall. More to that, for GSSAPI krb5 the
username passed to the cifs.upcall is pretty much ignored except for the
keytab initialization.

With NTLMSSP you don't really have 'enterprise principals', as it is up
to the SMB server to interpret the name you passed.

The client has nothing to indicate that. A server may consider
interpreting it as a local machine-provided one (username=testuser), or
consider to map it into the local one even if it has domain name
explicitly set (such as with IAKERB case on a standalone Windows).

> 
> I tried it to current Samba (passing "username=testuser" and also
> "username=testuser@somedomain" and also for
> "username=testuser,domain=somedomain") and it worked fine for all
> three cases (with and without UPN, with and without "domain=").
> 
> Trying it to Windows though:
> 1) "username=testuser" worked
> 2) "username=testuser,domain=somedomain"  worked
> 3) "username=testuser@somedomain"  did not work to Windows server
> 
> So looks like the behavior varies by server, but safest way is to
> specify the UPN as "username=" and "domain=" rather than
> username=someuser@somedomain
> 
> On Mon, Jul 14, 2025 at 7:44 AM Till Dörges <doerges@pre-sense.de> wrote:
> >
> > Hello everyone,
> >
> >
> > I'm wondering whether it is possible to use User Principal Names (UPN) instead of
> > accountnames + workgroup/domain, when mounting a share with mount.cifs?
> >
> >
> > The man page for mount.cifs does not mention UPN. A quick grep through the latest
> > sources (cifs-utils-7.4) doesn't mention UPN either.
> >
> > Searching the ML in particular and the web in general came up emtpy, too.
> >
> >
> > So, is there a way to do it?
> >
> >
> > Thanks and regards -- Till
> >
> > --
> > Dipl.-Inform. Till Dörges                  doerges@pre-sense.de
> >
> >                                          www.pre-sense.de/fcknzs
> >
> > PRESENSE Technologies GmbH             Nagelsweg 41, D-20097 HH
> > Geschäftsführer/Managing Director        AG Hamburg, HRB 107844
> > Till Dörges                              USt-IdNr.: DE263765024
> >
> 
> 
> -- 
> Thanks,
> 
> Steve
> 

-- 
/ Alexander Bokovoy

  reply	other threads:[~2025-07-15  5:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 12:43 Using UPN with mount.cifs? Till Dörges
2025-07-14 17:23 ` Steve French
2025-07-15  5:59   ` Alexander Bokovoy [this message]
2025-07-16  6:45     ` Till Dörges
     [not found]       ` <CAH2r5mvSEv1RGyjpsPg9s8auS5hb9sF4xVNUsetKf1ZkEXJnfA@mail.gmail.com>
2025-07-17  8:15         ` Till Dörges

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=aHXuSKMsQsPWd5NC@toolbx \
    --to=ab@samba.org \
    --cc=doerges@pre-sense.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=smfrench@gmail.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