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=yQqfdt7
	iVzDr33JobPPpDgkOjD/zpS8bYPfv35AWD8ABnYtVRBYt2VA6vObDUICDwpb+8lu
	C9oWjJwBcGZerXrkFozqptYtp0qB3NFJ51Lqe1mlyAd9v466yidXmkrmvMMeQDLd
	4SmeSbGXJiwVcdfbKB6Cl3K0gHmmnDmFYzog=
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=GGv3ckJAJ7Wzr
	+tLHOYspZFFTbE=; b=mnS7TjjUwxL2LYyPD8LseDB3qHyg5vZbHjk1YWn+3kGV0
	zJWbzwXtSNnXlRibRzyMMef4xVO0cO8MSwRmY+hDFiVrLv4SYSAUnGDoFAPibhg8
	ZHRCMjhG027sqFv4cf/5XSQjLFfwMe4lag6vE1aT/Q1I0ZyUv9Ms3/gIgRiZ2U=
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=-7.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Admin, 25000, password, Administrator
X-HELO: mout.gmx.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com;	s=dbd5af2cbaf7; t=1550270902;	bh=boflN74i16n9z+08Vpb+prS3wJTaSt1EGBAzV+yxjao=;	h=X-UI-Sender-Class:References:In-Reply-To:From:Date:Subject:To;	b=Bk/472AFBOjt5UpVAiBoa9XClMa18EHQtN9wwuVFltsoEjtZZLsknWxxFYCmYA7H4	 D6T2rn0mJtrR6sXcf71qcXx6ygOrd/WbLoAn9/eSCoh+pNAoesqK4Mr3PTaj7Ck9Wq	 U5b1iLz/iZeenj3WPF+mLkHM5PeTaI7TpJn8K56I=
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>
In-Reply-To: <20190215213159.GQ2702@calimero.vinschen.de>
From: Bill Stewart <bstewart@iname.com>
Date: Fri, 15 Feb 2019 15:48:08 -0700
Message-ID: <CANV9t=QEz=L-ftqr06QZPxZSkhqGzrFS3s93s6ztBeKJk5WnjA@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 2:32 PM Corinna Vinschen wrote:

> What is a "typical" order?!?
>
> If you login locally to a domain member machine the default domain is
> the logon domain of this machine.  If that's not what you want you have
> to choose the logon domain of your account explicitely, even if it's the
> local machine SAM.  Windows will not try to find the user name locally
> if you didn't chose it explicitely.  You get "The user name or password
> is incorrect. Try again" instead.
>
> The only exception I'm aware of is the "Administrator" account, at least
> in Windows 10.

Here's a real-world scenario you might not have considered...

I have a local account named "Admin" on my computer I use for
administrative tasks.

My computer is a member of a medium-side domain (about 25000 users),
and at some point in the past an admin created a group named "Admin"
that I didn't even know existed.

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

Hence the question.

Regards,

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

