https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=dbd662300b77739e702574fbd2f9167070e58c21

commit dbd662300b77739e702574fbd2f9167070e58c21
Author:     Corinna Vinschen <[email protected]>
AuthorDate: Mon Jan 20 13:27:57 2025 +0100
Commit:     Corinna Vinschen <[email protected]>
CommitDate: Mon Jan 20 13:27:57 2025 +0100

    Cygwin: seteuid: set errno if TranslateNameW fails
    
    The call to TranslateNameW in s4uauth can fail and the code
    leaves the function indicating an error, if so.  It just
    misses to set errno in this case, so add that.
    
    Fixes: 0fb497165f85 ("Cygwin: seteuid: use Kerberos/MsV1_0 S4U 
authentication by default")
    Signed-off-by: Corinna Vinschen <[email protected]>

Diff:
---
 winsup/cygwin/sec/auth.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/winsup/cygwin/sec/auth.cc b/winsup/cygwin/sec/auth.cc
index 43b58038936e..f9906a55c6a0 100644
--- a/winsup/cygwin/sec/auth.cc
+++ b/winsup/cygwin/sec/auth.cc
@@ -815,6 +815,7 @@ s4uauth (bool logon, PCWSTR domain, PCWSTR user, NTSTATUS 
&ret_status)
                              translated_name, &size) == 0)
            {
              debug_printf ("TranslateNameW(%W, NameCanonical) %E", sam_name);
+             __seterrno ();
              goto out;
            }
          p = wcschr (translated_name, L'/');

Reply via email to