summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-24 22:19:17 +0200
committerMichael Adam <obnox@samba.org>2010-05-25 10:35:25 +0200
commit9ccf66379a946cef87d915c5f0f7758adb11a4d6 (patch)
tree3567c2325ce5526fa81c863c94efd54b22327cac /source3
parent70a81796fca29d3e924ab6a9396b1a4ab344a730 (diff)
downloadsamba-9ccf66379a946cef87d915c5f0f7758adb11a4d6.tar.gz
samba-9ccf66379a946cef87d915c5f0f7758adb11a4d6.tar.bz2
samba-9ccf66379a946cef87d915c5f0f7758adb11a4d6.zip
s3:registry: adapt callers of regval_ctr_addvalue to uint8 * instead of char *
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/nt_printing.c8
-rw-r--r--source3/registry/reg_api.c4
-rw-r--r--source3/registry/reg_backend_db.c4
-rw-r--r--source3/registry/reg_backend_hkpt_params.c4
-rw-r--r--source3/registry/reg_backend_netlogon_params.c2
-rw-r--r--source3/registry/reg_backend_perflib.c12
-rw-r--r--source3/registry/reg_backend_printing.c36
-rw-r--r--source3/registry/reg_eventlog.c14
-rw-r--r--source3/services/services_db.c10
-rw-r--r--source3/utils/net_rpc_registry.c2
-rw-r--r--source3/utils/profiles.c2
11 files changed, 49 insertions, 49 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 5e5d1029cd..d3808d83aa 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3099,7 +3099,7 @@ static void map_dword_into_ctr(struct regval_ctr *ctr, const char *val_name,
{
regval_ctr_delvalue(ctr, val_name);
regval_ctr_addvalue(ctr, val_name, REG_DWORD,
- (char *) &dword, sizeof(dword));
+ (uint8 *) &dword, sizeof(dword));
}
static void map_bool_into_ctr(struct regval_ctr *ctr, const char *val_name,
@@ -3108,7 +3108,7 @@ static void map_bool_into_ctr(struct regval_ctr *ctr, const char *val_name,
uint8 bin_bool = (b ? 1 : 0);
regval_ctr_delvalue(ctr, val_name);
regval_ctr_addvalue(ctr, val_name, REG_BINARY,
- (char *) &bin_bool, sizeof(bin_bool));
+ (uint8 *) &bin_bool, sizeof(bin_bool));
}
static void map_single_multi_sz_into_ctr(struct regval_ctr *ctr, const char *val_name,
@@ -3701,7 +3701,7 @@ WERROR add_printer_data( NT_PRINTER_INFO_LEVEL_2 *p2, const char *key, const cha
return WERR_NOMEM;
regval_ctr_addvalue( p2->data->keys[key_index].values, value,
- type, (const char *)data, real_len );
+ type, data, real_len );
DEBUG(8,("add_printer_data: Added key => [%s], value => [%s], type=> [%d], size => [%d]\n",
key, value, type, real_len ));
@@ -3830,7 +3830,7 @@ static int unpack_values(NT_PRINTER_DATA *printer_data, const uint8 *buf, int bu
/* add the value */
regval_ctr_addvalue( printer_data->keys[key_index].values,
- valuename, type, (const char *)data_p,
+ valuename, type, data_p,
size );
}
diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c
index e08bdb523f..ff2932c328 100644
--- a/source3/registry/reg_api.c
+++ b/source3/registry/reg_api.c
@@ -626,7 +626,7 @@ WERROR reg_setvalue(struct registry_key *key, const char *name,
}
res = regval_ctr_addvalue(key->values, name, val->type,
- (char *)value_data.data, value_data.length);
+ value_data.data, value_data.length);
TALLOC_FREE(value_data.data);
if (res == 0) {
@@ -750,7 +750,7 @@ static WERROR reg_load_tree(REGF_FILE *regfile, const char *topkeypath,
for (i=0; i<key->num_values; i++) {
regval_ctr_addvalue(values, key->values[i].valuename,
key->values[i].type,
- (char*)key->values[i].data,
+ key->values[i].data,
(key->values[i].data_size & ~VK_DATA_IN_OFFSET));
}
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 3f9fdb6a0b..8f7930d7f8 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -256,7 +256,7 @@ static void regdb_ctr_add_value(struct regval_ctr *ctr,
switch(value->type) {
case REG_DWORD:
regval_ctr_addvalue(ctr, value->valuename, REG_DWORD,
- (char*)&value->data.dw_value,
+ (uint8_t *)&value->data.dw_value,
sizeof(uint32));
break;
@@ -1563,7 +1563,7 @@ static int regdb_unpack_values(struct regval_ctr *values, uint8 *buf, int buflen
if (size && data_p) {
regval_ctr_addvalue(values, valuename, type,
- (const char *)data_p, size);
+ (uint8_t *)data_p, size);
}
SAFE_FREE(data_p); /* 'B' option to tdb_unpack does a malloc() */
diff --git a/source3/registry/reg_backend_hkpt_params.c b/source3/registry/reg_backend_hkpt_params.c
index 479d9366b0..f0212f3e1b 100644
--- a/source3/registry/reg_backend_hkpt_params.c
+++ b/source3/registry/reg_backend_hkpt_params.c
@@ -43,7 +43,7 @@ static int hkpt_params_fetch_values(const char *key, struct regval_ctr *regvals)
base_index = reg_perfcount_get_base_index();
buffer_size = reg_perfcount_get_counter_names(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Counters", REG_MULTI_SZ, buffer,
+ regval_ctr_addvalue(regvals, "Counters", REG_MULTI_SZ, (uint8 *)buffer,
buffer_size);
if(buffer_size > 0) {
@@ -51,7 +51,7 @@ static int hkpt_params_fetch_values(const char *key, struct regval_ctr *regvals)
}
buffer_size = reg_perfcount_get_counter_help(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, buffer, buffer_size);
+ regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, (uint8 *)buffer, buffer_size);
if(buffer_size > 0) {
SAFE_FREE(buffer);
}
diff --git a/source3/registry/reg_backend_netlogon_params.c b/source3/registry/reg_backend_netlogon_params.c
index 1d5ac719eb..5a5bcce577 100644
--- a/source3/registry/reg_backend_netlogon_params.c
+++ b/source3/registry/reg_backend_netlogon_params.c
@@ -41,7 +41,7 @@ static int netlogon_params_fetch_values(const char *key, struct regval_ctr *regv
}
regval_ctr_addvalue(regvals, "RefusePasswordChange", REG_DWORD,
- (char*)&dwValue, sizeof(dwValue));
+ (uint8_t *)&dwValue, sizeof(dwValue));
return regval_ctr_numvals(regvals);
}
diff --git a/source3/registry/reg_backend_perflib.c b/source3/registry/reg_backend_perflib.c
index 32f377634a..35564b4309 100644
--- a/source3/registry/reg_backend_perflib.c
+++ b/source3/registry/reg_backend_perflib.c
@@ -44,12 +44,12 @@ static int perflib_params(struct regval_ctr *regvals)
int version = 0x00010001;
base_index = reg_perfcount_get_base_index();
- regval_ctr_addvalue(regvals, "Base Index", REG_DWORD, (char *)&base_index, sizeof(base_index));
+ regval_ctr_addvalue(regvals, "Base Index", REG_DWORD, (uint8_t *)&base_index, sizeof(base_index));
last_counter = reg_perfcount_get_last_counter(base_index);
- regval_ctr_addvalue(regvals, "Last Counter", REG_DWORD, (char *)&last_counter, sizeof(last_counter));
+ regval_ctr_addvalue(regvals, "Last Counter", REG_DWORD, (uint8_t *)&last_counter, sizeof(last_counter));
last_help = reg_perfcount_get_last_help(last_counter);
- regval_ctr_addvalue(regvals, "Last Help", REG_DWORD, (char *)&last_help, sizeof(last_help));
- regval_ctr_addvalue(regvals, "Version", REG_DWORD, (char *)&version, sizeof(version));
+ regval_ctr_addvalue(regvals, "Last Help", REG_DWORD, (uint8_t *)&last_help, sizeof(last_help));
+ regval_ctr_addvalue(regvals, "Version", REG_DWORD, (uint8_t *)&version, sizeof(version));
return regval_ctr_numvals( regvals );
}
@@ -62,11 +62,11 @@ static int perflib_009_params(struct regval_ctr *regvals)
base_index = reg_perfcount_get_base_index();
buffer_size = reg_perfcount_get_counter_names(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Counter", REG_MULTI_SZ, buffer, buffer_size);
+ regval_ctr_addvalue(regvals, "Counter", REG_MULTI_SZ, (uint8_t *)buffer, buffer_size);
if(buffer_size > 0)
SAFE_FREE(buffer);
buffer_size = reg_perfcount_get_counter_help(base_index, &buffer);
- regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, buffer, buffer_size);
+ regval_ctr_addvalue(regvals, "Help", REG_MULTI_SZ, (uint8_t *)buffer, buffer_size);
if(buffer_size > 0)
SAFE_FREE(buffer);
diff --git a/source3/registry/reg_backend_printing.c b/source3/registry/reg_backend_printing.c
index 3990fb1c5e..08acb09b55 100644
--- a/source3/registry/reg_backend_printing.c
+++ b/source3/registry/reg_backend_printing.c
@@ -123,7 +123,7 @@ static int key_forms_fetch_values(const char *key, struct regval_ctr *values)
data[6] = form_index++;
data[7] = form->flag;
- regval_ctr_addvalue( values, form->name, REG_BINARY, (char*)data, sizeof(data) );
+ regval_ctr_addvalue(values, form->name, REG_BINARY, (uint8_t *)data, sizeof(data));
}
SAFE_FREE( forms_list );
@@ -148,7 +148,7 @@ static int key_forms_fetch_values(const char *key, struct regval_ctr *values)
data[6] = form_index++;
data[7] = form->flag;
- regval_ctr_addvalue(values, form->name, REG_BINARY, (char*)data, sizeof(data) );
+ regval_ctr_addvalue(values, form->name, REG_BINARY, (uint8_t *)data, sizeof(data));
}
SAFE_FREE(forms_list);
@@ -391,16 +391,16 @@ static void fill_in_printer_values(NT_PRINTER_INFO_LEVEL_2 *info2, struct regval
char *p;
uint32 printer_status = PRINTER_STATUS_OK;
- regval_ctr_addvalue( values, "Attributes", REG_DWORD, (char*)&info2->attributes, sizeof(info2->attributes) );
- regval_ctr_addvalue( values, "Priority", REG_DWORD, (char*)&info2->priority, sizeof(info2->attributes) );
- regval_ctr_addvalue( values, "ChangeID", REG_DWORD, (char*)&info2->changeid, sizeof(info2->changeid) );
- regval_ctr_addvalue( values, "Default Priority", REG_DWORD, (char*)&info2->default_priority, sizeof(info2->default_priority) );
+ regval_ctr_addvalue( values, "Attributes", REG_DWORD, (uint8_t *)&info2->attributes, sizeof(info2->attributes) );
+ regval_ctr_addvalue( values, "Priority", REG_DWORD, (uint8_t *)&info2->priority, sizeof(info2->attributes) );
+ regval_ctr_addvalue( values, "ChangeID", REG_DWORD, (uint8_t *)&info2->changeid, sizeof(info2->changeid) );
+ regval_ctr_addvalue( values, "Default Priority", REG_DWORD, (uint8_t *)&info2->default_priority, sizeof(info2->default_priority) );
/* lie and say everything is ok since we don't want to call print_queue_length() to get the real status */
- regval_ctr_addvalue( values, "Status", REG_DWORD, (char*)&printer_status, sizeof(info2->status) );
+ regval_ctr_addvalue( values, "Status", REG_DWORD, (uint8_t *)&printer_status, sizeof(info2->status) );
- regval_ctr_addvalue( values, "StartTime", REG_DWORD, (char*)&info2->starttime, sizeof(info2->starttime) );
- regval_ctr_addvalue( values, "UntilTime", REG_DWORD, (char*)&info2->untiltime, sizeof(info2->untiltime) );
+ regval_ctr_addvalue( values, "StartTime", REG_DWORD, (uint8_t *)&info2->starttime, sizeof(info2->starttime) );
+ regval_ctr_addvalue( values, "UntilTime", REG_DWORD, (uint8_t *)&info2->untiltime, sizeof(info2->untiltime) );
/* strip the \\server\ from this string */
if ( !(p = strrchr( info2->printername, '\\' ) ) )
@@ -431,7 +431,7 @@ static void fill_in_printer_values(NT_PRINTER_INFO_LEVEL_2 *info2, struct regval
if (NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
regval_ctr_addvalue(values, "Default Devmode", REG_BINARY,
- (const char *)blob.data, blob.length);
+ blob.data, blob.length);
}
}
@@ -448,7 +448,7 @@ static void fill_in_printer_values(NT_PRINTER_INFO_LEVEL_2 *info2, struct regval
&blob.data, &blob.length);
if (NT_STATUS_IS_OK(status)) {
regval_ctr_addvalue(values, "Security", REG_BINARY,
- (const char *)blob.data, blob.length);
+ blob.data, blob.length);
}
}
@@ -889,7 +889,7 @@ static int key_driver_fetch_keys( const char *key, struct regsubkey_ctr *subkeys
static void fill_in_driver_values(const struct spoolss_DriverInfo8 *r,
struct regval_ctr *values)
{
- char *buffer = NULL;
+ uint8_t *buffer = NULL;
int buffer_size = 0;
int i, length;
const char *filename;
@@ -910,7 +910,7 @@ static void fill_in_driver_values(const struct spoolss_DriverInfo8 *r,
regval_ctr_addvalue_sz(values, "Datatype", r->default_datatype);
regval_ctr_addvalue_sz(values, "Monitor", r->monitor_name);
- regval_ctr_addvalue( values, "Version", REG_DWORD, (char*)&r->version,
+ regval_ctr_addvalue( values, "Version", REG_DWORD, (uint8_t *)&r->version,
sizeof(r->version) );
if (r->dependent_files) {
@@ -925,25 +925,25 @@ static void fill_in_driver_values(const struct spoolss_DriverInfo8 *r,
length = strlen(filename);
- buffer = (char *)SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
+ buffer = (uint8_t *)SMB_REALLOC( buffer, buffer_size + (length + 1)*sizeof(uint16) );
if ( !buffer ) {
break;
}
push_reg_sz(talloc_tos(), &data, filename);
- memcpy( buffer+buffer_size, (char*)data.data, data.length);
+ memcpy( buffer+buffer_size, data.data, data.length);
buffer_size += (length + 1)*sizeof(uint16);
}
/* terminated by double NULL. Add the final one here */
- buffer = (char *)SMB_REALLOC( buffer, buffer_size + 2 );
+ buffer = (uint8_t *)SMB_REALLOC( buffer, buffer_size + 2 );
if ( !buffer ) {
buffer_size = 0;
} else {
- buffer[buffer_size++] = '\0';
- buffer[buffer_size++] = '\0';
+ buffer[buffer_size++] = (uint8_t)'\0';
+ buffer[buffer_size++] = (uint8_t)'\0';
}
}
diff --git a/source3/registry/reg_eventlog.c b/source3/registry/reg_eventlog.c
index c2b4a75fa9..1ef932f17a 100644
--- a/source3/registry/reg_eventlog.c
+++ b/source3/registry/reg_eventlog.c
@@ -109,18 +109,18 @@ bool eventlog_init_keys(void)
uiRetention = 0x93A80;
regval_ctr_addvalue(values, "MaxSize", REG_DWORD,
- (char *)&uiMaxSize,
+ (uint8 *)&uiMaxSize,
sizeof(uint32));
regval_ctr_addvalue(values, "Retention", REG_DWORD,
- (char *)&uiRetention,
+ (uint8 *)&uiRetention,
sizeof(uint32));
regval_ctr_addvalue_sz(values, "PrimaryModule", *elogs);
push_reg_sz(talloc_tos(), &data, *elogs);
regval_ctr_addvalue(values, "Sources", REG_MULTI_SZ,
- (char *)data.data,
+ data.data,
data.length);
evtfilepath = talloc_asprintf(ctx,
@@ -130,7 +130,7 @@ bool eventlog_init_keys(void)
TALLOC_FREE(values);
}
push_reg_sz(talloc_tos(), &data, evtfilepath);
- regval_ctr_addvalue(values, "File", REG_EXPAND_SZ, (char *)data.data,
+ regval_ctr_addvalue(values, "File", REG_EXPAND_SZ, data.data,
data.length);
regdb_store_values(evtlogpath, values);
@@ -160,14 +160,14 @@ bool eventlog_init_keys(void)
uiCategoryCount = 0x00000007;
regval_ctr_addvalue( values, "CategoryCount",
REG_DWORD,
- ( char * ) &uiCategoryCount,
+ (uint8 *) &uiCategoryCount,
sizeof( uint32 ) );
push_reg_sz(talloc_tos(), &data,
"%SystemRoot%\\system32\\eventlog.dll");
regval_ctr_addvalue( values, "CategoryMessageFile",
REG_EXPAND_SZ,
- ( char * ) data.data,
+ data.data,
data.length);
regdb_store_values( evtlogpath, values );
}
@@ -304,7 +304,7 @@ bool eventlog_add_source( const char *eventlog, const char *sourcename,
}
dump_data( 1, blob.data, blob.length);
regval_ctr_addvalue( values, "Sources", REG_MULTI_SZ,
- ( char * ) blob.data, blob.length);
+ blob.data, blob.length);
regdb_store_values( evtlogpath, values );
data_blob_free(&blob);
} else {
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index e0568d6574..35c88524e4 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -261,13 +261,13 @@ static void fill_service_values(const char *name, struct regval_ctr *values)
I'm just storing them here for cosmetic purposes */
dword = SVCCTL_AUTO_START;
- regval_ctr_addvalue( values, "Start", REG_DWORD, (char*)&dword, sizeof(uint32));
+ regval_ctr_addvalue( values, "Start", REG_DWORD, (uint8 *)&dword, sizeof(uint32));
dword = SERVICE_TYPE_WIN32_OWN_PROCESS;
- regval_ctr_addvalue( values, "Type", REG_DWORD, (char*)&dword, sizeof(uint32));
+ regval_ctr_addvalue( values, "Type", REG_DWORD, (uint8 *)&dword, sizeof(uint32));
dword = SVCCTL_SVC_ERROR_NORMAL;
- regval_ctr_addvalue( values, "ErrorControl", REG_DWORD, (char*)&dword, sizeof(uint32));
+ regval_ctr_addvalue( values, "ErrorControl", REG_DWORD, (uint8 *)&dword, sizeof(uint32));
/* everything runs as LocalSystem */
@@ -426,7 +426,7 @@ static void add_new_svc_name(struct registry_key_handle *key_parent,
}
regval_ctr_addvalue(values, "Security", REG_BINARY,
- (const char *)sd_blob.data, sd_blob.length);
+ sd_blob.data, sd_blob.length);
store_reg_values( key_secdesc, values );
TALLOC_FREE( key_secdesc );
@@ -599,7 +599,7 @@ bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, struct security_desc
return False;
}
- regval_ctr_addvalue( values, "Security", REG_BINARY, (const char *)blob.data, blob.length);
+ regval_ctr_addvalue( values, "Security", REG_BINARY, blob.data, blob.length);
ret = store_reg_values( key, values );
/* cleanup */
diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c
index f03c346feb..2b2ed96f91 100644
--- a/source3/utils/net_rpc_registry.c
+++ b/source3/utils/net_rpc_registry.c
@@ -1047,7 +1047,7 @@ static bool write_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
for ( i=0; i<nk->num_values; i++ ) {
regval_ctr_addvalue( values, nk->values[i].valuename, nk->values[i].type,
- (const char *)nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
+ nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
}
/* copy subkeys into the struct regsubkey_ctr */
diff --git a/source3/utils/profiles.c b/source3/utils/profiles.c
index e4ed8f50ec..5e2cd9a392 100644
--- a/source3/utils/profiles.c
+++ b/source3/utils/profiles.c
@@ -150,7 +150,7 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
for ( i=0; i<nk->num_values; i++ ) {
regval_ctr_addvalue( values, nk->values[i].valuename, nk->values[i].type,
- (const char *)nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
+ nk->values[i].data, (nk->values[i].data_size & ~VK_DATA_IN_OFFSET) );
}
/* copy subkeys into the struct regsubkey_ctr */