summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-12-02 10:04:53 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-12-02 10:04:53 +0000
commitadc07b999f83cd7b0de785245e80a364d7449e3f (patch)
tree6e4d8599ce9e872e529deceffd9aa72290937f27
parentf5dc13757fe4f09e5c4c01f5f6190691fd30dc67 (diff)
downloadcygnal-adc07b999f83cd7b0de785245e80a364d7449e3f.tar.gz
cygnal-adc07b999f83cd7b0de785245e80a364d7449e3f.tar.bz2
cygnal-adc07b999f83cd7b0de785245e80a364d7449e3f.zip
* sec_auth.cc (str2lsa): Remove.
(str2buf2lsa): Remove. (lsaauth): Call RtlInitAnsiString instead of str2lsa and str2buf2lsa.
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/sec_auth.cc24
2 files changed, 10 insertions, 20 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index e8210988e..03b5f2183 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2014-12-02 Corinna Vinschen <corinna@vinschen.de>
+ * sec_auth.cc (str2lsa): Remove.
+ (str2buf2lsa): Remove.
+ (lsaauth): Call RtlInitAnsiString instead of str2lsa and str2buf2lsa.
+
+2014-12-02 Corinna Vinschen <corinna@vinschen.de>
+
* cygheap.cc (init_cygheap::init_installation_root): Fix typo in
comment.
diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc
index 3615588ef..b616c45e2 100644
--- a/winsup/cygwin/sec_auth.cc
+++ b/winsup/cygwin/sec_auth.cc
@@ -172,23 +172,6 @@ cygwin_logon_user (const struct passwd *pw, const char *password)
return hToken;
}
-static void
-str2lsa (LSA_STRING &tgt, const char *srcstr)
-{
- tgt.Length = strlen (srcstr);
- tgt.MaximumLength = tgt.Length + 1;
- tgt.Buffer = (PCHAR) srcstr;
-}
-
-static void
-str2buf2lsa (LSA_STRING &tgt, char *buf, const char *srcstr)
-{
- tgt.Length = strlen (srcstr);
- tgt.MaximumLength = tgt.Length + 1;
- tgt.Buffer = (PCHAR) buf;
- memcpy (buf, srcstr, tgt.MaximumLength);
-}
-
HANDLE
lsa_open_policy (PWCHAR server, ACCESS_MASK access)
{
@@ -971,7 +954,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
push_self_privilege (SE_TCB_PRIVILEGE, true);
/* Register as logon process. */
- str2lsa (name, "Cygwin");
+ RtlInitAnsiString (&name, "Cygwin");
SetLastError (0);
status = LsaRegisterLogonProcess (&name, &lsa_hdl, &sec_mode);
if (status != STATUS_SUCCESS)
@@ -986,7 +969,7 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
goto out;
}
/* Get handle to our own LSA package. */
- str2lsa (name, CYG_LSA_PKGNAME);
+ RtlInitAnsiString (&name, CYG_LSA_PKGNAME);
status = LsaLookupAuthenticationPackage (lsa_hdl, &name, &package_id);
if (status != STATUS_SUCCESS)
{
@@ -1000,7 +983,8 @@ lsaauth (cygsid &usersid, user_groups &new_groups, struct passwd *pw)
goto out;
/* Create origin. */
- str2buf2lsa (origin.str, origin.buf, "Cygwin");
+ stpcpy (origin.buf, "Cygwin");
+ RtlInitAnsiString (&origin.str, origin.buf);
/* Create token source. */
memcpy (ts.SourceName, "Cygwin.1", 8);
ts.SourceIdentifier.HighPart = 0;