Cygwin: passwd/group: store account name case correct

When looking up valid accounts by name, LookupAccountName returns
a SID and a case-correct domain name.  However, the name was input
and LookupAccountName is case-insensitive, so the name is not
necessarily written the same way as in SAM or AD.

Fix that by doing a reverse lookup on the just fetched SID.  This
fetches the account name in the correct case.  Override the
incoming name with the case correct name from LookupAccountSid.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2019-02-13 11:10:55 +01:00
parent 43fa1aafa6
commit 9a3cc77b2a
2 changed files with 14 additions and 0 deletions

View File

@@ -109,3 +109,7 @@ Bug Fixes
- Fix O_APPEND handling on files when calling non-Cygwin applications
Addresses: https://cygwin.com/ml/cygwin/2019-02/msg00081.html
- Fix case correctness of passwd/group entries fetched via getpwnam
or getgrnam.
Addresses: https://cygwin.com/ml/cygwin/2019-02/msg00109.html