* exception.h (class exception): Remove unnecessary #ifdef.
* uinfo.cc (client_request_pwdgrp::client_request_pwdgrp): Fix length counter to include trailing NUL. * sec_auth.cc (get_user_groups): Add experimental exception handler. (get_user_local_groups): Ditto.
This commit is contained in:
		| @@ -1,3 +1,12 @@ | |||||||
|  | 2014-09-05  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* exception.h (class exception): Remove unnecessary #ifdef. | ||||||
|  | 	* uinfo.cc (client_request_pwdgrp::client_request_pwdgrp): Fix length | ||||||
|  | 	counter to include trailing NUL. | ||||||
|  |  | ||||||
|  | 	* sec_auth.cc (get_user_groups): Add experimental exception handler. | ||||||
|  | 	(get_user_local_groups): Ditto. | ||||||
|  |  | ||||||
| 2014-09-05  Corinna Vinschen  <corinna@vinschen.de> | 2014-09-05  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* uinfo.cc (pwdgrp::fetch_account_from_windows): Handle APPLICATION | 	* uinfo.cc (pwdgrp::fetch_account_from_windows): Handle APPLICATION | ||||||
|   | |||||||
| @@ -126,17 +126,15 @@ public: | |||||||
|   ~exception () __attribute__ ((always_inline)) { _except_list = save; } |   ~exception () __attribute__ ((always_inline)) { _except_list = save; } | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #else | #else /* __x86_64__ */ | ||||||
|  |  | ||||||
| #define exception_list void | #define exception_list void | ||||||
| typedef struct _DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT; | typedef struct _DISPATCHER_CONTEXT *PDISPATCHER_CONTEXT; | ||||||
|  |  | ||||||
| class exception | class exception | ||||||
| { | { | ||||||
| #ifdef __x86_64__ |  | ||||||
|   static EXCEPTION_DISPOSITION myfault (EXCEPTION_RECORD *, exception_list *, |   static EXCEPTION_DISPOSITION myfault (EXCEPTION_RECORD *, exception_list *, | ||||||
| 					CONTEXT *, PDISPATCHER_CONTEXT); | 					CONTEXT *, PDISPATCHER_CONTEXT); | ||||||
| #endif |  | ||||||
|   static EXCEPTION_DISPOSITION handle (EXCEPTION_RECORD *, exception_list *, |   static EXCEPTION_DISPOSITION handle (EXCEPTION_RECORD *, exception_list *, | ||||||
| 				       CONTEXT *, PDISPATCHER_CONTEXT); | 				       CONTEXT *, PDISPATCHER_CONTEXT); | ||||||
| public: | public: | ||||||
| @@ -162,7 +160,7 @@ public: | |||||||
|   } |   } | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif /* !__x86_64 */ | #endif /* !__x86_64__ */ | ||||||
|  |  | ||||||
| class cygwin_exception | class cygwin_exception | ||||||
| { | { | ||||||
|   | |||||||
| @@ -20,6 +20,7 @@ details. */ | |||||||
| #include "fhandler.h" | #include "fhandler.h" | ||||||
| #include "dtable.h" | #include "dtable.h" | ||||||
| #include "cygheap.h" | #include "cygheap.h" | ||||||
|  | #include "exception.h" | ||||||
| #include "ntdll.h" | #include "ntdll.h" | ||||||
| #include "tls_pbuf.h" | #include "tls_pbuf.h" | ||||||
| #include <lm.h> | #include <lm.h> | ||||||
| @@ -255,9 +256,13 @@ get_user_groups (WCHAR *logonserver, cygsidlist &grp_list, | |||||||
|   DWORD cnt, tot, len; |   DWORD cnt, tot, len; | ||||||
|   NET_API_STATUS ret; |   NET_API_STATUS ret; | ||||||
|  |  | ||||||
|   /* Look only on logonserver */ |   { | ||||||
|   ret = NetUserGetGroups (logonserver, user, 0, (LPBYTE *) &buf, |     /* Experimental SEH */ | ||||||
| 			  MAX_PREFERRED_LENGTH, &cnt, &tot); |     exception protect; | ||||||
|  |     /* Look only on logonserver */ | ||||||
|  |     ret = NetUserGetGroups (logonserver, user, 0, (LPBYTE *) &buf, | ||||||
|  | 			    MAX_PREFERRED_LENGTH, &cnt, &tot); | ||||||
|  |   } | ||||||
|   if (ret) |   if (ret) | ||||||
|     { |     { | ||||||
|       __seterrno_from_win_error (ret); |       __seterrno_from_win_error (ret); | ||||||
| @@ -306,9 +311,14 @@ get_user_local_groups (PWCHAR logonserver, PWCHAR domain, | |||||||
|   DWORD cnt, tot; |   DWORD cnt, tot; | ||||||
|   NET_API_STATUS ret; |   NET_API_STATUS ret; | ||||||
|  |  | ||||||
|   ret = NetUserGetLocalGroups (logonserver, user, 0, LG_INCLUDE_INDIRECT, |   { | ||||||
| 			       (LPBYTE *) &buf, MAX_PREFERRED_LENGTH, |     /* Experimental SEH */ | ||||||
| 			       &cnt, &tot); |     exception protect; | ||||||
|  |  | ||||||
|  |     ret = NetUserGetLocalGroups (logonserver, user, 0, LG_INCLUDE_INDIRECT, | ||||||
|  | 				 (LPBYTE *) &buf, MAX_PREFERRED_LENGTH, | ||||||
|  | 				 &cnt, &tot); | ||||||
|  |   } | ||||||
|   if (ret) |   if (ret) | ||||||
|     { |     { | ||||||
|       __seterrno_from_win_error (ret); |       __seterrno_from_win_error (ret); | ||||||
|   | |||||||
| @@ -1968,7 +1968,7 @@ client_request_pwdgrp::client_request_pwdgrp (fetch_user_arg_t &arg, bool group) | |||||||
|       break; |       break; | ||||||
|     case NAME_arg: |     case NAME_arg: | ||||||
|       p = stpcpy (_parameters.in.arg.name, arg.name); |       p = stpcpy (_parameters.in.arg.name, arg.name); | ||||||
|       len = p - _parameters.in.arg.name; |       len = p - _parameters.in.arg.name + 1; | ||||||
|       break; |       break; | ||||||
|     case ID_arg: |     case ID_arg: | ||||||
|       _parameters.in.arg.id = arg.id; |       _parameters.in.arg.id = arg.id; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user