From ab38d3dd44f3b9e84ccf03f5293e3f658c31afd2 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 8 Feb 2008 02:37:19 +0100 Subject: Fix "net rpc audit" after query info policy idl fix. Guenther (This used to be commit 5c042793ea648849275061e31e3e37d583fe1a47) --- source3/utils/net_rpc_audit.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'source3/utils/net_rpc_audit.c') diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index 50bd555f16..7c2a5b33ca 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -71,7 +71,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid, { POLICY_HND pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - union lsa_PolicyInformation info; + union lsa_PolicyInformation *info = NULL; int i; uint32_t audit_category; @@ -103,7 +103,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid, goto done; } - for (i=0; i < info.audit_events.count; i++) { + for (i=0; i < info->audit_events.count; i++) { const char *val = NULL, *policy = NULL; @@ -111,7 +111,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid, continue; } - val = audit_policy_str(mem_ctx, info.audit_events.settings[i]); + val = audit_policy_str(mem_ctx, info->audit_events.settings[i]); policy = audit_description_str(i); print_auditing_category(policy, val); } @@ -138,7 +138,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid, { POLICY_HND pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - union lsa_PolicyInformation info; + union lsa_PolicyInformation *info = NULL; uint32_t audit_policy, audit_category; if (argc < 2 || argc > 3) { @@ -184,12 +184,12 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid, goto done; } - info.audit_events.settings[audit_category] = audit_policy; + info->audit_events.settings[audit_category] = audit_policy; result = rpccli_lsa_SetInfoPolicy(pipe_hnd, mem_ctx, &pol, LSA_POLICY_INFO_AUDIT_EVENTS, - &info); + info); if (!NT_STATUS_IS_OK(result)) { goto done; @@ -200,7 +200,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid, LSA_POLICY_INFO_AUDIT_EVENTS, &info); { - const char *val = audit_policy_str(mem_ctx, info.audit_events.settings[audit_category]); + const char *val = audit_policy_str(mem_ctx, info->audit_events.settings[audit_category]); const char *policy = audit_description_str(audit_category); print_auditing_category(policy, val); } @@ -224,7 +224,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd, { POLICY_HND pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - union lsa_PolicyInformation info; + union lsa_PolicyInformation *info = NULL; result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true, SEC_RIGHTS_MAXIMUM_ALLOWED, @@ -242,12 +242,12 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd, goto done; } - info.audit_events.auditing_mode = enable; + info->audit_events.auditing_mode = enable; result = rpccli_lsa_SetInfoPolicy(pipe_hnd, mem_ctx, &pol, LSA_POLICY_INFO_AUDIT_EVENTS, - &info); + info); if (!NT_STATUS_IS_OK(result)) { goto done; @@ -305,7 +305,7 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid, { POLICY_HND pol; NTSTATUS result = NT_STATUS_UNSUCCESSFUL; - union lsa_PolicyInformation info; + union lsa_PolicyInformation *info = NULL; int i; result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true, @@ -325,7 +325,7 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid, } printf("Auditing:\t\t"); - switch (info.audit_events.auditing_mode) { + switch (info->audit_events.auditing_mode) { case true: printf("Enabled"); break; @@ -333,16 +333,16 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid, printf("Disabled"); break; default: - printf("unknown (%d)", info.audit_events.auditing_mode); + printf("unknown (%d)", info->audit_events.auditing_mode); break; } printf("\n"); - printf("Auditing categories:\t%d\n", info.audit_events.count); + printf("Auditing categories:\t%d\n", info->audit_events.count); printf("Auditing settings:\n"); - for (i=0; i < info.audit_events.count; i++) { - const char *val = audit_policy_str(mem_ctx, info.audit_events.settings[i]); + for (i=0; i < info->audit_events.count; i++) { + const char *val = audit_policy_str(mem_ctx, info->audit_events.settings[i]); const char *policy = audit_description_str(i); print_auditing_category(policy, val); } -- cgit From 7269a504fdd06fbbe24c2df8e084b41382d71269 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 27 Feb 2008 19:38:48 +0100 Subject: Add my copyright. Guenther (This used to be commit d078a8757182d84dfd3307a2e1b751cf173aaa97) --- source3/utils/net_rpc_audit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/utils/net_rpc_audit.c') diff --git a/source3/utils/net_rpc_audit.c b/source3/utils/net_rpc_audit.c index 7c2a5b33ca..a846395bb8 100644 --- a/source3/utils/net_rpc_audit.c +++ b/source3/utils/net_rpc_audit.c @@ -1,7 +1,7 @@ /* Samba Unix/Linux SMB client library Distributed SMB/CIFS Server Management Utility - Copyright (C) 2006 Guenther Deschner + Copyright (C) 2006,2008 Guenther Deschner 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 -- cgit