]> sourceware.org Git - newlib-cygwin.git/commit
uinfo: special-case IIS APPPOOL accounts
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 22 May 2023 11:12:56 +0000 (13:12 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 6 Jun 2023 13:18:53 +0000 (15:18 +0200)
commite9dd5d8f2585293cb5fa0d86fc14e06156b65e19
treedef5dbd30178c749a2304184400d67143d9cccc6
parenta9038789488e7cdac5a30898fc3b064782646108
uinfo: special-case IIS APPPOOL accounts

The account under which Azure Web Apps run is an IIS APPOOL account that
is generated on the fly.

These are special because the virtual machines on which thes Apps run
are not domain-joined, yet the accounts are domain accounts.

To support the use case where such a Web App needs to call `ssh` (e.g.
to deploy from a Git repository that is accessible only via SSH), we do
need OpenSSH's `getpwuid (getuid ())` invocation to work.

But currently it does not. Concretely, `getuid ()` returns -1 for these
accounts, and OpenSSH fails to find the correct home directory
(_especially_ when that home directory was overridden via a `db_home:
env` line in `/etc/nsswitch.conf`).

This can be verified e.g. in a Kudu console (for details about Kudu
consoles, see https://github.com/projectkudu/kudu/wiki/Kudu-console):
the domain is `IIS APPPOOL`, the account name is the name of the Azure
Web App, the SID starts with 'S-1-5-82-`, and
`pwdgrp::fetch_account_from_windows()` runs into the code path where
"[...] the domain returned by LookupAccountSid is not our machine name,
and if our machine is no domain member, we lose.  We have nobody to ask
for the POSIX offset."

Since these IIS APPPOOL accounts are relatively similar to AzureAD
accounts in this scenario, let's imitate the latter to support also the
former.

Reported-by: David Ebbo <david.ebbo@gmail.com>
Helped-by: Corinna Vinschen <corinna@vinschen.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
winsup/cygwin/uinfo.cc
This page took 0.031884 seconds and 5 git commands to generate.