diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-02-16 16:02:18 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-02-16 16:02:18 +0000 |
commit | 1e705e29329a0bca000bfb1f199042ffedfe477b (patch) | |
tree | 3c90a8f7f99a7b49276bb5b4dc4881c28652be11 /winsup | |
parent | c18cbc8e6d1ddf3a91c960f7048d497c74c1d773 (diff) | |
download | cygnal-1e705e29329a0bca000bfb1f199042ffedfe477b.tar.gz cygnal-1e705e29329a0bca000bfb1f199042ffedfe477b.tar.bz2 cygnal-1e705e29329a0bca000bfb1f199042ffedfe477b.zip |
* 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.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 8 | ||||
-rw-r--r-- | winsup/cygwin/miscfuncs.h | 3 | ||||
-rw-r--r-- | winsup/cygwin/sec_auth.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/security.h | 1 |
4 files changed, 12 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5076711ec..ccd93b2ee 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,13 @@ 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> + * dcrt0.cc (dll_crt0_1): Call initial_setlocale before fetching current user information. diff --git a/winsup/cygwin/miscfuncs.h b/winsup/cygwin/miscfuncs.h index 66dfc900a..e42940c1a 100644 --- a/winsup/cygwin/miscfuncs.h +++ b/winsup/cygwin/miscfuncs.h @@ -38,7 +38,8 @@ public: NT_readline () : fh (NULL) {} bool init (POBJECT_ATTRIBUTES attr, char *buf, ULONG buflen); PCHAR gets (); - ~NT_readline () { if (fh) NtClose (fh); } + void close () { if (fh) NtClose (fh); fh = NULL; } + ~NT_readline () { close (); } }; extern "C" void yield (); diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 04dc6ca9f..3325da54f 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -673,7 +673,7 @@ verify_token (HANDLE token, cygsid &usersid, user_groups &groups, bool *pintern) *pintern = intern = !memcmp (ts.SourceName, "Cygwin.1", 8); } /* Verify usersid */ - cygsid tok_usersid = NO_SID; + cygsid tok_usersid (NO_SID); status = NtQueryInformationToken (token, TokenUser, &tok_usersid, sizeof tok_usersid, &size); if (!NT_SUCCESS (status)) diff --git a/winsup/cygwin/security.h b/winsup/cygwin/security.h index 8edd76833..f283674dc 100644 --- a/winsup/cygwin/security.h +++ b/winsup/cygwin/security.h @@ -222,6 +222,7 @@ public: inline cygsid () : cygpsid ((PSID) sbuf), well_known_sid (false) {} inline cygsid (const PSID nsid) { *this = nsid; } inline cygsid (const char *nstrsid) { *this = nstrsid; } + inline cygsid (cygsid &nsid) { *this = nsid; } inline PSID set () { return psid = (PSID) sbuf; } |