From 76e4f83fc6c68cfe319df5cad0ab7e65cd6eb4e9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 23 Jan 2014 17:02:30 +0000 Subject: * 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. --- winsup/cygwin/setlsapwd.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'winsup/cygwin/setlsapwd.cc') 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) { -- cgit v1.1