]> sourceware.org Git - newlib-cygwin.git/commitdiff
* autoload.cc: Make autoloaded ntdll function non-optional. Ditto for
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 26 Feb 2011 20:47:56 +0000 (20:47 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 26 Feb 2011 20:47:56 +0000 (20:47 +0000)
secur32 functions, except for LsaRegisterLogonProcess.  Change return
value to ERROR_PROC_NOT_FOUND.  Explain why.
* sec_auth.cc (lsaauth): Handle ERROR_PROC_NOT_FOUND from call to
LsaRegisterLogonProcess when generating the errno value.

winsup/cygwin/ChangeLog
winsup/cygwin/autoload.cc
winsup/cygwin/sec_auth.cc

index 6b2de4099e6b476db2deae92863d6c150dc264cb..c2ea0aede320e96971e118e3e1f3bd997a1ef3e0 100644 (file)
@@ -1,3 +1,11 @@
+2011-02-26  Corinna Vinschen  <corinna@vinschen.de>
+
+       * autoload.cc: Make autoloaded ntdll function non-optional.  Ditto for
+       secur32 functions, except for LsaRegisterLogonProcess.  Change return
+       value to ERROR_PROC_NOT_FOUND.  Explain why.
+       * sec_auth.cc (lsaauth): Handle ERROR_PROC_NOT_FOUND from call to
+       LsaRegisterLogonProcess when generating the errno value.
+
 2011-02-22  Corinna Vinschen  <corinna@vinschen.de>
 
        * dcrt0.cc: Fix copyright dates.
index 4587468c4c4446b36a7391930eebc983a81e1ca7..2bf2f5ed7e88413b7730d7ccbabc7193514867d7 100644 (file)
@@ -369,14 +369,11 @@ LoadDLLfunc (NetUserGetGroups, 28, netapi32)
 LoadDLLfunc (NetUserGetInfo, 16, netapi32)
 LoadDLLfunc (NetUserGetLocalGroups, 32, netapi32)
 
-/* 0xc000007a == STATUS_PROCEDURE_NOT_FOUND */
-#define LoadDLLfuncNt(name, n, dllname) \
-  LoadDLLfuncEx2(name, n, dllname, 1, 0xc000007a)
-LoadDLLfuncNt (NtCommitTransaction, 8, ntdll)
-LoadDLLfuncNt (NtCreateTransaction, 40, ntdll)
-LoadDLLfuncNt (NtRollbackTransaction, 8, ntdll)
-LoadDLLfuncNt (RtlGetCurrentTransaction, 0, ntdll)
-LoadDLLfuncNt (RtlSetCurrentTransaction, 4, ntdll)
+LoadDLLfunc (NtCommitTransaction, 8, ntdll)
+LoadDLLfunc (NtCreateTransaction, 40, ntdll)
+LoadDLLfunc (NtRollbackTransaction, 8, ntdll)
+LoadDLLfunc (RtlGetCurrentTransaction, 0, ntdll)
+LoadDLLfunc (RtlSetCurrentTransaction, 4, ntdll)
 
 LoadDLLfunc (CoTaskMemFree, 4, ole32)
 
@@ -389,12 +386,16 @@ LoadDLLfuncEx (QueryWorkingSet, 12, psapi, 1)
 LoadDLLfunc (UuidCreate, 4, rpcrt4)
 LoadDLLfuncEx (UuidCreateSequential, 4, rpcrt4, 1)
 
-/* secur32 functions return NTSTATUS values. */
-LoadDLLfuncNt (LsaDeregisterLogonProcess, 4, secur32)
-LoadDLLfuncNt (LsaFreeReturnBuffer, 4, secur32)
-LoadDLLfuncNt (LsaLogonUser, 56, secur32)
-LoadDLLfuncNt (LsaLookupAuthenticationPackage, 12, secur32)
-LoadDLLfuncNt (LsaRegisterLogonProcess, 12, secur32)
+LoadDLLfunc (LsaDeregisterLogonProcess, 4, secur32)
+LoadDLLfunc (LsaFreeReturnBuffer, 4, secur32)
+LoadDLLfunc (LsaLogonUser, 56, secur32)
+LoadDLLfunc (LsaLookupAuthenticationPackage, 12, secur32)
+/* secur32 functions return NTSTATUS values.  However, the error code must
+   fit in a single byte, see LoadDLLprime.
+   The calling function, lsaauth(), checks for STATUS_SUCCESS (0), so we
+   simply return some arbitrary non-0 value (127 == ERROR_PROC_NOT_FOUND)
+   from here, if the function can't be loaded. */
+LoadDLLfuncEx2 (LsaRegisterLogonProcess, 12, secur32, 1, 127)
 
 LoadDLLfunc (SHGetDesktopFolder, 4, shell32)
 
index 8af0b9837a2cf6d505995018fed6516428ca70c2..9f27f9d6de6c7496b62e72e77d9f6217a8f6014c 100644 (file)
@@ -1,7 +1,7 @@
 /* sec_auth.cc: NT authentication functions
 
    Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-   2006, 2007, 2008, 2009, 2010 Red Hat, Inc.
+   2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -967,7 +967,8 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
   if (ret != STATUS_SUCCESS)
     {
       debug_printf ("LsaRegisterLogonProcess: %p", ret);
-      __seterrno_from_win_error (LsaNtStatusToWinError (ret));
+      __seterrno_from_win_error (ret == ERROR_PROC_NOT_FOUND
+                                ? ret : LsaNtStatusToWinError (ret));
       goto out;
     }
   else if (GetLastError () == ERROR_PROC_NOT_FOUND)
This page took 0.03943 seconds and 5 git commands to generate.