r26540: Revert my previous commit after concerns raised by Andrew.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 19 Dec 2007 23:02:15 +0000 (00:02 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:52:06 +0000 (05:52 +0100)
(This used to be commit 6ac86f8be7d9a8c5ab396a93e6d1e6819e11f173)

37 files changed:
source4/auth/auth.c
source4/auth/gensec/cyrus_sasl.c
source4/auth/gensec/schannel_sign.c
source4/client/cifsdd.c
source4/cluster/ctdb/brlock_ctdb.c
source4/cluster/ctdb/tools/ctdb.c
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/samdb/ldb_modules/kludge_acl.c
source4/dsdb/samdb/ldb_modules/local_password.c
source4/dsdb/samdb/ldb_modules/naming_fsmo.c
source4/dsdb/samdb/ldb_modules/objectclass.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/pdc_fsmo.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/schema.c
source4/dsdb/samdb/ldb_modules/schema_fsmo.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/schema/schema_init.c
source4/heimdal/kdc/digest.c
source4/lib/ldb/common/ldb.c
source4/lib/ldb/ldb_map/ldb_map.c
source4/lib/ldb/modules/paged_searches.c
source4/lib/replace/inet_ntop.c
source4/lib/replace/inet_pton.c
source4/lib/replace/timegm.c
source4/libcli/ldap/ldap_bind.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_unbecome_dc.c
source4/rpc_server/drsuapi/dcesrv_drsuapi.c
source4/rpc_server/samr/dcesrv_samr.c
source4/scripting/ejs/ejsnet/net_user.c
source4/torture/ldap/uptodatevector.c
source4/torture/nbt/winsreplication.c
source4/torture/smbtorture.c
source4/utils/ntlm_auth.c
source4/utils/testparm.c

index 708e2f8d735ee80eb8a7a2c852f746b4f80dd2dd..918890b3f621d3e372f3fdb8e85ebeea8f1a649f 100644 (file)
@@ -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),
index 331499a4666a98ff2bd47c29d4457e0e3a1f5f20..64a0b2f0c777df84d0f791155faeff367f341f23 100644 (file)
@@ -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,
index 71ac0cc933506ed05698ba08bc6285d9121cc7b1..1e57beba08974882bf5acdd9407129bef13aec80 100644 (file)
@@ -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);
index c692aa1bc3c58cfdf2005abd196efee7703138e3..08c152c3a5cf01ae591a05ee289de31184be2348 100644 (file)
@@ -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];
index 1b22c6c72701b22ddba37b57b4ef99c76bc2a55a..c38d666c3c60f7e1cf039a506faf6ba0b724b38f 100644 (file)
@@ -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(), 
index 7d25c068bc05273260a599648a0a8a7faf05626c..2308261d00535eb0079063ed30bf2a1ac7ee5587 100644 (file)
@@ -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[] = {
index 70224152eb01b7754901eba75ae29e9ff7e73b9f..8c0d8e589773696574ef2313049b0e81830e05ae 100644 (file)
@@ -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",
index 9a05c866c563308a8bbde04184fd39ef2ce6608f..97130495a3adde2df3d54a8427cc366c0080a530 100644 (file)
@@ -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;
index bbbbbd71c87a7f5908579fabc3aff431588a042e..350434df51733a768e8eebaec41a3eb95f18baa1 100644 (file)
@@ -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);
 
index 41d35dffc1a6302bc60c931ec73da43b39fdd20c..d6b6a242875681cf54f0fe26045c9c7352daf625 100644 (file)
@@ -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
        };
index 44a940f97b91dd8f701d699efa8224633f8d083c..da5cae1c658461468395d7fc751a86e4b8e39f90 100644 (file)
@@ -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;
index 03c2bbc7ae53b6dc317062a751efe04eab7e1aef..d139cc23a432c1a6b95cf2950f8f3feefe67ece1 100644 (file)
@@ -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",
index d27b0c12f79b0770f9220f0ba4ad7402fbe41e79..0f3293ed1db7a58309e2a436d27466e9b00562a4 100644 (file)
@@ -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
        };
index 345b8b84407b22b424a52b271a21892ce978a031..affc01d41324086b018f02c5bf33aaf842f3300e 100644 (file)
@@ -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);
index b37ac49b28259ada2f91d26b18e78a37e8a3d6be..497ee373dea418fbfed69b0e00831209ea5b2253 100644 (file)
@@ -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
index 5c7b72c12c0985e22127ec24bf57acc701fb79f8..525193ac8c05e45d9ccd50efdc7903b7d296112d 100644 (file)
@@ -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;
index ade576ac99613944fe3ffd22c69eb295ad7821af..559c91bd2d863b5049d49851860da58a9ea58738 100644 (file)
@@ -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",
index a5a3ba6aef217df612a37d7b56c0bd6d239e2881..7efcccc9ffcac8af41a418ee33034705e47cbf42 100644 (file)
@@ -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);
index 3d17d2746e6224eed3338ca385f5b7af8bfa264f..f15b03c9b47a76a801958a460782456f8d3c49b9 100644 (file)
@@ -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
index a87371de25da3d7ca8147fd7aad17af63fef4a66..358ca5ad56d7162b2a083c38e127057b90035f87 100644 (file)
@@ -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);
            }
            
index ab4abe67014de9673b67a3f0f9c64e9369f46161..87f791cb38795879f9283a03502083476b33e79f 100644 (file)
@@ -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",
index 87f5f25392b9194948688bc4fbcccddac299bb75..39df427c2c2d3105fcdef8f09fde39c20b6503c4 100644 (file)
@@ -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;
index 69ce21936201975710d7c37f82bfb3074cb9ca7f..749858b49b3221ce8e48b647e3177588a284cd9b 100644 (file)
@@ -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;
index 1b84cda6f0ba400e331d6f8d319372eae618090b..fb3d8e90c8afb977721f63bf658b7a697b32a7d8 100644 (file)
@@ -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;
 
index ea0fe6b78c62e40a26dc8cc196a88abf10da0141..80e4865ef494cdfaf6bdf81e822c23b56a1fe4e1 100644 (file)
@@ -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;
index 86f360bd3c53a7fa7c0a27944a3b17b9609872c3..395c684e11700431ed7a2eafec5a2dd307fb28c3 100644 (file)
@@ -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;
index 264a6b39eeb96c89e7a3ceb5b69fa0fb0249c5b0..fd15ff2fc74a308734a088f6ff8aada5dd95c266 100644 (file)
@@ -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 
        };
index 576c86f3e65c817138a1a4ec89b0860c0c509b76..4d09422becb661bd67d04e17546b0faa95178947 100644 (file)
@@ -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
        };
index 1ab5645a98853d4ffcdd18d175dff4cf250d40b9..415912e34dcd2573b832d43d31fbc0f8bfcd1ce3 100644 (file)
@@ -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
        };
index 9142495a8aa5a0ffde543994ef6b5e2a119f39a3..a97b93a051a3bae29fb6931968f6843ca9091cf6 100644 (file)
@@ -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;
index a0bd34b1548437fa7ce2f9b63cec164d59201bb0..03f360125766a3efdee58910a6a43b35188f2b43 100644 (file)
@@ -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",
index 4b0923216bd4455dc7843b0aaed7f29dbdfee511..34524cc0faba39a6670043892858a32b803cae85 100644 (file)
@@ -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;
index 1f3018fc5e4d16c4429ccd7ba89b9cbe25ad2966..7bac04caf35b8540d315567f16006fa9d9529e8a 100644 (file)
@@ -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",
index f0e09c75da5e51ef97c4aea9a2d2807b48988793..d96ed3e931e48a9ad39229b244d80ad095ae8fd3 100644 (file)
@@ -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;
index 3c8976d8d0c2048d5bbc0fdf42f17462b6a5a16e..371ddc729771d9e884de7a8666c0bf6cb0cb98b7 100644 (file)
@@ -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};
        
index b85ddec7d0ee5a5699c3b3cc288a1541180ec250..3144fe91b1033e4b83b0dc0a87e230553c0e83e9 100644 (file)
@@ -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;
index 718daae908aab8aac78730bbea4666510116147e..a4ff5221866ec50e3a6b68e47d6a1dd0a782a0d1 100644 (file)
@@ -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[] = {