diff options
37 files changed, 103 insertions, 103 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c index 708e2f8d73..918890b3f6 100644 --- a/source4/auth/auth.c +++ b/source4/auth/auth.c @@ -500,7 +500,7 @@ const struct auth_operations *auth_backend_byname(const char *name) */ const struct auth_critical_sizes *auth_interface_version(void) { - const static struct auth_critical_sizes critical_sizes = { + static const struct auth_critical_sizes critical_sizes = { AUTH_INTERFACE_VERSION, sizeof(struct auth_operations), sizeof(struct auth_method_context), diff --git a/source4/auth/gensec/cyrus_sasl.c b/source4/auth/gensec/cyrus_sasl.c index 331499a466..64a0b2f0c7 100644 --- a/source4/auth/gensec/cyrus_sasl.c +++ b/source4/auth/gensec/cyrus_sasl.c @@ -365,7 +365,7 @@ NTSTATUS gensec_sasl_init(void) int sasl_ret, i; const char **sasl_mechs; - const sasl_callback_t callbacks[] = { + static const sasl_callback_t callbacks[] = { { .id = SASL_CB_LOG, .proc = gensec_sasl_log, diff --git a/source4/auth/gensec/schannel_sign.c b/source4/auth/gensec/schannel_sign.c index 71ac0cc933..1e57beba08 100644 --- a/source4/auth/gensec/schannel_sign.c +++ b/source4/auth/gensec/schannel_sign.c @@ -113,7 +113,7 @@ NTSTATUS schannel_unseal_packet(struct gensec_security *gensec_security, uint8_t confounder[8]; uint8_t seq_num[8]; uint8_t sealing_key[16]; - const uint8_t netsec_sig[8] = NETSEC_SEAL_SIGNATURE; + static const uint8_t netsec_sig[8] = NETSEC_SEAL_SIGNATURE; if (sig->length != 32) { return NT_STATUS_ACCESS_DENIED; @@ -162,7 +162,7 @@ NTSTATUS schannel_check_packet(struct gensec_security *gensec_security, uint8_t digest_final[16]; uint8_t seq_num[8]; - const uint8_t netsec_sig[8] = NETSEC_SIGN_SIGNATURE; + static const uint8_t netsec_sig[8] = NETSEC_SIGN_SIGNATURE; /* w2k sends just 24 bytes and skip the confounder */ if (sig->length != 32 && sig->length != 24) { @@ -212,7 +212,7 @@ NTSTATUS schannel_seal_packet(struct gensec_security *gensec_security, uint8_t confounder[8]; uint8_t seq_num[8]; uint8_t sealing_key[16]; - const uint8_t netsec_sig[8] = NETSEC_SEAL_SIGNATURE; + static const uint8_t netsec_sig[8] = NETSEC_SEAL_SIGNATURE; generate_random_buffer(confounder, 8); @@ -258,7 +258,7 @@ NTSTATUS schannel_sign_packet(struct gensec_security *gensec_security, uint8_t digest_final[16]; uint8_t seq_num[8]; - const uint8_t netsec_sig[8] = NETSEC_SIGN_SIGNATURE; + static const uint8_t netsec_sig[8] = NETSEC_SIGN_SIGNATURE; RSIVAL(seq_num, 0, state->seq_num); SIVAL(seq_num, 4, state->initiator?0x80:0); diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c index c692aa1bc3..08c152c3a5 100644 --- a/source4/client/cifsdd.c +++ b/source4/client/cifsdd.c @@ -59,7 +59,7 @@ static void dd_handle_signal(int sig) static const char * argtype_str(enum argtype arg_type) { - const struct { + static const struct { enum argtype arg_type; const char * arg_name; } names [] = @@ -295,7 +295,7 @@ static void cifsdd_help_message(poptContext pctx, const char * parg, void * pdata) { - const char notes[] = + static const char notes[] = "FILE can be a local filename or a UNC path of the form //server/share/path.\n"; char prefix[24]; diff --git a/source4/cluster/ctdb/brlock_ctdb.c b/source4/cluster/ctdb/brlock_ctdb.c index 1b22c6c727..c38d666c3c 100644 --- a/source4/cluster/ctdb/brlock_ctdb.c +++ b/source4/cluster/ctdb/brlock_ctdb.c @@ -102,7 +102,7 @@ static void show_locks(const char *op, struct lock_struct *locks, int count) talloc_free(). We need the messaging_ctx to allow for pending lock notifications. */ -static struct brl_context *brl_ctdb_init(TALLOC_CTX *mem_ctx, struct server_id server, struct loadparm_context *lp_ctx, +static struct brl_context *brl_ctdb_init(TALLOC_CTX *mem_ctx, struct server_id server, struct messaging_context *messaging_ctx) { struct ctdb_context *ctdb = talloc_get_type(cluster_backend_handle(), diff --git a/source4/cluster/ctdb/tools/ctdb.c b/source4/cluster/ctdb/tools/ctdb.c index 7d25c068bc..2308261d00 100644 --- a/source4/cluster/ctdb/tools/ctdb.c +++ b/source4/cluster/ctdb/tools/ctdb.c @@ -241,7 +241,7 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv printf("Number of nodes:%d\n", nodemap->num); for(i=0;i<nodemap->num;i++){ - const struct { + static const struct { uint32_t flag; const char *name; } flag_names[] = { diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c index 70224152eb..8c0d8e5897 100644 --- a/source4/dsdb/repl/drepl_partitions.c +++ b/source4/dsdb/repl/drepl_partitions.c @@ -40,7 +40,7 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s) struct ldb_dn *basedn; struct ldb_result *r; struct ldb_message_element *el; - const char *attrs[] = { "namingContexts", NULL }; + static const char *attrs[] = { "namingContexts", NULL }; uint32_t i; int ret; @@ -188,7 +188,7 @@ static WERROR dreplsrv_refresh_partition(struct dreplsrv_service *s, struct ldb_result *r; uint32_t i; int ret; - const char *attrs[] = { + static const char *attrs[] = { "objectSid", "objectGUID", "replUpToDateVector", diff --git a/source4/dsdb/samdb/ldb_modules/kludge_acl.c b/source4/dsdb/samdb/ldb_modules/kludge_acl.c index 9a05c866c5..97130495a3 100644 --- a/source4/dsdb/samdb/ldb_modules/kludge_acl.c +++ b/source4/dsdb/samdb/ldb_modules/kludge_acl.c @@ -408,7 +408,7 @@ static int kludge_acl_init(struct ldb_module *module) { int ret, i; TALLOC_CTX *mem_ctx = talloc_new(module); - const char *attrs[] = { "passwordAttribute", NULL }; + static const char *attrs[] = { "passwordAttribute", NULL }; struct ldb_result *res; struct ldb_message *msg; struct ldb_message_element *password_attributes; diff --git a/source4/dsdb/samdb/ldb_modules/local_password.c b/source4/dsdb/samdb/ldb_modules/local_password.c index bbbbbd71c8..350434df51 100644 --- a/source4/dsdb/samdb/ldb_modules/local_password.c +++ b/source4/dsdb/samdb/ldb_modules/local_password.c @@ -378,7 +378,7 @@ static int get_self_callback(struct ldb_context *ldb, void *context, struct ldb_ static int local_password_mod_search_self(struct ldb_handle *h) { struct lpdb_context *ac; - const char * const attrs[] = { "objectGUID", "objectClass", NULL }; + static const char * const attrs[] = { "objectGUID", "objectClass", NULL }; ac = talloc_get_type(h->private_data, struct lpdb_context); diff --git a/source4/dsdb/samdb/ldb_modules/naming_fsmo.c b/source4/dsdb/samdb/ldb_modules/naming_fsmo.c index 41d35dffc1..d6b6a24287 100644 --- a/source4/dsdb/samdb/ldb_modules/naming_fsmo.c +++ b/source4/dsdb/samdb/ldb_modules/naming_fsmo.c @@ -38,7 +38,7 @@ static int naming_fsmo_init(struct ldb_module *module) struct dsdb_naming_fsmo *naming_fsmo; struct ldb_result *naming_res; int ret; - const char *naming_attrs[] = { + static const char *naming_attrs[] = { "fSMORoleOwner", NULL }; diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index 44a940f97b..da5cae1c65 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -361,7 +361,7 @@ static int fix_attributes(struct ldb_context *ldb, const struct dsdb_schema *sch static int objectclass_add(struct ldb_module *module, struct ldb_request *req) { - const char * const attrs[] = { NULL }; + static const char * const attrs[] = { NULL }; struct ldb_handle *h; struct oc_context *ac; @@ -748,7 +748,7 @@ static int objectclass_search_self(struct ldb_handle *h) { int ret; struct oc_context *ac; - const char * const attrs[] = { "objectClass", NULL }; + static const char * const attrs[] = { "objectClass", NULL }; ac = talloc_get_type(h->private_data, struct oc_context); @@ -865,7 +865,7 @@ static int objectclass_do_mod(struct ldb_handle *h) { static int objectclass_rename(struct ldb_module *module, struct ldb_request *req) { - const char * const attrs[] = { NULL }; + static const char * const attrs[] = { NULL }; struct ldb_handle *h; struct oc_context *ac; diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 03c2bbc7ae..d139cc23a4 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1198,7 +1198,7 @@ static int build_domain_data_request(struct ph_context *ac) /* attrs[] is returned from this function in ac->dom_req->op.search.attrs, so it must be static, as otherwise the compiler can put it on the stack */ - const char * const attrs[] = { "pwdProperties", "pwdHistoryLength", NULL }; + static const char * const attrs[] = { "pwdProperties", "pwdHistoryLength", NULL }; char *filter; ac->dom_req = talloc_zero(ac, struct ldb_request); @@ -1662,7 +1662,7 @@ static int get_self_callback(struct ldb_context *ldb, void *context, struct ldb_ static int password_hash_mod_search_self(struct ldb_handle *h) { struct ph_context *ac; - const char * const attrs[] = { "userAccountControl", "lmPwdHistory", + static const char * const attrs[] = { "userAccountControl", "lmPwdHistory", "ntPwdHistory", "objectSid", "msDS-KeyVersionNumber", "objectClass", "userPrincipalName", diff --git a/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c b/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c index d27b0c12f7..0f3293ed1d 100644 --- a/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c +++ b/source4/dsdb/samdb/ldb_modules/pdc_fsmo.c @@ -37,7 +37,7 @@ static int pdc_fsmo_init(struct ldb_module *module) struct dsdb_pdc_fsmo *pdc_fsmo; struct ldb_result *pdc_res; int ret; - const char *pdc_attrs[] = { + static const char *pdc_attrs[] = { "fSMORoleOwner", NULL }; diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c b/source4/dsdb/samdb/ldb_modules/ranged_results.c index 345b8b8440..affc01d413 100644 --- a/source4/dsdb/samdb/ldb_modules/ranged_results.c +++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c @@ -40,7 +40,7 @@ static int rr_search_callback(struct ldb_context *ldb, void *context, struct ldb { struct rr_context *rr_context = talloc_get_type(context, struct rr_context); struct ldb_request *orig_req = rr_context->orig_req; - int i, j; + int i, j, ret; if (ares->type != LDB_REPLY_ENTRY) { return rr_context->orig_req->callback(ldb, rr_context->orig_req->context, ares); diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index b37ac49b28..497ee373de 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1519,7 +1519,7 @@ static int replmd_replicated_uptodate_search_callback(struct ldb_context *ldb, static int replmd_replicated_uptodate_search(struct replmd_replicated_request *ar) { int ret; - const char *attrs[] = { + static const char *attrs[] = { "replUpToDateVector", "repsFrom", NULL diff --git a/source4/dsdb/samdb/ldb_modules/schema.c b/source4/dsdb/samdb/ldb_modules/schema.c index 5c7b72c12c..525193ac8c 100644 --- a/source4/dsdb/samdb/ldb_modules/schema.c +++ b/source4/dsdb/samdb/ldb_modules/schema.c @@ -235,7 +235,7 @@ struct schema_attribute **schema_get_attrs_list(struct ldb_module *module, static int schema_init_attrs(struct ldb_module *module, struct schema_private_data *data) { - const char *schema_attrs[] = { "attributeID", + static const char *schema_attrs[] = { "attributeID", "lDAPDisplayName", "attributeSyntax", "oMSyntax", @@ -1156,7 +1156,7 @@ static int schema_wait(struct ldb_handle *handle, enum ldb_wait_type type) static int schema_init(struct ldb_module *module) { - const char *schema_attrs[] = { "schemaNamingContext", NULL }; + static const char *schema_attrs[] = { "schemaNamingContext", NULL }; struct schema_private_data *data; struct ldb_result *res; int ret; diff --git a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c index ade576ac99..559c91bd2d 100644 --- a/source4/dsdb/samdb/ldb_modules/schema_fsmo.c +++ b/source4/dsdb/samdb/ldb_modules/schema_fsmo.c @@ -46,7 +46,7 @@ static int schema_fsmo_init(struct ldb_module *module) struct ldb_result *c_res; uint32_t i; int ret; - const char *schema_attrs[] = { + static const char *schema_attrs[] = { "prefixMap", "schemaInfo", "fSMORoleOwner", diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c index a5a3ba6aef..7efcccc9ff 100644 --- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c +++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c @@ -752,7 +752,7 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque entryuuid_private->base_dns && entryuuid_private->base_dns[i]; i++) { - const char *contextCSN_attr[] = { + static const char *contextCSN_attr[] = { "contextCSN", NULL }; search_req = talloc(req, struct ldb_request); diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c index 3d17d2746e..f15b03c9b4 100644 --- a/source4/dsdb/schema/schema_init.c +++ b/source4/dsdb/schema/schema_init.c @@ -1062,7 +1062,7 @@ int dsdb_set_schema(struct ldb_context *ldb, struct dsdb_schema *schema) /** * Global variable to hold one copy of the schema, used to avoid memory bloat */ -static const struct dsdb_schema *global_schema; +static struct dsdb_schema *global_schema; /** * Make this ldb use the 'global' schema, setup to avoid having multiple copies in this process diff --git a/source4/heimdal/kdc/digest.c b/source4/heimdal/kdc/digest.c index a87371de25..358ca5ad56 100644 --- a/source4/heimdal/kdc/digest.c +++ b/source4/heimdal/kdc/digest.c @@ -726,7 +726,7 @@ _kdc_do_digest(krb5_context context, /* conf|int */ if (strcmp(ireq.u.digestRequest.digest, "clear") != 0) { - const char conf_zeros[] = ":00000000000000000000000000000000"; + static char conf_zeros[] = ":00000000000000000000000000000000"; MD5_Update(&ctx, conf_zeros, sizeof(conf_zeros) - 1); } diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index ab4abe6701..87f791cb38 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -162,7 +162,7 @@ void ldb_set_default_dns(struct ldb_context *ldb) int ret; struct ldb_result *res; struct ldb_dn *tmp_dn=NULL; - const char *attrs[] = { + static const char *attrs[] = { "rootDomainNamingContext", "configurationNamingContext", "schemaNamingContext", diff --git a/source4/lib/ldb/ldb_map/ldb_map.c b/source4/lib/ldb/ldb_map/ldb_map.c index 87f5f25392..39df427c2c 100644 --- a/source4/lib/ldb/ldb_map/ldb_map.c +++ b/source4/lib/ldb/ldb_map/ldb_map.c @@ -867,7 +867,7 @@ static int map_objectclass_convert_operator(struct ldb_module *module, void *mem struct ldb_parse_tree **new, const struct ldb_parse_tree *tree) { - const struct ldb_map_attribute objectclass_map = { + static const struct ldb_map_attribute objectclass_map = { .local_name = "objectClass", .type = MAP_CONVERT, .u = { @@ -956,7 +956,7 @@ struct ldb_request *map_search_self_req(struct map_context *ac, struct ldb_dn *d /* attrs[] is returned from this function in * ac->search_req->op.search.attrs, so it must be static, as * otherwise the compiler can put it on the stack */ - const char * const attrs[] = { IS_MAPPED, NULL }; + static const char * const attrs[] = { IS_MAPPED, NULL }; struct ldb_parse_tree *tree; /* Limit search to records with 'IS_MAPPED' present */ @@ -1242,7 +1242,7 @@ static const struct ldb_map_attribute builtin_attribute_maps[] = { * base DNs in private data. */ static int map_init_dns(struct ldb_module *module, struct ldb_map_context *data, const char *name) { - const char * const attrs[] = { MAP_DN_FROM, MAP_DN_TO, NULL }; + static const char * const attrs[] = { MAP_DN_FROM, MAP_DN_TO, NULL }; struct ldb_dn *dn; struct ldb_message *msg; struct ldb_result *res; diff --git a/source4/lib/ldb/modules/paged_searches.c b/source4/lib/ldb/modules/paged_searches.c index 69ce219362..749858b49b 100644 --- a/source4/lib/ldb/modules/paged_searches.c +++ b/source4/lib/ldb/modules/paged_searches.c @@ -407,7 +407,7 @@ static int check_supported_paged(struct ldb_context *ldb, void *context, static int ps_init(struct ldb_module *module) { - const char *attrs[] = { "supportedControl", NULL }; + static const char *attrs[] = { "supportedControl", NULL }; struct private_data *data; int ret; struct ldb_request *req; diff --git a/source4/lib/replace/inet_ntop.c b/source4/lib/replace/inet_ntop.c index 1b84cda6f0..fb3d8e90c8 100644 --- a/source4/lib/replace/inet_ntop.c +++ b/source4/lib/replace/inet_ntop.c @@ -74,7 +74,7 @@ rep_inet_ntop(int af, const void *src, char *dst, socklen_t size) static const char * inet_ntop4(const unsigned char *src, char *dst, socklen_t size) { - const char *fmt = "%u.%u.%u.%u"; + static const char *fmt = "%u.%u.%u.%u"; char tmp[sizeof "255.255.255.255"]; size_t len; diff --git a/source4/lib/replace/inet_pton.c b/source4/lib/replace/inet_pton.c index ea0fe6b78c..80e4865ef4 100644 --- a/source4/lib/replace/inet_pton.c +++ b/source4/lib/replace/inet_pton.c @@ -77,7 +77,7 @@ inet_pton4(src, dst) const char *src; unsigned char *dst; { - const char digits[] = "0123456789"; + static const char digits[] = "0123456789"; int saw_digit, octets, ch; unsigned char tmp[NS_INADDRSZ], *tp; @@ -131,7 +131,7 @@ inet_pton6(src, dst) const char *src; unsigned char *dst; { - const char xdigits_l[] = "0123456789abcdef", + static const char xdigits_l[] = "0123456789abcdef", xdigits_u[] = "0123456789ABCDEF"; unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; const char *xdigits, *curtok; diff --git a/source4/lib/replace/timegm.c b/source4/lib/replace/timegm.c index 86f360bd3c..395c684e11 100644 --- a/source4/lib/replace/timegm.c +++ b/source4/lib/replace/timegm.c @@ -46,7 +46,7 @@ static int is_leap(unsigned y) time_t rep_timegm(struct tm *tm) { - const unsigned ndays[2][12] ={ + static const unsigned ndays[2][12] ={ {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; time_t res = 0; diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c index 264a6b39ee..fd15ff2fc7 100644 --- a/source4/libcli/ldap/ldap_bind.c +++ b/source4/libcli/ldap/ldap_bind.c @@ -215,7 +215,7 @@ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, const char **sasl_names; uint32_t old_gensec_features; - const char *supported_sasl_mech_attrs[] = { + static const char *supported_sasl_mech_attrs[] = { "supportedSASLMechanisms", NULL }; diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c index 576c86f3e6..4d09422bec 100644 --- a/source4/libnet/libnet_become_dc.c +++ b/source4/libnet/libnet_become_dc.c @@ -809,7 +809,7 @@ static NTSTATUS becomeDC_ldap1_rootdse(struct libnet_BecomeDC_state *s) int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "*", NULL }; @@ -853,7 +853,7 @@ static NTSTATUS becomeDC_ldap1_crossref_behavior_version(struct libnet_BecomeDC_ int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "msDs-Behavior-Version", NULL }; @@ -882,7 +882,7 @@ static NTSTATUS becomeDC_ldap1_domain_behavior_version(struct libnet_BecomeDC_st int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "msDs-Behavior-Version", NULL }; @@ -911,7 +911,7 @@ static NTSTATUS becomeDC_ldap1_schema_object_version(struct libnet_BecomeDC_stat int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "objectVersion", NULL }; @@ -940,7 +940,7 @@ static NTSTATUS becomeDC_ldap1_w2k3_update_revision(struct libnet_BecomeDC_state int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "revision", NULL }; @@ -976,19 +976,19 @@ static NTSTATUS becomeDC_ldap1_infrastructure_fsmo(struct libnet_BecomeDC_state struct ldb_dn *basedn; struct ldb_dn *ntds_dn; struct ldb_dn *server_dn; - const char *_1_1_attrs[] = { + static const char *_1_1_attrs[] = { "1.1", NULL }; - const char *fsmo_attrs[] = { + static const char *fsmo_attrs[] = { "fSMORoleOwner", NULL }; - const char *dns_attrs[] = { + static const char *dns_attrs[] = { "dnsHostName", NULL }; - const char *guid_attrs[] = { + static const char *guid_attrs[] = { "objectGUID", NULL }; @@ -1074,19 +1074,19 @@ static NTSTATUS becomeDC_ldap1_rid_manager_fsmo(struct libnet_BecomeDC_state *s) const char *reference_dn_str; struct ldb_dn *ntds_dn; struct ldb_dn *server_dn; - const char *rid_attrs[] = { + static const char *rid_attrs[] = { "rIDManagerReference", NULL }; - const char *fsmo_attrs[] = { + static const char *fsmo_attrs[] = { "fSMORoleOwner", NULL }; - const char *dns_attrs[] = { + static const char *dns_attrs[] = { "dnsHostName", NULL }; - const char *guid_attrs[] = { + static const char *guid_attrs[] = { "objectGUID", NULL }; @@ -1212,7 +1212,7 @@ static NTSTATUS becomeDC_ldap1_computer_object(struct libnet_BecomeDC_state *s) struct ldb_result *r; struct ldb_dn *basedn; char *filter; - const char *attrs[] = { + static const char *attrs[] = { "distinguishedName", "userAccountControl", NULL @@ -1306,7 +1306,7 @@ static NTSTATUS becomeDC_ldap1_server_object_2(struct libnet_BecomeDC_state *s) struct ldb_result *r; struct ldb_dn *basedn; const char *server_reference_bl_dn_str; - const char *attrs[] = { + static const char *attrs[] = { "serverReferenceBL", NULL }; @@ -2852,7 +2852,7 @@ static NTSTATUS becomeDC_ldap2_move_computer(struct libnet_BecomeDC_state *s) struct ldb_dn *basedn; struct ldb_dn *old_dn; struct ldb_dn *new_dn; - const char *_1_1_attrs[] = { + static const char *_1_1_attrs[] = { "1.1", NULL }; diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c index 1ab5645a98..415912e34d 100644 --- a/source4/libnet/libnet_unbecome_dc.c +++ b/source4/libnet/libnet_unbecome_dc.c @@ -326,7 +326,7 @@ static NTSTATUS unbecomeDC_ldap_rootdse(struct libnet_UnbecomeDC_state *s) int ret; struct ldb_result *r; struct ldb_dn *basedn; - const char *attrs[] = { + static const char *attrs[] = { "defaultNamingContext", "configurationNamingContext", NULL @@ -370,7 +370,7 @@ static NTSTATUS unbecomeDC_ldap_computer_object(struct libnet_UnbecomeDC_state * struct ldb_result *r; struct ldb_dn *basedn; char *filter; - const char *attrs[] = { + static const char *attrs[] = { "distinguishedName", "userAccountControl", NULL @@ -451,7 +451,7 @@ static NTSTATUS unbecomeDC_ldap_move_computer(struct libnet_UnbecomeDC_state *s) struct ldb_dn *basedn; struct ldb_dn *old_dn; struct ldb_dn *new_dn; - const char *_1_1_attrs[] = { + static const char *_1_1_attrs[] = { "1.1", NULL }; diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 9142495a8a..a97b93a051 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -41,10 +41,10 @@ static WERROR dcesrv_drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_C struct GUID site_guid; struct ldb_result *site_res; struct ldb_dn *server_site_dn; - const char *site_attrs[] = { "objectGUID", NULL }; + static const char *site_attrs[] = { "objectGUID", NULL }; struct ldb_result *ntds_res; struct ldb_dn *ntds_dn; - const char *ntds_attrs[] = { "ms-DS-ReplicationEpoch", NULL }; + static const char *ntds_attrs[] = { "ms-DS-ReplicationEpoch", NULL }; uint32_t u1; uint32_t repl_epoch; int ret; diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c index a0bd34b154..03f3601257 100644 --- a/source4/rpc_server/samr/dcesrv_samr.c +++ b/source4/rpc_server/samr/dcesrv_samr.c @@ -749,7 +749,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, switch (r->in.level) { case 1: { - const char * const attrs2[] = { "minPwdLength", "pwdHistoryLength", + static const char * const attrs2[] = { "minPwdLength", "pwdHistoryLength", "pwdProperties", "maxPwdAge", "minPwdAge", NULL }; attrs = attrs2; @@ -757,7 +757,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 2: { - const char * const attrs2[] = {"forceLogoff", + static const char * const attrs2[] = {"forceLogoff", "comment", "modifiedCount", "fSMORoleOwner", @@ -767,14 +767,14 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 3: { - const char * const attrs2[] = {"forceLogoff", + static const char * const attrs2[] = {"forceLogoff", NULL}; attrs = attrs2; break; } case 4: { - const char * const attrs2[] = {"comment", + static const char * const attrs2[] = {"comment", NULL}; attrs = attrs2; break; @@ -786,7 +786,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 6: { - const char * const attrs2[] = {"fSMORoleOwner", + static const char * const attrs2[] = {"fSMORoleOwner", NULL}; attrs = attrs2; break; @@ -798,7 +798,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 8: { - const char * const attrs2[] = { "modifiedCount", + static const char * const attrs2[] = { "modifiedCount", "creationTime", NULL }; attrs = attrs2; @@ -809,7 +809,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, break; case 11: { - const char * const attrs2[] = { "comment", "forceLogoff", + static const char * const attrs2[] = { "comment", "forceLogoff", "modifiedCount", "lockoutDuration", "lockOutObservationWindow", @@ -820,7 +820,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 12: { - const char * const attrs2[] = { "lockoutDuration", + static const char * const attrs2[] = { "lockoutDuration", "lockOutObservationWindow", "lockoutThreshold", NULL}; @@ -829,7 +829,7 @@ static NTSTATUS dcesrv_samr_QueryDomainInfo(struct dcesrv_call_state *dce_call, } case 13: { - const char * const attrs2[] = { "modifiedCount", + static const char * const attrs2[] = { "modifiedCount", "creationTime", NULL }; attrs = attrs2; @@ -2944,7 +2944,7 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA switch (r->in.level) { case 1: { - const char * const attrs2[] = {"sAMAccountName", "displayName", + static const char * const attrs2[] = {"sAMAccountName", "displayName", "primaryGroupID", "description", "comment", NULL}; attrs = attrs2; @@ -2952,13 +2952,13 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA } case 2: { - const char * const attrs2[] = {"comment", "countryCode", "codePage", NULL}; + static const char * const attrs2[] = {"comment", "countryCode", "codePage", NULL}; attrs = attrs2; break; } case 3: { - const char * const attrs2[] = {"sAMAccountName", + static const char * const attrs2[] = {"sAMAccountName", "displayName", "objectSid", "primaryGroupID", @@ -2979,13 +2979,13 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA } case 4: { - const char * const attrs2[] = {"logonHours", NULL}; + static const char * const attrs2[] = {"logonHours", NULL}; attrs = attrs2; break; } case 5: { - const char * const attrs2[] = {"sAMAccountName", + static const char * const attrs2[] = {"sAMAccountName", "displayName", "objectSid", "primaryGroupID", @@ -3009,79 +3009,79 @@ static NTSTATUS dcesrv_samr_QueryUserInfo(struct dcesrv_call_state *dce_call, TA } case 6: { - const char * const attrs2[] = {"sAMAccountName", "displayName", NULL}; + static const char * const attrs2[] = {"sAMAccountName", "displayName", NULL}; attrs = attrs2; break; } case 7: { - const char * const attrs2[] = {"sAMAccountName", NULL}; + static const char * const attrs2[] = {"sAMAccountName", NULL}; attrs = attrs2; break; } case 8: { - const char * const attrs2[] = {"displayName", NULL}; + static const char * const attrs2[] = {"displayName", NULL}; attrs = attrs2; break; } case 9: { - const char * const attrs2[] = {"primaryGroupID", NULL}; + static const char * const attrs2[] = {"primaryGroupID", NULL}; attrs = attrs2; break; } case 10: { - const char * const attrs2[] = {"homeDirectory", "homeDrive", NULL}; + static const char * const attrs2[] = {"homeDirectory", "homeDrive", NULL}; attrs = attrs2; break; } case 11: { - const char * const attrs2[] = {"scriptPath", NULL}; + static const char * const attrs2[] = {"scriptPath", NULL}; attrs = attrs2; break; } case 12: { - const char * const attrs2[] = {"profilePath", NULL}; + static const char * const attrs2[] = {"profilePath", NULL}; attrs = attrs2; break; } case 13: { - const char * const attrs2[] = {"description", NULL}; + static const char * const attrs2[] = {"description", NULL}; attrs = attrs2; break; } case 14: { - const char * const attrs2[] = {"userWorkstations", NULL}; + static const char * const attrs2[] = {"userWorkstations", NULL}; attrs = attrs2; break; } case 16: { - const char * const attrs2[] = {"userAccountControl", NULL}; + static const char * const attrs2[] = {"userAccountControl", NULL}; attrs = attrs2; break; } case 17: { - const char * const attrs2[] = {"accountExpires", NULL}; + static const char * const attrs2[] = {"accountExpires", NULL}; attrs = attrs2; break; } case 20: { - const char * const attrs2[] = {"userParameters", NULL}; + static const char * const attrs2[] = {"userParameters", NULL}; attrs = attrs2; break; } case 21: { - const char * const attrs2[] = {"lastLogon", + static const char * const attrs2[] = {"lastLogon", "lastLogoff", "pwdLastSet", "accountExpires", diff --git a/source4/scripting/ejs/ejsnet/net_user.c b/source4/scripting/ejs/ejsnet/net_user.c index 4b0923216b..34524cc0fa 100644 --- a/source4/scripting/ejs/ejsnet/net_user.c +++ b/source4/scripting/ejs/ejsnet/net_user.c @@ -197,7 +197,7 @@ static int ejs_net_deleteuser(MprVarHandle eid, int argc, char **argv) } /* domain where the account is to be deleted */ - userman_domain = (const char*)mprGetThisPtr(eid, "domain"); + userman_domain = (struct libnet_context *)mprGetThisPtr(eid, "domain"); if (!userman_domain) { ejsSetErrorMsg(eid, "domain property returns null pointer"); goto done; @@ -260,7 +260,7 @@ static int ejs_net_userinfo(MprVarHandle eid, int argc, char **argv) } /* domain where the user account is to be queried */ - userman_domain = (const char *)mprGetThisPtr(eid, "domain"); + userman_domain = (struct libnet_context *)mprGetThisPtr(eid, "domain"); if (userman_domain == NULL) { ejsSetErrorMsg(eid, "domain property returns null pointer"); return -1; diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c index 1f3018fc5e..7bac04caf3 100644 --- a/source4/torture/ldap/uptodatevector.c +++ b/source4/torture/ldap/uptodatevector.c @@ -47,7 +47,7 @@ static bool test_check_uptodatevector(struct torture_context *torture, struct ldb_result *r; const struct ldb_val *utdv_val1; struct replUpToDateVectorBlob utdv1; - const char *attrs[] = { + static const char *attrs[] = { "uSNChanged", "replUpToDateVector", "description", diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index f0e09c75da..d96ed3e931 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -1008,7 +1008,7 @@ static bool test_wrepl_sgroup_merged(struct torture_context *tctx, static bool test_conflict_same_owner(struct torture_context *tctx, struct test_wrepl_conflict_conn *ctx) { - bool ret = true; + static bool ret = true; struct nbt_name name; struct wrepl_wins_name wins_name1; struct wrepl_wins_name wins_name2; diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 3c8976d8d0..371ddc7297 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -517,13 +517,13 @@ int main(int argc,char *argv[]) const struct torture_ui_ops *ui_ops; char **argv_new; poptContext pc; - const char *target = "other"; + static const char *target = "other"; NTSTATUS status; int shell = false; - const char *ui_ops_name = "simple"; + static const char *ui_ops_name = "simple"; const char *basedir = NULL; const char *extra_module = NULL; - int list_tests = 0; + static int list_tests = 0; enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST, OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS}; diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index b85ddec7d0..3144fe91b1 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -1048,7 +1048,7 @@ enum { int main(int argc, const char **argv) { - const char *helper_protocol; + static const char *helper_protocol; int opt; poptContext pc; diff --git a/source4/utils/testparm.c b/source4/utils/testparm.c index 718daae908..a4ff522186 100644 --- a/source4/utils/testparm.c +++ b/source4/utils/testparm.c @@ -172,18 +172,18 @@ static int do_share_checks(struct loadparm_context *lp_ctx, const char *cname, c int main(int argc, const char *argv[]) { - bool silent_mode = false; + static bool silent_mode = false; int ret = 0; poptContext pc; /* - int show_all_parameters = 0; - char *new_local_machine = NULL; + static int show_all_parameters = 0; + static char *new_local_machine = NULL; */ - const char *section_name = NULL; - char *parameter_name = NULL; - const char *cname = NULL; - const char *caddr = NULL; - bool show_defaults = false; + static const char *section_name = NULL; + static char *parameter_name = NULL; + static const char *cname; + static const char *caddr; + static bool show_defaults = false; struct loadparm_context *lp_ctx; struct poptOption long_options[] = { |