[Samba] difference between '%u' and '%U'?

Michael Wood esiotrot at gmail.com
Thu Aug 11 05:24:12 MDT 2011


On 11 August 2011 06:50, Linda Walsh <samba at tlinx.org> wrote:
> I realized in looking at my smb.conf, I'm not using these in
> a consistent manner, and .... well I just don't understand what the
> differences are between them.
> Sure I can read the smb.conf page:
>  %U
>           session username (the username that the client wanted, not
>           necessarily the same as the one they got).
> vs.
>  %u
>           username of the current service, if any.
> ---

I must say those descriptions don't tell me what the difference is
between them.  The parenthetical note for %U hints that perhaps with
an unacceptable username (e.g. very long, like David says) would get
mangled in which case I would guess %U is the full username and %u is
the mangled one.  But that's just a guess.  It would be nice if the
documentation were more explicit.

> So if I use %U, what name might I get 'instead'?
> For example, MS, seems to save my profile under 'user.V2'...even
> though my smb config has:
>        logon path = \\%D\%U\profile
>        logon home = \\%D\%U
>        logon drive = i:
> But my 'home' is always set to  /home/Domain/User,
> but my profile (under W7), is stored under /home/Domain/User.V2...
> So when my home dir is mounted, I don't see the 'appdir' of *my*
> profile, but the appdir of an XP login (which has caused more than
> a little bit of confusion over the years)....
> Now, I 'hack' around this by mounting 'i:' manually,
> and setting it to '/home/Domain/User.V2'....(which still feels
> like a 'hack', but at least my homedir contains my profile and
> not my XP profile!
> So how are %u and %U supposed to be different?   Should one evaluate
> to 'User.V2'?

I believe the ".V2" has nothing to do with %U or %u, but is just
something newer versions of Windows (from Vista?) tack on to the
profile name because the newer profiles are not compatible with older
(e.g. XP) profiles.

Michael Wood <esiotrot at gmail.com>

More information about the samba mailing list