delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/12/10/08:37:43

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 4BADbgE31174215
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 4BADbgE31174215
Authentication-Results: delorie.com;
dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=Pm8tlC6e
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD8003857BA3
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1733837860;
bh=QIYdzGPKjBycFTcroGa1HX3oF4WX+mReh+FtAKEXOs0=;
h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=Pm8tlC6eH2fCfhc9HwTasH2nlQq9rJoTiA40keKKTYOXCZAA7CkkA0JZEVp74PUGj
x2Kx3oU0O8dfoQHQP8IYnn/nMwn/MXbkuvGuBNt4cLmX/Gr8Z9EkZsUZA52rwdC7vv
GyXPvSdIUaZGM1+UB0XLLJAE2X0I4hTmTbj5+Apk=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 226003858423
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 226003858423
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733837792; cv=none;
b=YykBlJPcaElduRgI24mmED64fpfamFsmIgOaZr3Duz9t8tNYL0Vs+rsYL4iMPwpg8j4QpKi/mC/iVAQQO68fNpfJH+4vi7d3uhnL2P+y20LYni5iWqltCuKge9+g16JCfy5Rcl/mZikGM4z8mzTjwGJOqEjFTtFUq5joSk9iAcA=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1733837792; c=relaxed/simple;
bh=kO16lY4kDnVbY5bHVXFq1hebfugGBiCAX+5GJzwos4s=;
h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;
b=WbO/rf0JuEZYP2DhYdMsDeZPhNvpjUOvrHlxmKLyxC9oZxs78Kj/qJiqN+/xHAjGiNWYwYyziBdAhFreTsP3bPe5YuUKqzH1CQmawvJLy2STUWew4E9L1/OK9oAw0mlxE/NEXsDMXgeSMXjolIIoTDqozFDU0WOV7wNnb9Q3MWk=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 226003858423
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1733837790; x=1734442590;
h=to:subject:message-id:date:from:mime-version:x-gm-message-state
:from:to:cc:subject:date:message-id:reply-to;
bh=B/ljOWkOZXcUt6LuCF3qxjHChWXUcVcic68GIZ6DdGc=;
b=vAWrdJ0ZRJj2iPPsh9ALiQsqh+QM2jEk28ZYn41Aq1TGJ4hm7DEDbm0kkaR7r7PVRX
Np+LwVGPCZkrL9/ZRoUJdJ/b+BF95DsGg2CrYMDZw1pNcDSJ1vYi/h9adZyw8TlQcagR
V4n9DjZKh/5ywhDD637r6hXwOU+9rlZNTz4dv+NPDtdG3XoGe3VS/sQwLu9YgKGfyIIP
Lt3XLLXaTzs8on8HtOR9XrOmsEcDXtE44q/Q63m+gxWB+kmQFqikPrxnu8CjHFYcltog
IidBnPIJbqPYwv1jCmJVfQeu5WZwb/kNOdlvjzUqOB3fj7g2PMHc8hudbQ7kobrQEIl+
8s/A==
X-Gm-Message-State: AOJu0YzdEkNYgdhpvhFz7klMEM8t6MygdFkftXEXoHdihV/b6eyeKQXs
5In5TXQNd3yA5xwUJGdkp0TGKtPG9mvT8FLhZoSSsSeT7TYyJFQCLNakCB2oiqWnAKciu/1QrxQ
szuXw4fSxU+JLTH8RXoqOR+fh5ER+pO1jdwY=
X-Gm-Gg: ASbGncv70L1cTpskrR08qhCLrSmO1nNotMxc0x82kkhTogyxLq/qc3yfP3ApBV06cTg
eOL+dBn9FdcsS8nkpYg4FAEKu5BaS5sEg8Jw=
X-Google-Smtp-Source: AGHT+IFpcUuIcLjmrXX5mu1xC1GRhSiF8JMPGlnjX+V+fEdkkt2dJBHVWfiVqmK8PG+hBLVogPo2QsYU+iLVP583EKc=
X-Received: by 2002:a05:6402:3587:b0:5d3:d917:dd90 with SMTP id
4fb4d7f45d1cf-5d418502cc8mr5536361a12.6.1733837790319; Tue, 10 Dec 2024
05:36:30 -0800 (PST)
MIME-Version: 1.0
Date: Tue, 10 Dec 2024 14:35:54 +0100
Message-ID: <CALXu0UfQmvNfQ0UFfcTp1hvTYCzQ621ypCWUDuGrPj8wKddkQw@mail.gmail.com>
Subject: getent passwd which works for unprefixed Windows user names with both
local and domain users?
To: cygwin AT cygwin DOT com
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Cedric Blancher via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Cedric Blancher <cedric DOT blancher AT gmail DOT com>
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

Good afternoon!

We have a Win10 env with mixed local and domain accounts.
We cannot lookup up local AND domain users with just the plain
username from Windows. Instead we have to do lookups twice:

1. Configuration:
$ hostname
LAB14
$ getent passwd
LAB14+SW-Install:*:197611:197121:U-LAB14\SW-Install,S-1-5-21-521464686-2813731464-1693715110-1003:/home/SW-Install:/bin/bash

2. Looking up user by plain Windows user name fails:
$ getent passwd 'SW-Install' || echo fail
fail

3. Looking up user by Hostname plus Windows user name works:
$ getent passwd 'LAB14+SW-Install' || echo fail
LAB14+SW-Install:*:197611:197121:U-LAB14\SW-Install,S-1-5-21-521464686-2813731464-1693715110-1003:/home/SW-Install:/bin/bash

But I cannot lookup domain users with getent passwd
"${domainname}+${winusername}" or  getent passwd
"${hostname}+${winusername}"; only getent passwd "${winusername}"
works.

How can I lookup the passwd entries by plain unprefixed Windows user
name, for both local and domain users, without editing
/etc/nfsswitch.conf (IT policy says we are NOT to touch that file!!)

Ced
-- 
Cedric Blancher <cedric DOT blancher AT gmail DOT com>
[https://plus.google.com/u/0/+CedricBlancher/]
Institute Pasteur

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019