* miscfuncs.h (NT_readline::close): New function to close handle.
(NT_readline::~NT_readline): Call close. * sec_auth.cc (verify_token): Use constructor to initialize tok_usersid. * security.h (cygsid::cygsid): Add copy constructor taking cygsid as source.
This commit is contained in:
		| @@ -1,3 +1,11 @@ | |||||||
|  | 2014-02-16  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
|  | 	* miscfuncs.h (NT_readline::close): New function to close handle. | ||||||
|  | 	(NT_readline::~NT_readline): Call close. | ||||||
|  | 	* sec_auth.cc (verify_token): Use constructor to initialize tok_usersid. | ||||||
|  | 	* security.h (cygsid::cygsid): Add copy constructor taking cygsid as | ||||||
|  | 	source. | ||||||
|  |  | ||||||
| 2014-02-16  Corinna Vinschen  <corinna@vinschen.de> | 2014-02-16  Corinna Vinschen  <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* dcrt0.cc (dll_crt0_1): Call initial_setlocale before fetching | 	* dcrt0.cc (dll_crt0_1): Call initial_setlocale before fetching | ||||||
|   | |||||||
| @@ -38,7 +38,8 @@ public: | |||||||
|   NT_readline () : fh (NULL) {} |   NT_readline () : fh (NULL) {} | ||||||
|   bool init (POBJECT_ATTRIBUTES attr, char *buf, ULONG buflen); |   bool init (POBJECT_ATTRIBUTES attr, char *buf, ULONG buflen); | ||||||
|   PCHAR gets (); |   PCHAR gets (); | ||||||
|   ~NT_readline () { if (fh) NtClose (fh); } |   void close () { if (fh) NtClose (fh); fh = NULL; } | ||||||
|  |   ~NT_readline () { close (); } | ||||||
| }; | }; | ||||||
|  |  | ||||||
| extern "C" void yield (); | extern "C" void yield (); | ||||||
|   | |||||||
| @@ -673,7 +673,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern) | |||||||
| 	*pintern = intern = !memcmp (ts.SourceName, "Cygwin.1", 8); | 	*pintern = intern = !memcmp (ts.SourceName, "Cygwin.1", 8); | ||||||
|     } |     } | ||||||
|   /* Verify usersid */ |   /* Verify usersid */ | ||||||
|   cygsid tok_usersid = NO_SID; |   cygsid tok_usersid (NO_SID); | ||||||
|   status = NtQueryInformationToken (token, TokenUser, &tok_usersid, |   status = NtQueryInformationToken (token, TokenUser, &tok_usersid, | ||||||
| 				    sizeof tok_usersid, &size); | 				    sizeof tok_usersid, &size); | ||||||
|   if (!NT_SUCCESS (status)) |   if (!NT_SUCCESS (status)) | ||||||
|   | |||||||
| @@ -222,6 +222,7 @@ public: | |||||||
|   inline cygsid () : cygpsid ((PSID) sbuf), well_known_sid (false) {} |   inline cygsid () : cygpsid ((PSID) sbuf), well_known_sid (false) {} | ||||||
|   inline cygsid (const PSID nsid) { *this = nsid; } |   inline cygsid (const PSID nsid) { *this = nsid; } | ||||||
|   inline cygsid (const char *nstrsid) { *this = nstrsid; } |   inline cygsid (const char *nstrsid) { *this = nstrsid; } | ||||||
|  |   inline cygsid (cygsid &nsid) { *this = nsid; } | ||||||
|  |  | ||||||
|   inline PSID set () { return psid = (PSID) sbuf; } |   inline PSID set () { return psid = (PSID) sbuf; } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user