summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/tevent/tevent_internal.h2
-rw-r--r--source4/dsdb/samdb/ldb_modules/kludge_acl.c8
-rw-r--r--source4/dsdb/samdb/ldb_modules/partition.c8
-rw-r--r--source4/dsdb/schema/schema_description.c12
-rw-r--r--source4/dsdb/schema/schema_query.c38
-rw-r--r--source4/lib/events/tevent_s4.c4
-rw-r--r--source4/lib/ldb/modules/operational.c8
-rw-r--r--source4/libcli/security/security_descriptor.c1
-rw-r--r--source4/ntvfs/posix/pvfs_resolve.c6
-rw-r--r--source4/utils/ad2oLschema.c4
-rw-r--r--source4/web_server/wsgi.c4
-rw-r--r--source4/winbind/wb_init_domain.c1
12 files changed, 43 insertions, 53 deletions
diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h
index 0d0755f2985..9606fadd553 100644
--- a/lib/tevent/tevent_internal.h
+++ b/lib/tevent/tevent_internal.h
@@ -103,7 +103,7 @@ struct ev_debug_ops {
int ev_set_debug(struct event_context *ev,
void (*debug)(void *context, enum ev_debug_level level,
- const char *fmt, va_list ap),
+ const char *fmt, va_list ap) PRINTF_ATTRIBUTE(3,0),
void *context);
int ev_set_debug_stderr(struct event_context *ev);
void ev_debug(struct event_context *ev, enum ev_debug_level level, const char *fmt, ...);
diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
index 275e9b5299c..bb95c7ee5a1 100644
--- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c
+++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c
@@ -93,7 +93,7 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess
struct ldb_message_element *allowedAttributes;
const struct dsdb_schema *schema = dsdb_get_schema(ldb);
TALLOC_CTX *mem_ctx;
- char **objectclass_list, **attr_list;
+ const char **objectclass_list, **attr_list;
int i, ret;
/* If we don't have a schema yet, we can't do anything... */
@@ -118,7 +118,7 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess
we alter the element array in ldb_msg_add_empty() */
oc_el = ldb_msg_find_element(msg, "objectClass");
- objectclass_list = talloc_array(mem_ctx, char *, oc_el->num_values + 1);
+ objectclass_list = talloc_array(mem_ctx, const char *, oc_el->num_values + 1);
if (!objectclass_list) {
ldb_oom(ldb);
talloc_free(mem_ctx);
@@ -126,11 +126,11 @@ static int kludge_acl_allowedAttributes(struct ldb_context *ldb, struct ldb_mess
}
for (i=0; oc_el && i < oc_el->num_values; i++) {
- objectclass_list[i] = (char *)oc_el->values[i].data;
+ objectclass_list[i] = (const char *)oc_el->values[i].data;
}
objectclass_list[i] = NULL;
- attr_list = dsdb_full_attribute_list(mem_ctx, schema, (const char **)objectclass_list, DSDB_SCHEMA_ALL);
+ attr_list = dsdb_full_attribute_list(mem_ctx, schema, objectclass_list, DSDB_SCHEMA_ALL);
if (!attr_list) {
ldb_asprintf_errstring(ldb, "kludge_acl: Failed to get list of attributes create %s attribute", attrName);
talloc_free(mem_ctx);
diff --git a/source4/dsdb/samdb/ldb_modules/partition.c b/source4/dsdb/samdb/ldb_modules/partition.c
index 0d2ce64604d..0000c87f72f 100644
--- a/source4/dsdb/samdb/ldb_modules/partition.c
+++ b/source4/dsdb/samdb/ldb_modules/partition.c
@@ -1065,11 +1065,11 @@ static int partition_extended(struct ldb_module *module, struct ldb_request *req
static int partition_sort_compare(const void *v1, const void *v2)
{
- struct dsdb_control_current_partition *p1;
- struct dsdb_control_current_partition *p2;
+ const struct dsdb_control_current_partition *p1;
+ const struct dsdb_control_current_partition *p2;
- p1 = *((struct dsdb_control_current_partition **)v1);
- p2 = *((struct dsdb_control_current_partition **)v2);
+ p1 = *((struct dsdb_control_current_partition * const*)v1);
+ p2 = *((struct dsdb_control_current_partition * const*)v2);
return ldb_dn_compare(p1->dn, p2->dn);
}
diff --git a/source4/dsdb/schema/schema_description.c b/source4/dsdb/schema/schema_description.c
index 5474eb5074c..d616f3bb9bb 100644
--- a/source4/dsdb/schema/schema_description.c
+++ b/source4/dsdb/schema/schema_description.c
@@ -215,8 +215,8 @@ char *schema_class_description(TALLOC_CTX *mem_ctx,
const char **auxillary_classes,
const char *subClassOf,
int objectClassCategory,
- char **must,
- char **may,
+ const char **must,
+ const char **may,
const char *schemaHexGUID)
{
char *schema_entry = talloc_asprintf(mem_ctx,
@@ -343,10 +343,10 @@ char *schema_class_to_dITContentRule(TALLOC_CTX *mem_ctx, const struct dsdb_clas
{
int i;
char *schema_description;
- char **aux_class_list = NULL;
- char **attrs;
- char **must_attr_list = NULL;
- char **may_attr_list = NULL;
+ const char **aux_class_list = NULL;
+ const char **attrs;
+ const char **must_attr_list = NULL;
+ const char **may_attr_list = NULL;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
const struct dsdb_class *aux_class;
if (!tmp_ctx) {
diff --git a/source4/dsdb/schema/schema_query.c b/source4/dsdb/schema/schema_query.c
index ca26ffd2068..f848fee3652 100644
--- a/source4/dsdb/schema/schema_query.c
+++ b/source4/dsdb/schema/schema_query.c
@@ -212,18 +212,18 @@ WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *sche
return WERR_OK;
}
-char **merge_attr_list(TALLOC_CTX *mem_ctx,
- char **attrs, const char **new_attrs)
+const char **merge_attr_list(TALLOC_CTX *mem_ctx,
+ const char **attrs, const char * const*new_attrs)
{
- char **ret_attrs;
+ const char **ret_attrs;
int i;
- size_t new_len, orig_len = str_list_length((const char **)attrs);
+ size_t new_len, orig_len = str_list_length(attrs);
if (!new_attrs) {
return attrs;
}
ret_attrs = talloc_realloc(mem_ctx,
- attrs, char *, orig_len + str_list_length(new_attrs) + 1);
+ attrs, const char *, orig_len + str_list_length(new_attrs) + 1);
if (ret_attrs) {
for (i=0; i < str_list_length(new_attrs); i++) {
ret_attrs[orig_len + i] = new_attrs[i];
@@ -241,9 +241,9 @@ char **merge_attr_list(TALLOC_CTX *mem_ctx,
considering subclasses, auxillary classes etc)
*/
-char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class, enum dsdb_attr_list_query query)
+const char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class, enum dsdb_attr_list_query query)
{
- char **attr_list = NULL;
+ const char **attr_list = NULL;
switch (query) {
case DSDB_SCHEMA_ALL_MAY:
attr_list = merge_attr_list(mem_ctx, attr_list, class->mayContain);
@@ -281,7 +281,7 @@ char **dsdb_attribute_list(TALLOC_CTX *mem_ctx, const struct dsdb_class *class,
return attr_list;
}
-static char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx,
+static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx,
const struct dsdb_schema *schema,
const char **class_list,
enum dsdb_attr_list_query query)
@@ -289,39 +289,39 @@ static char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx,
int i;
const struct dsdb_class *class;
- char **attr_list = NULL;
- char **this_class_list;
- char **recursive_list;
+ const char **attr_list = NULL;
+ const char **this_class_list;
+ const char **recursive_list;
for (i=0; class_list && class_list[i]; i++) {
class = dsdb_class_by_lDAPDisplayName(schema, class_list[i]);
this_class_list = dsdb_attribute_list(mem_ctx, class, query);
- attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)this_class_list);
+ attr_list = merge_attr_list(mem_ctx, attr_list, this_class_list);
recursive_list = dsdb_full_attribute_list_internal(mem_ctx, schema,
class->systemAuxiliaryClass,
query);
- attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)recursive_list);
+ attr_list = merge_attr_list(mem_ctx, attr_list, recursive_list);
recursive_list = dsdb_full_attribute_list_internal(mem_ctx, schema,
class->auxiliaryClass,
query);
- attr_list = merge_attr_list(mem_ctx, attr_list, (const char **)recursive_list);
+ attr_list = merge_attr_list(mem_ctx, attr_list, recursive_list);
}
return attr_list;
}
-char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx,
+const char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx,
const struct dsdb_schema *schema,
const char **class_list,
enum dsdb_attr_list_query query)
{
- char **attr_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class_list, query);
- size_t new_len = str_list_length((const char **)attr_list);
+ const char **attr_list = dsdb_full_attribute_list_internal(mem_ctx, schema, class_list, query);
+ size_t new_len = str_list_length(attr_list);
/* Remove duplicates */
if (new_len > 1) {
@@ -331,8 +331,8 @@ char **dsdb_full_attribute_list(TALLOC_CTX *mem_ctx,
(comparison_fn_t)strcasecmp);
for (i=1 ; i < new_len; i++) {
- char **val1 = &attr_list[i-1];
- char **val2 = &attr_list[i];
+ const char **val1 = &attr_list[i-1];
+ const char **val2 = &attr_list[i];
if (ldb_attr_cmp(*val1, *val2) == 0) {
memmove(val1, val2, (new_len - i) * sizeof( *attr_list));
new_len--;
diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c
index 80267fdd22f..e711e437615 100644
--- a/source4/lib/events/tevent_s4.c
+++ b/source4/lib/events/tevent_s4.c
@@ -17,8 +17,8 @@
*/
#include "includes.h"
-#include "tevent.h"
-#include "tevent_internal.h"
+#include <tevent.h>
+#include <tevent_internal.h>
/*
this is used to catch debug messages from events
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index 345441b5e1d..4193f916a01 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -268,16 +268,12 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
}
}
- /* use new set of attrs if any */
- if (search_attrs == NULL) {
- search_attrs = req->op.search.attrs;
- }
-
ret = ldb_build_search_req_ex(&down_req, module->ldb, ac,
req->op.search.base,
req->op.search.scope,
req->op.search.tree,
- (const char * const *)search_attrs,
+ /* use new set of attrs if any */
+ search_attrs?req->op.search.attrs:search_attrs,
req->controls,
ac, operational_callback,
req);
diff --git a/source4/libcli/security/security_descriptor.c b/source4/libcli/security/security_descriptor.c
index 2bce8e8b08a..8e9c7eb4a9b 100644
--- a/source4/libcli/security/security_descriptor.c
+++ b/source4/libcli/security/security_descriptor.c
@@ -53,7 +53,6 @@ static struct security_acl *security_acl_dup(TALLOC_CTX *mem_ctx,
const struct security_acl *oacl)
{
struct security_acl *nacl;
- int i;
nacl = talloc (mem_ctx, struct security_acl);
if (nacl == NULL) {
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c
index f08de72a38e..43547c275b5 100644
--- a/source4/ntvfs/posix/pvfs_resolve.c
+++ b/source4/ntvfs/posix/pvfs_resolve.c
@@ -190,16 +190,16 @@ static NTSTATUS parse_stream_name(struct smb_iconv_convenience *ic,
struct pvfs_filename *name,
const char *s)
{
- char *p;
+ char *p, *stream_name;
if (s[1] == '\0') {
return NT_STATUS_OBJECT_NAME_INVALID;
}
- name->stream_name = talloc_strdup(name, s+1);
+ name->stream_name = stream_name = talloc_strdup(name, s+1);
if (name->stream_name == NULL) {
return NT_STATUS_NO_MEMORY;
}
- p = name->stream_name;
+ p = stream_name;
while (*p) {
size_t c_size;
diff --git a/source4/utils/ad2oLschema.c b/source4/utils/ad2oLschema.c
index 2e3139d9c75..29fda09f3c4 100644
--- a/source4/utils/ad2oLschema.c
+++ b/source4/utils/ad2oLschema.c
@@ -304,8 +304,8 @@ static struct schema_conv process_convert(struct ldb_context *ldb, enum dsdb_sch
const char *oid = objectclass->governsID_oid;
const char *subClassOf = objectclass->subClassOf;
int objectClassCategory = objectclass->objectClassCategory;
- char **must;
- char **may;
+ const char **must;
+ const char **may;
char *schema_entry = NULL;
const char *objectclass_name_as_list[] = {
objectclass->lDAPDisplayName,
diff --git a/source4/web_server/wsgi.c b/source4/web_server/wsgi.c
index dcbb3c7fb66..9b660ff3627 100644
--- a/source4/web_server/wsgi.c
+++ b/source4/web_server/wsgi.c
@@ -194,7 +194,6 @@ static PyObject *py_input_read(PyObject *_self, PyObject *args, PyObject *kwargs
static PyObject *py_input_readline(PyObject *_self)
{
- input_Stream_Object *self = (input_Stream_Object *)_self;
/* FIXME */
PyErr_SetString(PyExc_NotImplementedError,
"readline() not yet implemented");
@@ -204,9 +203,7 @@ static PyObject *py_input_readline(PyObject *_self)
static PyObject *py_input_readlines(PyObject *_self, PyObject *args, PyObject *kwargs)
{
const char *kwnames[] = { "hint", NULL };
- PyObject *ret;
int hint;
- input_Stream_Object *self = (input_Stream_Object *)_self;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|i", discard_const_p(char *, kwnames), &hint))
return NULL;
@@ -219,7 +216,6 @@ static PyObject *py_input_readlines(PyObject *_self, PyObject *args, PyObject *k
static PyObject *py_input___iter__(PyObject *_self)
{
- input_Stream_Object *self = (input_Stream_Object *)_self;
/* FIXME */
PyErr_SetString(PyExc_NotImplementedError,
"__iter__() not yet implemented");
diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c
index 8011cba19c2..5953474c52f 100644
--- a/source4/winbind/wb_init_domain.c
+++ b/source4/winbind/wb_init_domain.c
@@ -388,7 +388,6 @@ static void init_domain_recv_queryinfo(struct rpc_request *req)
* open an LDAP connection */
static void init_domain_recv_samr(struct composite_context *ctx)
{
- const char *ldap_url;
struct init_domain_state *state =
talloc_get_type(ctx->async.private_data,
struct init_domain_state);