This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
********************************************************/
struct con_struct {
- BOOL failed_connect;
+ bool failed_connect;
NTSTATUS err;
struct cli_state *cli;
struct rpc_pipe_client *lsapipe;
Close connection on context destruction.
********************************************************/
-static int cs_destructor(void *p)
+static int cs_destructor(struct con_struct *p)
{
if (cs->cli) {
cli_shutdown(cs->cli);
static struct con_struct *create_cs(TALLOC_CTX *ctx, NTSTATUS *perr)
{
NTSTATUS nt_status;
- struct in_addr loopback_ip = *interpret_addr2("127.0.0.1");;
+ struct sockaddr_storage loopback_ss;
*perr = NT_STATUS_OK;
+ if (!interpret_string_addr(&loopback_ss, "127.0.0.1", AI_NUMERICHOST)) {
+ *perr = NT_STATUS_INVALID_PARAMETER;
+ return NULL;
+ }
+
if (cs) {
if (cs->failed_connect) {
*perr = cs->err;
#endif
nt_status = cli_full_connection(&cs->cli, global_myname(), global_myname(),
- &loopback_ip, 0,
+ &loopback_ss, 0,
"IPC$", "IPC",
#if 0
opt_user_name,
struct con_struct *csp = NULL;
char **domains;
char **names;
- enum SID_NAME_USE *types;
+ enum lsa_SidType *types;
*ppdomain = NULL;
*ppname = NULL;
NTSTATUS nt_status;
struct con_struct *csp = NULL;
DOM_SID *sids = NULL;
- enum SID_NAME_USE *types = NULL;
+ enum lsa_SidType *types = NULL;
csp = create_cs(ctx, &nt_status);
if (csp == NULL) {
&csp->pol,
1,
&full_name,
- NULL, &sids,
- &types);
+ NULL, 1,
+ &sids, &types);
if (!NT_STATUS_IS_OK(nt_status)) {
return nt_status;