diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-01-23 17:02:30 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-01-23 17:02:30 +0000 |
commit | 76e4f83fc6c68cfe319df5cad0ab7e65cd6eb4e9 (patch) | |
tree | 24c6fbbffc55b54b1abae1f5fff91ee4d879a7fa /winsup/cygwin/setlsapwd.cc | |
parent | 6485b9c27420c971d7fbc20acf841bd8f519e84f (diff) | |
download | newlib-76e4f83fc6c68cfe319df5cad0ab7e65cd6eb4e9.zip newlib-76e4f83fc6c68cfe319df5cad0ab7e65cd6eb4e9.tar.gz newlib-76e4f83fc6c68cfe319df5cad0ab7e65cd6eb4e9.tar.bz2 |
* security.h (open_local_policy): Remove declaration.
(lsa_open_policy): Declare.
(lsa_close_policy): Declare.
* sec_auth.cc (lsa_open_policy): Rename from open_local_policy. Take
server name as parameter. Return NULL in case of error, rather than
INVALID_HANDLE_VALUE.
(lsa_close_policy): Rename from close_local_policy. Make externally
available. Get handle by value.
(create_token): Convert call to open_local_policy/close_local_policy
according to aforementioned changes.
(lsaauth): Ditto.
(lsaprivkeyauth): Ditto.
* setlsapwd.cc (setlsapwd): Ditto.
Diffstat (limited to 'winsup/cygwin/setlsapwd.cc')
-rw-r--r-- | winsup/cygwin/setlsapwd.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/cygwin/setlsapwd.cc b/winsup/cygwin/setlsapwd.cc index 8e1baa9..e86696b 100644 --- a/winsup/cygwin/setlsapwd.cc +++ b/winsup/cygwin/setlsapwd.cc @@ -1,6 +1,6 @@ /* setlsapwd.cc: Set LSA private data password for current user. - Copyright 2008, 2009, 2011 Red Hat, Inc. + Copyright 2008, 2009, 2011, 2014 Red Hat, Inc. This file is part of Cygwin. @@ -71,8 +71,7 @@ setlsapwd (const char *passwd, const char *username) if (data_buf) RtlInitUnicodeString (&data, data_buf); /* First try it locally. Works for admin accounts. */ - if ((lsa = open_local_policy (POLICY_CREATE_SECRET)) - != INVALID_HANDLE_VALUE) + if (!(lsa = lsa_open_policy (NULL, POLICY_CREATE_SECRET))) { NTSTATUS status = LsaStorePrivateData (lsa, &key, data.Length ? &data : NULL); @@ -83,7 +82,7 @@ setlsapwd (const char *passwd, const char *username) ret = 0; else __seterrno_from_nt_status (status); - LsaClose (lsa); + lsa_close_policy (lsa); } else if (ret && !username) { |