[SCM] Samba Shared Repository - branch v3-2-test updated -
initial-v3-2-unstable-1350-g558ce4e
Günther Deschner
gd at samba.org
Mon Jan 14 17:40:08 GMT 2008
The branch, v3-2-test has been updated
via 558ce4ec3eaa93c827316d92c346f35c140fadf0 (commit)
via 44d67e84625a2a1a93baecef0e418b48e982443b (commit)
from 94693755a291993217b5cb74794504a8593eae30 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 558ce4ec3eaa93c827316d92c346f35c140fadf0
Author: Günther Deschner <gd at samba.org>
Date: Mon Jan 14 18:26:24 2008 +0100
Some more minor cleanup for "net rpc audit".
Guenther
commit 44d67e84625a2a1a93baecef0e418b48e982443b
Author: Günther Deschner <gd at samba.org>
Date: Mon Jan 14 14:18:53 2008 +0100
Print principal in debug statement in kerberos_kinit_password() as well.
Guenther
-----------------------------------------------------------------------
Summary of changes:
source/libads/kerberos.c | 3 +-
source/utils/net_rpc_audit.c | 112 ++++++++++++++++++++----------------------
2 files changed, 56 insertions(+), 59 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libads/kerberos.c b/source/libads/kerberos.c
index 4fc2395..e9222e8 100644
--- a/source/libads/kerberos.c
+++ b/source/libads/kerberos.c
@@ -209,7 +209,8 @@ int kerberos_kinit_password_ext(const char *principal,
krb5_set_real_time(ctx, time(NULL) + time_offset, 0);
}
- DEBUG(10,("kerberos_kinit_password: using [%s] as ccache and config [%s]\n",
+ DEBUG(10,("kerberos_kinit_password: as %s using [%s] as ccache and config [%s]\n",
+ principal,
cache_name ? cache_name: krb5_cc_default_name(ctx),
getenv("KRB5_CONFIG")));
diff --git a/source/utils/net_rpc_audit.c b/source/utils/net_rpc_audit.c
index 115f8f6..50bd555 100644
--- a/source/utils/net_rpc_audit.c
+++ b/source/utils/net_rpc_audit.c
@@ -1,21 +1,21 @@
-/*
- Samba Unix/Linux SMB client library
- Distributed SMB/CIFS Server Management Utility
+/*
+ Samba Unix/Linux SMB client library
+ Distributed SMB/CIFS Server Management Utility
Copyright (C) 2006 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
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,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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, see <http://www.gnu.org/licenses/>. */
-
+
#include "includes.h"
#include "utils/net.h"
@@ -54,19 +54,18 @@ static void print_auditing_category(const char *policy, const char *value)
pad_len = col_len - strlen(policy);
padding[pad_len] = 0;
do padding[--pad_len] = ' '; while (pad_len > 0);
-
+
d_printf("\t%s%s%s\n", policy, padding, value);
}
-
/********************************************************************
********************************************************************/
static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid,
- const char *domain_name,
+ const char *domain_name,
struct cli_state *cli,
struct rpc_pipe_client *pipe_hnd,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
int argc,
const char **argv)
{
@@ -74,9 +73,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation info;
int i;
-
- uint32 info_class = 2;
- uint32 audit_category;
+ uint32_t audit_category;
if (argc < 1 || argc > 2) {
d_printf("insufficient arguments\n");
@@ -89,7 +86,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid,
return NT_STATUS_INVALID_PARAMETER;
}
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
@@ -99,7 +96,7 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid,
result = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
@@ -132,19 +129,17 @@ static NTSTATUS rpc_audit_get_internal(const DOM_SID *domain_sid,
********************************************************************/
static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
- const char *domain_name,
+ const char *domain_name,
struct cli_state *cli,
struct rpc_pipe_client *pipe_hnd,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
int argc,
const char **argv)
{
POLICY_HND pol;
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation info;
-
- uint32 info_class = 2;
- uint32 audit_policy, audit_category;
+ uint32_t audit_policy, audit_category;
if (argc < 2 || argc > 3) {
d_printf("insufficient arguments\n");
@@ -172,7 +167,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
return NT_STATUS_INVALID_PARAMETER;
}
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
@@ -182,7 +177,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
result = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
@@ -193,7 +188,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
result = rpccli_lsa_SetInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
@@ -202,7 +197,7 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
result = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
{
const char *val = audit_policy_str(mem_ctx, info.audit_events.settings[audit_category]);
@@ -214,11 +209,14 @@ static NTSTATUS rpc_audit_set_internal(const DOM_SID *domain_sid,
if (!NT_STATUS_IS_OK(result)) {
d_printf("failed to set audit policy: %s\n", nt_errstr(result));
}
-
+
return result;
}
-static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
+/********************************************************************
+********************************************************************/
+
+static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
TALLOC_CTX *mem_ctx,
int argc,
const char **argv,
@@ -228,9 +226,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
union lsa_PolicyInformation info;
- uint32 info_class = 2;
-
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
@@ -240,7 +236,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
result = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@@ -250,7 +246,7 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
result = rpccli_lsa_SetInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
@@ -259,48 +255,51 @@ static NTSTATUS rpc_audit_enable_internal_ext(struct rpc_pipe_client *pipe_hnd,
done:
if (!NT_STATUS_IS_OK(result)) {
- d_printf("failed to %s audit policy: %s\n", enable ? "enable":"disable",
- nt_errstr(result));
+ d_printf("failed to %s audit policy: %s\n",
+ enable ? "enable":"disable", nt_errstr(result));
}
return result;
}
+
/********************************************************************
********************************************************************/
static NTSTATUS rpc_audit_disable_internal(const DOM_SID *domain_sid,
- const char *domain_name,
+ const char *domain_name,
struct cli_state *cli,
struct rpc_pipe_client *pipe_hnd,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
int argc,
const char **argv)
{
- return rpc_audit_enable_internal_ext(pipe_hnd, mem_ctx, argc, argv, False);
+ return rpc_audit_enable_internal_ext(pipe_hnd, mem_ctx, argc, argv,
+ false);
}
/********************************************************************
********************************************************************/
static NTSTATUS rpc_audit_enable_internal(const DOM_SID *domain_sid,
- const char *domain_name,
+ const char *domain_name,
struct cli_state *cli,
struct rpc_pipe_client *pipe_hnd,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
int argc,
const char **argv)
{
- return rpc_audit_enable_internal_ext(pipe_hnd, mem_ctx, argc, argv, True);
+ return rpc_audit_enable_internal_ext(pipe_hnd, mem_ctx, argc, argv,
+ true);
}
/********************************************************************
********************************************************************/
static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid,
- const char *domain_name,
+ const char *domain_name,
struct cli_state *cli,
struct rpc_pipe_client *pipe_hnd,
- TALLOC_CTX *mem_ctx,
+ TALLOC_CTX *mem_ctx,
int argc,
const char **argv)
{
@@ -309,9 +308,7 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid,
union lsa_PolicyInformation info;
int i;
- uint32 info_class = 2;
-
- result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, True,
+ result = rpccli_lsa_open_policy(pipe_hnd, mem_ctx, true,
SEC_RIGHTS_MAXIMUM_ALLOWED,
&pol);
@@ -321,7 +318,7 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid,
result = rpccli_lsa_QueryInfoPolicy(pipe_hnd, mem_ctx,
&pol,
- info_class,
+ LSA_POLICY_INFO_AUDIT_EVENTS,
&info);
if (!NT_STATUS_IS_OK(result)) {
goto done;
@@ -329,10 +326,10 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid,
printf("Auditing:\t\t");
switch (info.audit_events.auditing_mode) {
- case True:
+ case true:
printf("Enabled");
break;
- case False:
+ case false:
printf("Disabled");
break;
default:
@@ -352,20 +349,19 @@ static NTSTATUS rpc_audit_list_internal(const DOM_SID *domain_sid,
done:
if (!NT_STATUS_IS_OK(result)) {
- d_printf("failed to list auditing policies: %s\n", nt_errstr(result));
+ d_printf("failed to list auditing policies: %s\n",
+ nt_errstr(result));
}
return result;
}
-
-
/********************************************************************
********************************************************************/
static int rpc_audit_get(int argc, const char **argv)
{
- return run_rpc_command(NULL, PI_LSARPC, 0,
+ return run_rpc_command(NULL, PI_LSARPC, 0,
rpc_audit_get_internal, argc, argv);
}
@@ -374,7 +370,7 @@ static int rpc_audit_get(int argc, const char **argv)
static int rpc_audit_set(int argc, const char **argv)
{
- return run_rpc_command(NULL, PI_LSARPC, 0,
+ return run_rpc_command(NULL, PI_LSARPC, 0,
rpc_audit_set_internal, argc, argv);
}
@@ -383,7 +379,7 @@ static int rpc_audit_set(int argc, const char **argv)
static int rpc_audit_enable(int argc, const char **argv)
{
- return run_rpc_command(NULL, PI_LSARPC, 0,
+ return run_rpc_command(NULL, PI_LSARPC, 0,
rpc_audit_enable_internal, argc, argv);
}
@@ -392,7 +388,7 @@ static int rpc_audit_enable(int argc, const char **argv)
static int rpc_audit_disable(int argc, const char **argv)
{
- return run_rpc_command(NULL, PI_LSARPC, 0,
+ return run_rpc_command(NULL, PI_LSARPC, 0,
rpc_audit_disable_internal, argc, argv);
}
@@ -401,14 +397,14 @@ static int rpc_audit_disable(int argc, const char **argv)
static int rpc_audit_list(int argc, const char **argv)
{
- return run_rpc_command(NULL, PI_LSARPC, 0,
+ return run_rpc_command(NULL, PI_LSARPC, 0,
rpc_audit_list_internal, argc, argv);
}
/********************************************************************
********************************************************************/
-int net_rpc_audit(int argc, const char **argv)
+int net_rpc_audit(int argc, const char **argv)
{
struct functable func[] = {
{"get", rpc_audit_get},
@@ -418,9 +414,9 @@ int net_rpc_audit(int argc, const char **argv)
{"list", rpc_audit_list},
{NULL, NULL}
};
-
+
if (argc)
return net_run_function(argc, argv, func, net_help_audit);
-
+
return net_help_audit(argc, argv);
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list