X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type; q=dns; s=default; b=MY94AnE
	Hd0Sq1m5hvYXhdmta4XlFLKvy2gx+wyMTK4xRv1G+r9sevYgz18QiY+UOWsP6n15
	ZkLjKQYMBsMHxSi2UF8cZAtfeJ1FoZ5fO4kZVk1Y2CHi1bbJY/AY75OaYE3THPD8
	5/F8bt+Gj3c/9tGFiSNQN3xDDAU0ogwNO7CU=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:mime-version:references:in-reply-to:from:date
	:message-id:subject:to:content-type; s=default; bh=UTURjDDqzO9zq
	QPSmDaEpXFdkEU=; b=N549qHle2LS/f8vY5vLZnjqup4+IKIZqX4SnqgLUCKSEp
	ryyAueaBAk97E+XQszcOQmk41PF16n62SVxWQkdskzwNPAVh0ZJ3yqOVRkyR4s89
	k5NcbBrHLYDRdLN/0JX5eFKmyShtUdFAo/BG0nJhoTS7ObBHF4hCedp5mEwnV4=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=-5.7 required=5.0 tests=BAYES_40,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:mail.com, mailcom, mail.com, Hx-languages-length:1003
X-HELO: mout.gmx.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com;	s=dbd5af2cbaf7; t=1550591260;	bh=SuBpxMXn5/eVQBwy65lgIi7wuX5/MDQTYQTSncARG9s=;	h=X-UI-Sender-Class:References:In-Reply-To:From:Date:Subject:To;	b=eZB9p5HZgeQWtjKUbZKaSQzTCMHEiHU23atmrh3tHycCwEB5AQ8DfjyVNW2Kot5nV	 RBXU2+2tiDSPJF9GNDlCWCGQQlZ/pUjYqD1G/97aM4eEo4bv7OMNjS9ihucFomOXVm	 xO1Ra4ejSyOAK+J5Q9xAs4U6lEjUfdjlsEOopD+g=
X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79
MIME-Version: 1.0
References: <CANV9t=SNfgP-CA32yfPwLv2=d0F8xtpdCT4o_wwGFGE+F3SEuA@mail.gmail.com> <50cba8d1-4794-8db9-d1f3-ab9476421db7@gmx.com> <CANV9t=QQ1higAt1qeDF4fckkz_6eqQJtdhau8+uhrAvGtWUK_A@mail.gmail.com> <20190215163817.GI2702@calimero.vinschen.de> <CANV9t=Rm+su=qDqdFN-LqiMLEAHJD7WxW_OSqqSpqgeb6ir++w@mail.gmail.com> <20190215202936.GL2702@calimero.vinschen.de> <CANV9t=SdQPZw_VF95HwDrVRU1KzdHA61GJBRgA1weHryHUO6-w@mail.gmail.com> <20190215204326.GO2702@calimero.vinschen.de> <CANV9t=Q5M+V9TPEN-GaGzLtK_8AO5fUenajQ+T-VZX6+kbrMMw@mail.gmail.com> <20190215213159.GQ2702@calimero.vinschen.de> <CANV9t=QEz=L-ftqr06QZPxZSkhqGzrFS3s93s6ztBeKJk5WnjA@mail.gmail.com>
In-Reply-To: <CANV9t=QEz=L-ftqr06QZPxZSkhqGzrFS3s93s6ztBeKJk5WnjA@mail.gmail.com>
From: Bill Stewart <bstewart@iname.com>
Date: Tue, 19 Feb 2019 08:47:26 -0700
Message-ID: <CANV9t=SW+Zt7X6ERF+d9=PhqQrxA=HSKiLJA+Xvk52rZo88k2A@mail.gmail.com>
Subject: Re: Windows to Cygwin username mapping: Domain before local account when duplicate name?
To: cygwin@cygwin.com
Content-Type: text/plain; charset="UTF-8"
X-IsSubscribed: yes

On Fri, Feb 15, 2019 at 3:48 PM Bill Stewart wrote:

> This means that when I test getent using the name "Admin", Cygwin
> finds the domain group:
>
> PS C:\> getent -w passwd admin
> admin:nnnnnnnn:DOMAINNAME\admin:S-1-5-21-nnnnnnnnnn-nnnnnnnnn-nnnnnnnnn-nnnnnn
>
> I get that this is by design, but .NET finds the local account first,
> which is what I was expecting:
>
> PS C:\> $name = [Security.Principal.NTAccount] "admin"
> PS C:\> $sid = $name.Translate([Security.Principal.SecurityIdentifier])
> PS C:\> $sid.Translate([Security.Principal.NTAccount])
>
> Value
> -----
> COMPUTERNAME\Admin

So then - just to follow up - Cygwin is for sure going to stick with
"domain first" when resolving an account name that doesn't include an
authority.

(a) Is this correct?

(b) Is there a particular reason this order was chosen (instead of
local first, then domain, i.e., the usual Windows order)?

Thanks,

Bill

--
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

