[SCM] Samba Shared Repository - branch master updated -
release-4-0-0alpha6-907-gb222de4
Volker Lendecke
vlendec at samba.org
Sat Feb 14 20:56:39 GMT 2009
The branch, master has been updated
via b222de4eb3abab618f740a89279af2a7dc0985a7 (commit)
via 4e34c0cecadd6a53950c130708cb3db132c6bb8a (commit)
via 913c547cf6a232c0f0021ef5fa548a3034813b6f (commit)
via b08e24a44ccfea3c1f61a4e796641797cdc2bb11 (commit)
via ef3672a6554b3a628aebb3a0649e9e541f12818d (commit)
via 208b8f76b38e122638744b6c65a25d2b84e17af0 (commit)
via e304a623f10ac9587cad8cbfcfa83186a872e8ff (commit)
via f0440d0d564eb56094a466b459e13a34d8a90d55 (commit)
via d39849ddcd57661bdbfbbb7f1af89160e26a995c (commit)
via 01aff219dd4036ca9a542acac08b7355b764e4ce (commit)
from 7caadefaa20afeb98a77f14c2948f03cde1d8786 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b222de4eb3abab618f740a89279af2a7dc0985a7
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 18:51:41 2009 +0100
Remove a pointless NULL check
commit 4e34c0cecadd6a53950c130708cb3db132c6bb8a
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 18:49:13 2009 +0100
Fix some nonempty blank lines
commit 913c547cf6a232c0f0021ef5fa548a3034813b6f
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 18:25:33 2009 +0100
Rename lp_smb_perfcount_module() to lp_perfcount_module() to match the parameter name
commit b08e24a44ccfea3c1f61a4e796641797cdc2bb11
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 18:10:54 2009 +0100
Replace a // style comment with a /* */ one
commit ef3672a6554b3a628aebb3a0649e9e541f12818d
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 18:10:20 2009 +0100
Fix some C++ warnings
commit 208b8f76b38e122638744b6c65a25d2b84e17af0
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 17:45:01 2009 +0100
Make smb_load_perfcount_module static
commit e304a623f10ac9587cad8cbfcfa83186a872e8ff
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 17:42:51 2009 +0100
Add missing include to shut up missing prototype warnings
commit f0440d0d564eb56094a466b459e13a34d8a90d55
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 17:39:55 2009 +0100
Add missing prototype for "tevent_req_print"
commit d39849ddcd57661bdbfbbb7f1af89160e26a995c
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 17:38:05 2009 +0100
Fix a warning and a bug: pipe(2) can fail
commit 01aff219dd4036ca9a542acac08b7355b764e4ce
Author: Volker Lendecke <vl at samba.org>
Date: Sat Feb 14 17:37:47 2009 +0100
Add two variable assignments to shut up gcc
-----------------------------------------------------------------------
Summary of changes:
lib/tevent/tevent.h | 2 +
lib/tevent/tevent_signal.c | 11 ++++++--
libcli/security/dom_sid.c | 1 +
source3/include/proto.h | 2 +-
source3/modules/perfcount_test.c | 23 ++++++++++++------
source3/param/loadparm.c | 2 +-
source3/registry/reg_perfcount.c | 47 +++++++++++++++++--------------------
source3/smbd/perfcount.c | 4 +-
8 files changed, 52 insertions(+), 40 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 2ab1864..d3e1ecb 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -262,6 +262,8 @@ struct tevent_req {
} internal;
};
+char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req);
+
struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
void *pstate,
size_t state_size,
diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c
index 04ee697..f71d9b3 100644
--- a/lib/tevent/tevent_signal.c
+++ b/lib/tevent/tevent_signal.c
@@ -78,10 +78,11 @@ static uint32_t sig_count(struct sigcounter s)
static void tevent_common_signal_handler(int signum)
{
char c = 0;
+ ssize_t res;
SIG_INCREMENT(sig_state->signal_count[signum]);
SIG_INCREMENT(sig_state->got_signal);
/* doesn't matter if this pipe overflows */
- write(sig_state->pipe_hack[1], &c, 1);
+ res = write(sig_state->pipe_hack[1], &c, 1);
}
#ifdef SA_SIGINFO
@@ -152,8 +153,9 @@ static void signal_pipe_handler(struct tevent_context *ev, struct tevent_fd *fde
uint16_t flags, void *private)
{
char c[16];
+ ssize_t res;
/* its non-blocking, doesn't matter if we read too much */
- read(sig_state->pipe_hack[0], c, sizeof(c));
+ res = read(sig_state->pipe_hack[0], c, sizeof(c));
}
/*
@@ -253,7 +255,10 @@ struct tevent_signal *tevent_common_add_signal(struct tevent_context *ev,
if (ev->pipe_fde == NULL) {
if (sig_state->pipe_hack[0] == 0 &&
sig_state->pipe_hack[1] == 0) {
- pipe(sig_state->pipe_hack);
+ if (pipe(sig_state->pipe_hack) == -1) {
+ talloc_free(se);
+ return NULL;
+ }
ev_set_blocking(sig_state->pipe_hack[0], false);
ev_set_blocking(sig_state->pipe_hack[1], false);
}
diff --git a/libcli/security/dom_sid.c b/libcli/security/dom_sid.c
index db82020..0c88900 100644
--- a/libcli/security/dom_sid.c
+++ b/libcli/security/dom_sid.c
@@ -22,6 +22,7 @@
#include "includes.h"
#include "librpc/gen_ndr/security.h"
+#include "dom_sid.h"
/*****************************************************************
Compare the auth portion of two sids.
diff --git a/source3/include/proto.h b/source3/include/proto.h
index bfbf972..8a5d649 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4395,7 +4395,7 @@ void lp_set_posix_pathnames(void);
enum brl_flavour lp_posix_cifsu_locktype(files_struct *fsp);
void lp_set_posix_default_cifsx_readwrite_locktype(enum brl_flavour val);
int lp_min_receive_file_size(void);
-char* lp_smb_perfcount_module(void);
+char* lp_perfcount_module(void);
/* The following definitions come from param/params.c */
diff --git a/source3/modules/perfcount_test.c b/source3/modules/perfcount_test.c
index e0954bf..3221adf 100644
--- a/source3/modules/perfcount_test.c
+++ b/source3/modules/perfcount_test.c
@@ -223,7 +223,8 @@ static void perfcount_test_start(struct smb_perfcount_data *pcd)
static void perfcount_test_add(struct smb_perfcount_data *pcd)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
struct perfcount_test_counter *ctr;
if (pcd->context == NULL) {
@@ -243,7 +244,8 @@ static void perfcount_test_add(struct smb_perfcount_data *pcd)
static void perfcount_test_set_op(struct smb_perfcount_data *pcd, int op)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_set_op - uninitialized "
@@ -256,7 +258,8 @@ static void perfcount_test_set_op(struct smb_perfcount_data *pcd, int op)
static void perfcount_test_set_subop(struct smb_perfcount_data *pcd, int sub_op)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_set_sub_op - uninitialized "
@@ -269,7 +272,8 @@ static void perfcount_test_set_subop(struct smb_perfcount_data *pcd, int sub_op)
static void perfcount_test_set_ioctl(struct smb_perfcount_data *pcd, int io_ctl)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_set_ioctl - uninitialized "
"perfcount context - %p\n", pcd));
@@ -281,7 +285,8 @@ static void perfcount_test_set_ioctl(struct smb_perfcount_data *pcd, int io_ctl)
static void perfcount_test_set_msglen_in(struct smb_perfcount_data *pcd,
uint64_t bytes_in)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_set_msglen_in - "
"uninitialized perfcount context - %p\n", pcd));
@@ -293,7 +298,8 @@ static void perfcount_test_set_msglen_in(struct smb_perfcount_data *pcd,
static void perfcount_test_set_msglen_out(struct smb_perfcount_data *pcd,
uint64_t bytes_out)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_set_msglen_out - uninitialized "
@@ -323,13 +329,14 @@ static void perfcount_test_set_client(struct smb_perfcount_data *pcd,
uid_t uid, const char *user,
const char *domain)
{
- // WIP
+ /* WIP */
return;
}
static void perfcount_test_end(struct smb_perfcount_data *pcd)
{
- struct perfcount_test_context *ctxt = pcd->context;
+ struct perfcount_test_context *ctxt =
+ (struct perfcount_test_context *)pcd->context;
if (pcd->context == NULL) {
DEBUG(0,("perfcount_test_end - uninitialized "
"perfcount context - %p\n", pcd));
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a127ec5..a9f2809 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -5185,7 +5185,7 @@ FN_GLOBAL_STRING(lp_utmpdir, &Globals.szUtmpDir)
FN_GLOBAL_STRING(lp_wtmpdir, &Globals.szWtmpDir)
FN_GLOBAL_BOOL(lp_utmp, &Globals.bUtmp)
FN_GLOBAL_STRING(lp_rootdir, &Globals.szRootdir)
-FN_GLOBAL_STRING(lp_smb_perfcount_module, &Globals.szSMBPerfcountModule)
+FN_GLOBAL_STRING(lp_perfcount_module, &Globals.szSMBPerfcountModule)
FN_GLOBAL_STRING(lp_defaultservice, &Globals.szDefaultService)
FN_GLOBAL_STRING(lp_msg_command, &Globals.szMsgCommand)
FN_GLOBAL_STRING(lp_get_quota_command, &Globals.szGetQuota)
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index eda44ac..fed3cbd 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -41,9 +41,6 @@ static char *counters_directory(const char *dbname)
char *ret = NULL;
TALLOC_CTX *ctx = talloc_tos();
- if (!dbname)
- return NULL;
-
path = talloc_asprintf(ctx, "%s/%s", PERFCOUNTDIR, dbname);
if (!path) {
return NULL;
@@ -62,10 +59,10 @@ void perfcount_init_keys( void )
char *p = state_path(PERFCOUNTDIR);
/* no registry keys; just create the perfmon directory */
-
+
if ( !directory_exist( p ) )
mkdir( p, 0755 );
-
+
return;
}
@@ -358,7 +355,7 @@ static uint32 _reg_perfcount_get_numinst(int objInd, TDB_CONTEXT *names)
if(data.dptr == NULL)
return (uint32)PERF_NO_INSTANCES;
-
+
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
SAFE_FREE(data.dptr);
@@ -414,7 +411,7 @@ bool _reg_perfcount_get_counter_data(TDB_DATA key, TDB_DATA *data)
{
TDB_CONTEXT *counters;
const char *fname = counters_directory( DATA_DB );
-
+
counters = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDONLY, 0444);
if(counters == NULL)
@@ -424,7 +421,7 @@ bool _reg_perfcount_get_counter_data(TDB_DATA key, TDB_DATA *data)
}
*data = tdb_fetch(counters, key);
-
+
tdb_close(counters);
return True;
@@ -511,7 +508,7 @@ static bool _reg_perfcount_get_counter_info(PERF_DATA_BLOCK *block,
DEBUG(3, ("_reg_perfcount_get_counter_info: No counter data for counter [%d].\n", CounterIndex));
return False;
}
-
+
counter_size = _reg_perfcount_get_size_field(obj->counters[obj->NumCounters].CounterType);
if(counter_size == PERF_SIZE_DWORD)
@@ -612,7 +609,7 @@ static bool _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
PERF_OBJECT_TYPE *obj;
bool success = True;
char buf[PERFCOUNT_MAX_LEN];
-
+
obj = NULL;
memset(buf, 0, PERFCOUNT_MAX_LEN);
memcpy(buf, data.dptr, data.dsize);
@@ -652,7 +649,7 @@ static bool _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
obj->NumCounters += 1;
start = stop + 1;
}
-
+
/* Handle case of Objects/Counters without any counter data, which would suggest
that the required instances are not there yet, so change NumInstances from
PERF_NO_INSTANCES to 0 */
@@ -737,7 +734,7 @@ bool _reg_perfcount_get_instance_info(PERF_INSTANCE_DEFINITION *inst,
inst->ParentObjectTitlePointer = 0;
inst->UniqueID = PERF_NO_UNIQUE_ID;
inst->NameOffset = 6 * sizeof(uint32);
-
+
inst->ByteLength = inst->NameOffset + inst->NameLength;
/* Need to be aligned on a 64-bit boundary here for counter_data */
if((pad = (inst->ByteLength % 8)))
@@ -772,7 +769,7 @@ bool _reg_perfcount_add_instance(PERF_OBJECT_TYPE *obj,
}
if(obj->instances == NULL)
return False;
-
+
memset(&(obj->instances[instInd]), 0, sizeof(PERF_INSTANCE_DEFINITION));
inst = &(obj->instances[instInd]);
return _reg_perfcount_get_instance_info(inst, ps, instInd, obj, names);
@@ -859,15 +856,15 @@ static bool _reg_perfcount_init_data_block_perf(PERF_DATA_BLOCK *block,
TDB_CONTEXT *counters;
bool status = False;
const char *fname = counters_directory( DATA_DB );
-
+
counters = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDONLY, 0444);
-
+
if(counters == NULL)
{
DEBUG(1, ("reg_perfcount_init_data_block_perf: unable to open [%s].\n", fname));
return False;
}
-
+
status = _reg_perfcount_get_64(&PerfFreq, names, 0, "PerfFreq");
if(status == False)
{
@@ -1030,7 +1027,7 @@ static uint32 _reg_perfcount_perf_data_block_fixup(PERF_DATA_BLOCK *block, prs_s
object[obj].HeaderLength = sizeof(*object) - (sizeof(counter) + sizeof(instance) + sizeof(PERF_COUNTER_BLOCK));
object[obj].TotalByteLength += object[obj].HeaderLength;
object[obj].DefinitionLength += object[obj].HeaderLength;
-
+
block->TotalByteLength += object[obj].TotalByteLength;
}
@@ -1049,7 +1046,7 @@ uint32 reg_perfcount_get_perf_data_block(uint32 base_index,
const char *fname = counters_directory( NAMES_DB );
TDB_CONTEXT *names;
int retval = 0;
-
+
names = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDONLY, 0444);
if(names == NULL)
@@ -1065,7 +1062,7 @@ uint32 reg_perfcount_get_perf_data_block(uint32 base_index,
}
reg_perfcount_get_last_counter(base_index);
-
+
if(object_ids == NULL)
{
/* we're getting a request for "Global" here */
@@ -1153,7 +1150,7 @@ static bool _reg_perfcount_marshall_perf_counters(prs_struct *ps,
prs_debug(ps, depth, "", "_reg_perfcount_marshall_perf_counters");
depth++;
-
+
for(cnt = 0; cnt < object.NumCounters; cnt++)
{
counter = object.counters[cnt];
@@ -1194,10 +1191,10 @@ static bool _reg_perfcount_marshall_perf_counter_data(prs_struct *ps,
{
prs_debug(ps, depth, "", "_reg_perfcount_marshall_perf_counter_data");
depth++;
-
+
if(!prs_align_uint64(ps))
return False;
-
+
if(!prs_uint32("ByteLength", ps, depth, &counter_data.ByteLength))
return False;
if(!prs_uint8s(False, "CounterData", ps, depth, counter_data.data, counter_data.ByteLength - sizeof(uint32)))
@@ -1245,7 +1242,7 @@ static bool _reg_perfcount_marshall_perf_instances(prs_struct *ps,
if(_reg_perfcount_marshall_perf_counter_data(ps, instance.counter_data, depth) == False)
return False;
}
-
+
return True;
}
@@ -1257,7 +1254,7 @@ static bool _reg_perfcount_marshall_perf_objects(prs_struct *ps, PERF_DATA_BLOCK
int obj;
PERF_OBJECT_TYPE object;
-
+
prs_debug(ps, depth, "", "_reg_perfcount_marshall_perf_objects");
depth++;
@@ -1348,7 +1345,7 @@ WERROR reg_perfcount_get_hkpd(prs_struct *ps, uint32 max_buf_size, uint32 *outbu
*/
PERF_DATA_BLOCK block;
uint32 buffer_size, base_index;
-
+
buffer_size = 0;
base_index = reg_perfcount_get_base_index();
ZERO_STRUCT(block);
diff --git a/source3/smbd/perfcount.c b/source3/smbd/perfcount.c
index 0ad706c..a0ba0a5 100644
--- a/source3/smbd/perfcount.c
+++ b/source3/smbd/perfcount.c
@@ -94,7 +94,7 @@ NTSTATUS smb_register_perfcounter(int interface_version, const char *name,
/****************************************************************************
initialise smb perf counters
****************************************************************************/
-bool smb_load_perfcount_module(const char *name)
+static bool smb_load_perfcount_module(const char *name)
{
char *module_path = NULL;
char *module_name = NULL;
@@ -175,7 +175,7 @@ bool smb_perfcount_init(void)
{
char *perfcount_object;
- perfcount_object = lp_smb_perfcount_module();
+ perfcount_object = lp_perfcount_module();
/* don't init */
if (!perfcount_object || !perfcount_object[0])
--
Samba Shared Repository
More information about the samba-cvs
mailing list