Fix the O3 developer build
authorVolker Lendecke <vl@samba.org>
Tue, 3 Mar 2015 07:48:00 +0000 (08:48 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 3 Mar 2015 12:14:53 +0000 (13:14 +0100)
Different gcc versions complain at different places

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Mar  3 13:14:53 CET 2015 on sn-devel-104

15 files changed:
auth/credentials/credentials_secrets.c
lib/ldb/ldb_map/ldb_map_outbound.c
source3/lib/ctdbd_conn.c
source3/lib/netapi/file.c
source3/lib/netapi/share.c
source3/passdb/pdb_ipa.c
source3/utils/net_registry.c
source4/dsdb/kcc/kcc_topology.c
source4/heimdal/lib/krb5/fcache.c
source4/lib/http/http_auth.c
source4/libnet/userman.c
source4/rpc_server/samr/dcesrv_samr.c
source4/torture/rpc/samsync.c
source4/torture/rpc/spoolss.c
source4/torture/winbind/struct_based.c

index d259a4daef08dde3b2d01c0d53afc9c0efe9a737..5945ffdb4a1a292a852dcb545037236a4604ce91 100644 (file)
@@ -411,7 +411,7 @@ _PUBLIC_ NTSTATUS cli_credentials_set_stored_principal(struct cli_credentials *c
 {
        NTSTATUS status;
        char *filter;
-       char *error_string;
+       char *error_string = NULL;
        /* Bleh, nasty recursion issues: We are setting a machine
         * account here, so we don't want the 'pending' flag around
         * any more */
@@ -424,7 +424,9 @@ _PUBLIC_ NTSTATUS cli_credentials_set_stored_principal(struct cli_credentials *c
                                             SECRETS_PRINCIPALS_DN, filter,
                                             0, NULL, &error_string);
        if (!NT_STATUS_IS_OK(status)) {
-               DEBUG(1, ("Could not find %s principal in secrets database: %s: %s\n", serviceprincipal, nt_errstr(status), error_string));
+               DEBUG(1, ("Could not find %s principal in secrets database: %s: %s\n",
+                         serviceprincipal, nt_errstr(status),
+                         error_string ? error_string : "<no error>"));
        }
        return status;
 }
index 1ee2dfe12de912f6fd64ceefad0429b65b23ac99..e755b7e4427ef34b65f14afc4c3db224f78f6c0a 100644 (file)
@@ -635,7 +635,7 @@ static int map_subtree_select_local_list(struct ldb_module *module, void *mem_ct
        /* Generate new list of subtrees */
        j = 0;
        for (i = 0; i < tree->u.list.num_elements; i++) {
-               struct ldb_parse_tree *child;
+               struct ldb_parse_tree *child = NULL;
                ret = map_subtree_select_local(module, *new, &child, tree->u.list.elements[i]);
                if (ret) {
                        talloc_free(*new);
index c41ec530a7b336727e17d8f76e37430ea16dc81b..6e2576998a447d5000d582995ae43bb66f765846 100644 (file)
@@ -722,7 +722,7 @@ static void ctdbd_socket_handler(struct tevent_context *event_ctx,
 {
        struct ctdbd_connection *conn = talloc_get_type_abort(
                private_data, struct ctdbd_connection);
-       struct ctdb_req_header *hdr;
+       struct ctdb_req_header *hdr = NULL;
        NTSTATUS status;
 
        status = ctdb_read_packet(conn->fd, talloc_tos(), &hdr);
@@ -1304,7 +1304,7 @@ char *ctdbd_dbpath(struct ctdbd_connection *conn,
 {
        NTSTATUS status;
        TDB_DATA data;
-       int32_t cstatus;
+       int32_t cstatus = 0;
 
        data.dptr = (uint8_t*)&db_id;
        data.dsize = sizeof(db_id);
@@ -1557,7 +1557,7 @@ NTSTATUS ctdbd_traverse(uint32_t db_id,
        }
 
        while (True) {
-               struct ctdb_req_header *hdr;
+               struct ctdb_req_header *hdr = NULL;
                struct ctdb_req_message *m;
                struct ctdb_rec_data *d;
 
index 551f9ff4f0e090869afad8a181992ed2747b0541..99541b9757806a0e8a2e34c525fd331d652ca0c0 100644 (file)
@@ -240,7 +240,7 @@ WERROR NetFileEnum_r(struct libnetapi_ctx *ctx,
        }
 
        for (i=0; i < info_ctr.ctr.ctr2->count; i++) {
-               union srvsvc_NetFileInfo _i;
+               union srvsvc_NetFileInfo _i = {0};
                switch (r->in.level) {
                        case 2:
                                _i.info2 = &info_ctr.ctr.ctr2->array[i];
index 37b23221be3d6c29652627a50d3e48cc3c72cd6f..1694a279c0f2a59bff0760c37e73584a28a543af 100644 (file)
@@ -386,7 +386,7 @@ WERROR NetShareEnum_r(struct libnetapi_ctx *ctx,
        }
 
        for (i=0; i < info_ctr.ctr.ctr1->count; i++) {
-               union srvsvc_NetShareInfo _i;
+               union srvsvc_NetShareInfo _i = {0};
                switch (r->in.level) {
                        case 0:
                                _i.info0 = &info_ctr.ctr.ctr0->array[i];
index 9a1cc1836cbf6d257061529311c173950c31049a..e1e55276175cbb3c2b71fd87d31eebd290f1d197 100644 (file)
@@ -1303,7 +1303,7 @@ static NTSTATUS ipasam_create_dom_group(struct pdb_methods *pdb_methods,
 {
        NTSTATUS status;
        struct ldapsam_privates *ldap_state;
-       char *dn;
+       char *dn = NULL;
        uint32_t has_objectclass = 0;
 
        ldap_state = (struct ldapsam_privates *)(pdb_methods->private_data);
index befc73c4e4024148c07f8057522c70e8ef1e7c41..cdfb31815495b52ee4255e302cd620495963cc71 100644 (file)
@@ -274,7 +274,7 @@ static int net_registry_createkey(struct net_context *c, int argc,
 {
        WERROR werr;
        enum winreg_CreateAction action;
-       char *subkeyname;
+       char *subkeyname = NULL;
        struct registry_key *hivekey = NULL;
        struct registry_key *subkey = NULL;
        TALLOC_CTX *ctx = talloc_stackframe();
@@ -333,7 +333,7 @@ static int net_registry_deletekey_internal(struct net_context *c, int argc,
                                           bool recursive)
 {
        WERROR werr;
-       char *subkeyname;
+       char *subkeyname = NULL;
        struct registry_key *hivekey = NULL;
        TALLOC_CTX *ctx = talloc_stackframe();
        int ret = -1;
index 2836199a69eb089d20b8ea82b6d3ddeb44b74559..82ef665601c9b3a3f52c8dd737b8befdc195efbf 100644 (file)
@@ -2790,7 +2790,7 @@ static NTSTATUS kcctpl_create_connection(struct kccsrv_service *service,
                                       "transportType", "schedule", "options",
                                       "enabledConnection", NULL };
        unsigned int i, valid_connections;
-       struct GUID_list keep_connections;
+       struct GUID_list keep_connections = {0};
 
        tmp_ctx = talloc_new(service);
        NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
@@ -3299,7 +3299,8 @@ static NTSTATUS kcctpl_create_connections(struct kccsrv_service *service,
                struct GUID other_site_id;
                struct kcctpl_vertex *other_site_vertex;
                struct ldb_result *res;
-               struct ldb_message *transport, *r_bridgehead, *l_bridgehead;
+               struct ldb_message *transport, *r_bridgehead;
+               struct ldb_message *l_bridgehead = NULL;
                uint8_t schedule[84];
                uint32_t first_available, j, interval;
 
@@ -3532,8 +3533,8 @@ NTSTATUS kcctpl_test(struct kccsrv_service *service)
 {
        NTSTATUS status;
        TALLOC_CTX *tmp_ctx = talloc_new(service);
-       struct GUID_list keep;
-       bool all_connected;
+       struct GUID_list keep = {0};
+       bool all_connected = false;
 
        DEBUG(5, ("Testing kcctpl_create_intersite_connections\n"));
        status = kcctpl_create_intersite_connections(service, tmp_ctx, &keep,
index 781d4f004078e0fb054f0d5ad93c0a7b621f8bdf..a9e8327328cf1ce08fbcb661ad8179cef8ad2e7a 100644 (file)
@@ -420,7 +420,7 @@ fcc_initialize(krb5_context context,
 {
     krb5_fcache *f = FCACHE(id);
     int ret = 0;
-    int fd;
+    int fd = 0;
 
     if (f == NULL)
         return krb5_einval(context, 2);
@@ -500,7 +500,7 @@ fcc_store_cred(krb5_context context,
               krb5_creds *creds)
 {
     int ret;
-    int fd;
+    int fd = 0;
 
     ret = fcc_open(context, id, &fd, O_WRONLY | O_APPEND | O_BINARY | O_CLOEXEC, 0);
     if(ret)
@@ -541,7 +541,7 @@ init_fcc (krb5_context context,
          int *ret_fd,
          krb5_deltat *kdc_offset)
 {
-    int fd;
+    int fd = 0;
     int8_t pvno, tag;
     krb5_storage *sp;
     krb5_error_code ret;
@@ -973,7 +973,8 @@ fcc_move(krb5_context context, krb5_ccache from, krb5_ccache to)
     } else if (ret && errno == EXDEV) {
        /* make a copy and delete the orignal */
        krb5_ssize_t sz1, sz2;
-       int fd1, fd2;
+       int fd1;
+       int fd2 = 0;
        char buf[BUFSIZ];
 
        ret = fcc_open(context, from, &fd1, O_RDONLY | O_BINARY | O_CLOEXEC, 0);
@@ -1077,7 +1078,7 @@ fcc_get_kdc_offset(krb5_context context, krb5_ccache id, krb5_deltat *kdc_offset
 {
     krb5_error_code ret;
     krb5_storage *sp = NULL;
-    int fd;
+    int fd = 0;
     ret = init_fcc(context, id, &sp, &fd, kdc_offset);
     if (sp)
        krb5_storage_free(sp);
index 2bf4392e8f2d2fc565b265c1cb2917750eac3f9f..d846ec2a0484e2509c5e9d715f57a3536cddcba2 100644 (file)
@@ -166,7 +166,7 @@ struct tevent_req *http_send_auth_request_send(TALLOC_CTX *mem_ctx,
        struct tevent_req *subreq;
        struct http_auth_state *state;
        NTSTATUS status;
-       struct http_request *auth_request;
+       struct http_request *auth_request = NULL;
        struct http_request *request_to_send;
 
        req = tevent_req_create(mem_ctx, &state, struct http_auth_state);
@@ -301,7 +301,7 @@ static void http_send_auth_request_done2(struct tevent_req *subreq)
        struct tevent_req       *req;
        struct http_auth_state  *state;
        struct http_request *auth_response;
-       struct http_request *auth_request;
+       struct http_request *auth_request = NULL;
        struct http_request *request_to_send;
 
        req = tevent_req_callback_data(subreq, struct tevent_req);
index 39be78f670791ff78b5d0b6bc7c71b09c6d6aa98..9e76364992c80114726237887eb6594e7439d69f 100644 (file)
@@ -756,7 +756,7 @@ static void continue_usermod_user_queried(struct tevent_req *subreq)
        struct composite_context *c;
        struct usermod_state *s;
        union samr_UserInfo *i;
-       uint16_t level;
+       uint16_t level = 0;
        
        c = tevent_req_callback_data(subreq, struct composite_context);
        s = talloc_get_type(c->private_data, struct usermod_state);
index c0bec437c2c9fccb43d8896cd8cdce2fdf42d5b8..bf2174c771be5f8fe9a4900428a018cad788dbd9 100644 (file)
@@ -1239,13 +1239,16 @@ static NTSTATUS dcesrv_samr_CreateUser(struct dcesrv_call_state *dce_call, TALLO
 
 
        /* a simple wrapper around samr_CreateUser2 works nicely */
-       r2.in.domain_handle = r->in.domain_handle;
-       r2.in.account_name = r->in.account_name;
-       r2.in.acct_flags = ACB_NORMAL;
-       r2.in.access_mask = r->in.access_mask;
-       r2.out.user_handle = r->out.user_handle;
-       r2.out.access_granted = &access_granted;
-       r2.out.rid = r->out.rid;
+
+       r2 = (struct samr_CreateUser2) {
+               .in.domain_handle = r->in.domain_handle,
+               .in.account_name = r->in.account_name,
+               .in.acct_flags = ACB_NORMAL,
+               .in.access_mask = r->in.access_mask,
+               .out.user_handle = r->out.user_handle,
+               .out.access_granted = &access_granted,
+               .out.rid = r->out.rid
+       };
 
        return dcesrv_samr_CreateUser2(dce_call, mem_ctx, &r2);
 }
@@ -4007,9 +4010,11 @@ static NTSTATUS dcesrv_samr_QueryUserInfo2(struct dcesrv_call_state *dce_call, T
        struct samr_QueryUserInfo r1;
        NTSTATUS status;
 
-       r1.in.user_handle = r->in.user_handle;
-       r1.in.level  = r->in.level;
-       r1.out.info  = r->out.info;
+       r1 = (struct samr_QueryUserInfo) {
+               .in.user_handle = r->in.user_handle,
+               .in.level  = r->in.level,
+               .out.info  = r->out.info
+       };
 
        status = dcesrv_samr_QueryUserInfo(dce_call, mem_ctx, &r1);
 
index 2c18e0d502eed131fbadf741c9397d636c527c04..e71faf899a557e74848d19da470678f8caa17ca8 100644 (file)
@@ -463,7 +463,7 @@ static bool samsync_handle_user(struct torture_context *tctx, TALLOC_CTX *mem_ct
 {
        uint32_t rid = delta->delta_id_union.rid;
        struct netr_DELTA_USER *user = delta->delta_union.user;
-       struct netr_SamInfo3 *info3;
+       struct netr_SamInfo3 *info3 = NULL;
        struct samr_Password lm_hash;
        struct samr_Password nt_hash;
        struct samr_Password *lm_hash_p = NULL;
index 23f501d7401802021f4f663ef1567a04ccde1cd1..ebe7c0939f06fef931e761677b333175223c08a3 100644 (file)
@@ -4118,9 +4118,12 @@ static bool test_GetPrinterData_list(struct torture_context *tctx,
        int i;
 
        for (i=0; i < ARRAY_SIZE(list); i++) {
-               enum winreg_Type type, type_ex;
-               uint8_t *data, *data_ex;
-               uint32_t needed, needed_ex;
+               enum winreg_Type type = REG_NONE;
+               enum winreg_Type type_ex= REG_NONE;
+               uint8_t *data;
+               uint8_t *data_ex = NULL;
+               uint32_t needed;
+               uint32_t needed_ex = 0;
 
                torture_assert(tctx, test_GetPrinterData(tctx, b, &ctx->server_handle, list[i], &type, &data, &needed),
                        talloc_asprintf(tctx, "GetPrinterData failed on %s\n", list[i]));
@@ -6064,9 +6067,9 @@ static bool test_GetChangeID_PrinterDataEx(struct torture_context *tctx,
                                           struct policy_handle *handle,
                                           uint32_t *change_id)
 {
-       enum winreg_Type type;
-       uint8_t *data;
-       uint32_t needed;
+       enum winreg_Type type = REG_NONE;
+       uint8_t *data = NULL;
+       uint32_t needed = 0;
 
        torture_assert(tctx,
                test_GetPrinterDataEx(tctx, p, handle, "PrinterDriverData", "ChangeID", &type, &data, &needed),
index cc49c5d7c04ae30e12b09209cf185d8d9aeee0be..0096fefcbbd405b3a1f21734292059ab99971f6d 100644 (file)
@@ -896,7 +896,7 @@ static bool parse_domain_user(struct torture_context *torture,
                              fstring user)
 {
        char *p = strchr(domuser, winbind_separator(torture));
-       char *dom;
+       char *dom = NULL;
 
        if (!p) {
                /* Maybe it was a UPN? */