public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: Windows to Cygwin username mapping: Domain before local account when duplicate name?
Date: Fri, 15 Feb 2019 21:48:00 -0000	[thread overview]
Message-ID: <3bace8f4-1097-9245-10e9-1ed54d1014f3@SystematicSw.ab.ca> (raw)
In-Reply-To: <CANV9t=Q5M+V9TPEN-GaGzLtK_8AO5fUenajQ+T-VZX6+kbrMMw@mail.gmail.com>

On 2019-02-15 13:59, Bill Stewart wrote:
> On Fri, Feb 15, 2019 at 1:43 PM Corinna Vinschen wrote:
>> More specific as the original text?  I'm hard pressed to accomplish
>> that.  Take note of the "domain member machine" property.
> I think I see the problem. The list I posted (above the one you are
> apparently referring to) has the search in a different order.
> The section that starts with "Let's discuss the SID<=>uid/gid mapping
> first. Here's how it works." states this order:
> * Well-known SIDs in the NT_AUTHORITY domain of the S-1-5-RID type
> * Other well-known SIDs in the NT_AUTHORITY domain (S-1-5-X-RID)
> * Other well-known SIDs
> * Logon SIDs
> * Accounts from the local machine's user DB (SAM)
> * Accounts from the machine's primary domain
> * Accounts from a trusted domain of the machine's primary domain
> In this list, local machine accounts are listed before domain accounts.
> Underneath that, there's a second section with examples that starts
> with "Now we have a semi-bijective mapping..." that has this order:
> * Well-known and builtin accounts will be named as in Windows:
>   "SYSTEM", "LOCAL", "Medium Mandatory Level", ...
> * If the machine is not a domain member machine, only local accounts
> can be resolved into names, so for ease of use, just the account names
> are used as Cygwin user/group names:
>   "corinna", "bigfoot", "None", ...
> * If the machine is a domain member machine, all accounts from the
> primary domain of the machine are mapped to Cygwin names without
> domain prefix:
>   "corinna", "bigfoot", "Domain Users", ...
> while accounts from other domains are prepended by their domain:
>   "DOMAIN1+corinna", "DOMAIN2+bigfoot", "DOMAIN3+Domain Users", ...
> * Local machine accounts of a domain member machine get a Cygwin user
> name the same way as accounts from another domain: The local machine
> name gets prepended:
>   "MYMACHINE+corinna", "MYMACHINE+bigfoot", "MYMACHINE+None", ...
> * If LookupAccountSid fails, Cygwin checks the accounts against the
> known trusted domains. If the account is from one of the trusted
> domains, an artificial account name is created. It consists of the
> domain name, and a special name created from the account RID:
> In the second list, it says domains are first before the local machine.
> I was assuming the first section is an orderly sequence of searching,
> since that's usually how Windows works.
> The second section with the examples seems to be a different order,
> and would seems to be the order Cygwin actually uses.
> I was just wondering if that's by design or by accident, since it's
> different from the typical order.

What it says is that an unprefixed name in a domain defaults to the name as if
prefixed by the primary domain, so if you want the local SAM entry on a domain
machine ($USERDOMAIN != $COMPUTERNAME), you must prefix the name with the local
machine name followed by "+".

Should the local machine name provided be $COMPUTERNAME or $HOSTNAME?

Windows normally allows "." to be used to refer to the local machine name in a
domain context - can anyone confirm or deny whether this works in Cygwin or with
getent?

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

  parent reply	other threads:[~2019-02-15 21:38 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-14 23:50 Bill Stewart
2019-02-15 10:05 ` Sam Edge (Cygwin)
2019-02-15 15:56   ` Bill Stewart
2019-02-15 16:05     ` Brian Inglis
2019-02-15 16:14     ` Andrey Repin
2019-02-15 16:51     ` Corinna Vinschen
2019-02-15 19:25       ` Bill Stewart
2019-02-15 20:30         ` Corinna Vinschen
2019-02-15 20:43           ` Bill Stewart
2019-02-15 20:50             ` Corinna Vinschen
2019-02-15 21:00               ` Bill Stewart
2019-02-15 21:38                 ` Corinna Vinschen
2019-02-15 21:51                   ` Bill Stewart
2019-02-16  1:05                   ` Bill Stewart
2019-02-16  1:26                     ` Andrey Repin
2019-02-19 16:15                     ` Bill Stewart
2019-02-19 17:20                       ` Bill Stewart
2019-02-19 19:02                       ` Andrey Repin
2019-02-15 21:48                 ` Brian Inglis [this message]
2019-02-15 22:19                   ` Bill Stewart
2019-02-16 13:12                     ` Corinna Vinschen
2019-02-16 15:33                       ` Brian Inglis
2019-02-16 15:35                         ` Corinna Vinschen
2019-02-16 17:14                           ` Brian Inglis
2019-02-16 17:43                             ` Corinna Vinschen
2019-02-18  9:14                               ` Corinna Vinschen
2019-02-15 21:00         ` Andrey Repin

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=3bace8f4-1097-9245-10e9-1ed54d1014f3@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).