s4:dsdb: Fix warnings about not set / set but unused / shadowed variables
authorMatthieu Patou <mat@matws.net>
Fri, 12 Apr 2013 05:30:27 +0000 (22:30 -0700)
committerStefan Metzmacher <metze@samba.org>
Fri, 19 Apr 2013 11:15:40 +0000 (13:15 +0200)
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Apr 19 13:15:40 CEST 2013 on sn-devel-104

source4/dsdb/common/dsdb_dn.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/partition.c
source4/dsdb/samdb/ldb_modules/resolve_oids.c
source4/dsdb/samdb/ldb_modules/samba_dsdb.c
source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
source4/dsdb/samdb/ldb_modules/subtree_rename.c

index 0029f5d49efaba4bd73ab934b07013aeb2ef9cc3..ab427762261e800dd234ec9468b602445b9be47d 100644 (file)
@@ -76,7 +76,6 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
 {
        struct dsdb_dn *dsdb_dn;
        struct ldb_dn *dn;
-       const char *data;
        size_t len;
        TALLOC_CTX *tmp_ctx;
        char *p1;
@@ -127,8 +126,6 @@ struct dsdb_dn *dsdb_dn_parse(TALLOC_CTX *mem_ctx, struct ldb_context *ldb,
        if (tmp_ctx == NULL) {
                return NULL;
        }
-               
-       data = (const char *)dn_blob->data;
 
        len = dn_blob->length - 2;
        p1 = talloc_strndup(tmp_ctx, (const char *)dn_blob->data + 2, len);
index 6e08209bf32e5b1113cd01a13a2c62804afa83cc..a55ec87f0fd7fc6e21939a9d095883455c3dcd04 100644 (file)
@@ -752,7 +752,7 @@ static int linked_attributes_fix_links(struct ldb_module *module,
                /* find our DN in the values */
                for (j=0; j<el2->num_values; j++) {
                        struct dsdb_dn *dsdb_dn2;
-                       struct GUID link_guid;
+                       struct GUID link_guid2;
 
                        dsdb_dn2 = dsdb_dn_parse(msg, ldb, &el2->values[j], target->syntax->ldap_oid);
                        if (dsdb_dn2 == NULL) {
@@ -760,7 +760,7 @@ static int linked_attributes_fix_links(struct ldb_module *module,
                                return LDB_ERR_INVALID_DN_SYNTAX;
                        }
 
-                       ret = la_guid_from_dn(module, parent, dsdb_dn2->dn, &link_guid);
+                       ret = la_guid_from_dn(module, parent, dsdb_dn2->dn, &link_guid2);
                        if (ret != LDB_SUCCESS) {
                                talloc_free(tmp_ctx);
                                return ret;
@@ -776,7 +776,7 @@ static int linked_attributes_fix_links(struct ldb_module *module,
                         * more costly, but still give us a GUID.
                         * dbcheck will fix this if run.
                         */
-                       if (!GUID_equal(&self_guid, &link_guid)) {
+                       if (!GUID_equal(&self_guid, &link_guid2)) {
                                continue;
                        }
 
index 435a791f1c585182627e9584078078b71c0d4683..63835d8d627fde306dcdbcf2242c653439571258 100644 (file)
@@ -1089,13 +1089,10 @@ int partition_sequence_number_from_partitions(struct ldb_module *module,
  */
 static int partition_sequence_number(struct ldb_module *module, struct ldb_request *req)
 {
-       struct partition_private_data *data = talloc_get_type(ldb_module_get_private(module),
-                                                             struct partition_private_data);
        struct ldb_extended *ext;
        struct ldb_seqnum_request *seq;
        struct ldb_seqnum_result *seqr;
        uint64_t seq_number;
-       struct dsdb_partition *p;
        int ret;
 
        seq = talloc_get_type_abort(req->op.extended.data, struct ldb_seqnum_request);
index 71f9a30635c5c12d8acc5dc30281ac67e1b20bd2..b5c5f8efee7ddb911bb2ac7c66868b92841bec89 100644 (file)
@@ -412,11 +412,9 @@ struct resolve_oids_context {
 
 static int resolve_oids_callback(struct ldb_request *req, struct ldb_reply *ares)
 {
-       struct ldb_context *ldb;
        struct resolve_oids_context *ac;
 
        ac = talloc_get_type_abort(req->context, struct resolve_oids_context);
-       ldb = ldb_module_get_ctx(ac->module);
 
        if (!ares) {
                return ldb_module_done(ac->req, NULL, NULL,
index d10d1bbee26ad1e5cda4f76d497dfedd90c3a53a..ee7f694c734e8f319ee89b93189650b19913e254 100644 (file)
@@ -214,8 +214,8 @@ static int samba_dsdb_init(struct ldb_module *module)
        static const char *openldap_backend_modules[] = {
                "entryuuid", "paged_searches", "simple_dn", NULL };
 
-       static const char *samba_dsdb_attrs[] = { "backendType", "serverRole", NULL };
-       const char *backendType, *serverRole;
+       static const char *samba_dsdb_attrs[] = { "backendType", NULL };
+       const char *backendType;
 
        if (!tmp_ctx) {
                return ldb_oom(ldb);
@@ -245,10 +245,8 @@ static int samba_dsdb_init(struct ldb_module *module)
                                    samba_dsdb_attrs, DSDB_FLAG_NEXT_MODULE, NULL);
        if (ret == LDB_ERR_NO_SUCH_OBJECT) {
                backendType = "ldb";
-               serverRole = "domain controller";
        } else if (ret == LDB_SUCCESS) {
                backendType = ldb_msg_find_attr_as_string(res->msgs[0], "backendType", "ldb");
-               serverRole = ldb_msg_find_attr_as_string(res->msgs[0], "serverRole", "domain controller");
        } else {
                talloc_free(tmp_ctx);
                return ret;
index 91852f03adc3b3cb05a491c42527ccc12ccdb90e..97016b5f62614a0046ad1362c38f398aca0bd772 100644 (file)
@@ -822,7 +822,6 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque
        struct ldb_context *ldb;
        int ret;
        struct map_private *map_private;
-       struct entryuuid_private *entryuuid_private;
        unsigned long long seq_num = 0;
        struct ldb_request *search_req;
 
@@ -843,8 +842,6 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque
 
        map_private = talloc_get_type(ldb_module_get_private(module), struct map_private);
 
-       entryuuid_private = talloc_get_type(map_private->caller_private, struct entryuuid_private);
-
        /* All this to get the DN of the parition, so we can search the right thing */
        partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
        if (!partition_ctrl) {
index 2b13e5533d0c69756466ca4cadec43f8cd30191a..ee787d19e4c639c058bfb6f1b131945dabde2635 100644 (file)
@@ -52,10 +52,8 @@ struct subtree_rename_context {
 static struct subtree_rename_context *subren_ctx_init(struct ldb_module *module,
                                                      struct ldb_request *req)
 {
-       struct ldb_context *ldb;
        struct subtree_rename_context *ac;
 
-       ldb = ldb_module_get_ctx(module);
 
        ac = talloc_zero(req, struct subtree_rename_context);
        if (ac == NULL) {