From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110914 invoked by alias); 15 Feb 2019 22:48:43 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 110709 invoked by uid 89); 15 Feb 2019 22:48:30 -0000 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 Received: from mout.gmx.com (HELO mout.gmx.com) (74.208.4.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 15 Feb 2019 22:48:28 +0000 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 Received: from mail-lf1-f52.google.com ([209.85.167.52]) by mail.gmx.com (mrgmxus002 [74.208.5.15]) with ESMTPSA (Nemesis) id 0MMjsH-1gzU2T1B43-008aN5 for ; Fri, 15 Feb 2019 23:48:22 +0100 Received: by mail-lf1-f52.google.com with SMTP id t14so8352856lfk.7 for ; Fri, 15 Feb 2019 14:48:21 -0800 (PST) MIME-Version: 1.0 References: <50cba8d1-4794-8db9-d1f3-ab9476421db7@gmx.com> <20190215163817.GI2702@calimero.vinschen.de> <20190215202936.GL2702@calimero.vinschen.de> <20190215204326.GO2702@calimero.vinschen.de> <20190215213159.GQ2702@calimero.vinschen.de> In-Reply-To: <20190215213159.GQ2702@calimero.vinschen.de> From: Bill Stewart Date: Sat, 16 Feb 2019 01:05:00 -0000 Message-ID: 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 X-SW-Source: 2019-02/txt/msg00216.txt.bz2 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