Fix a bunch of "unused variable" warnings.
authorJeremy Allison <jra@samba.org>
Fri, 17 Feb 2012 22:12:40 +0000 (14:12 -0800)
committerJeremy Allison <jra@samba.org>
Sat, 18 Feb 2012 05:22:40 +0000 (06:22 +0100)
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104

19 files changed:
source3/lib/charcnv.c
source3/librpc/crypto/gse.c
source3/libsmb/clisymlink.c
source3/printing/print_iprint.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/smb2_close.c
source3/smbd/smb2_create.c
source3/smbd/smb2_find.c
source3/smbd/smb2_getinfo.c
source3/smbd/smb2_ioctl.c
source3/smbd/smb2_notify.c
source3/smbd/smb2_read.c
source3/smbd/smb2_server.c
source3/smbd/smb2_write.c
source3/smbd/trans2.c
source3/winbindd/wb_group_members.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_rpc.c

index ecf62e551a97d31eea25e1cc5f3d8190c614a76c..5863d72f38059fb611db20de83b06e84be1611df 100644 (file)
@@ -297,80 +297,6 @@ static size_t push_ucs2(const void *base_ptr, void *dest, const char *src, size_
        return len;
 }
 
-
-
-/**
- Copy a string from a ucs2 source to a unix char* destination.
- Flags can have:
-  STR_TERMINATE means the string in src is null terminated.
-  STR_NOALIGN   means don't try to align.
- if STR_TERMINATE is set then src_len is ignored if it is -1.
- src_len is the length of the source area in bytes
- Return the number of bytes occupied by the string in src.
- The resulting string in "dest" is always null terminated.
-**/
-
-static size_t pull_ucs2(const void *base_ptr, char *dest, const void *src, size_t dest_len, size_t src_len, int flags)
-{
-       size_t size = 0;
-       size_t ucs2_align_len = 0;
-       bool ret;
-
-       if (dest_len == (size_t)-1) {
-               /* No longer allow dest_len of -1. */
-               smb_panic("pull_ucs2 - invalid dest_len of -1");
-       }
-
-       if (!src_len) {
-               if (dest && dest_len > 0) {
-                       dest[0] = '\0';
-               }
-               return 0;
-       }
-
-       if (ucs2_align(base_ptr, src, flags)) {
-               src = (const void *)((const char *)src + 1);
-               if (src_len != (size_t)-1)
-                       src_len--;
-               ucs2_align_len = 1;
-       }
-
-       if (flags & STR_TERMINATE) {
-               /* src_len -1 is the default for null terminated strings. */
-               if (src_len != (size_t)-1) {
-                       size_t len = strnlen_w((const smb_ucs2_t *)src,
-                                               src_len/2);
-                       if (len < src_len/2)
-                               len++;
-                       src_len = len*2;
-               }
-       }
-
-       /* ucs2 is always a multiple of 2 bytes */
-       if (src_len != (size_t)-1)
-               src_len &= ~1;
-
-       ret = convert_string(CH_UTF16LE, CH_UNIX, src, src_len, dest, dest_len, &size);
-       if (ret == false) {
-               size = 0;
-               dest_len = 0;
-       }
-
-       if (src_len == (size_t)-1)
-               src_len = size*2;
-
-       if (dest_len && size) {
-               /* Did we already process the terminating zero ? */
-               if (dest[MIN(size-1, dest_len-1)] != 0) {
-                       dest[MIN(size, dest_len-1)] = 0;
-               }
-       } else {
-               dest[0] = 0;
-       }
-
-       return src_len + ucs2_align_len;
-}
-
 /**
  Copy a string from a ucs2 source to a unix char* destination.
  Talloc version with a base pointer.
index 1ce3761ae79475f6f15a7216820ab30a55c64065..9c18443206b0f24e94d6028c97dc77796cb91589 100644 (file)
@@ -78,7 +78,7 @@ static bool gss_oid_equal(const gss_OID o1, const gss_OID o2)
 static int gse_context_destructor(void *ptr)
 {
        struct gse_context *gse_ctx;
-       OM_uint32 gss_min, gss_maj;
+       OM_uint32 gss_min;
 
        gse_ctx = talloc_get_type_abort(ptr, struct gse_context);
        if (gse_ctx->k5ctx) {
@@ -94,24 +94,24 @@ static int gse_context_destructor(void *ptr)
                gse_ctx->k5ctx = NULL;
        }
        if (gse_ctx->gssapi_context != GSS_C_NO_CONTEXT) {
-               gss_maj = gss_delete_sec_context(&gss_min,
+               (void)gss_delete_sec_context(&gss_min,
                                                 &gse_ctx->gssapi_context,
                                                 GSS_C_NO_BUFFER);
        }
        if (gse_ctx->server_name) {
-               gss_maj = gss_release_name(&gss_min,
+               (void)gss_release_name(&gss_min,
                                           &gse_ctx->server_name);
        }
        if (gse_ctx->client_name) {
-               gss_maj = gss_release_name(&gss_min,
+               (void)gss_release_name(&gss_min,
                                           &gse_ctx->client_name);
        }
        if (gse_ctx->creds) {
-               gss_maj = gss_release_cred(&gss_min,
+               (void)gss_release_cred(&gss_min,
                                           &gse_ctx->creds);
        }
        if (gse_ctx->delegated_cred_handle) {
-               gss_maj = gss_release_cred(&gss_min,
+               (void)gss_release_cred(&gss_min,
                                           &gse_ctx->delegated_cred_handle);
        }
 
index fad9826880ff67db919841c9afc8dd5079e909a2..9e21d1b88372ad0080c6de29b142121dbe0aeb78 100644 (file)
@@ -156,15 +156,14 @@ static void cli_symlink_delete_on_close_done(struct tevent_req *subreq)
                subreq, struct tevent_req);
        struct cli_symlink_state *state = tevent_req_data(
                req, struct cli_symlink_state);
-       NTSTATUS status;
-
-       status = cli_nt_delete_on_close_recv(subreq);
-       TALLOC_FREE(subreq);
 
        /*
         * Ignore status, we can't do much anyway in case of failure
         */
 
+       (void)cli_nt_delete_on_close_recv(subreq);
+       TALLOC_FREE(subreq);
+
        subreq = cli_close_send(state, state->ev, state->cli, state->fnum);
        if (tevent_req_nomem(subreq, req)) {
                return;
index 1392cba7b8f0c5c5ec94ec9089c4ead4c6cc5010..1ff705a383c0e243a8ebed990166ea6b9d0d9491 100644 (file)
@@ -866,7 +866,6 @@ static int iprint_queue_get(const char *sharename,
        int             job_id;         /* job-id attribute */
        int             job_k_octets;   /* job-k-octets attribute */
        time_t          job_time;       /* time-at-creation attribute */
-       time_t          printer_current_time = 0;       /* printer's current time */
        time_t          printer_up_time = 0;    /* printer's uptime */
        ipp_jstate_t    job_status;     /* job-status attribute */
        int             job_priority;   /* job-priority attribute */
@@ -993,10 +992,6 @@ static int iprint_queue_get(const char *sharename,
                                     IPP_TAG_TEXT)) != NULL)
                fstrcpy(status->message, attr->values[0].string.text);
 
-       if ((attr = ippFindAttribute(response, "printer-current-time",
-                                    IPP_TAG_DATE)) != NULL)
-               printer_current_time = ippDateToTime(attr->values[0].date);
-
        if ((attr = ippFindAttribute(response, "printer-up-time",
                                     IPP_TAG_INTEGER)) != NULL)
                printer_up_time = attr->values[0].integer;
index 1d743552891a7b7b5799e3192ea3d135a34f6ccf..139f1f0d2222a3d9bce5df7c090067f5a7e9ca6d 100644 (file)
@@ -2646,7 +2646,6 @@ static bool smbd_echo_reply(struct smbd_echo_state *state,
 {
        struct smb_request req;
        uint16_t num_replies;
-       size_t out_len;
        char *outbuf;
        bool ok;
 
@@ -2703,8 +2702,6 @@ static bool smbd_echo_reply(struct smbd_echo_state *state,
                memcpy(smb_buf(req.outbuf), req.buf, req.buflen);
        }
 
-       out_len = smb_len(req.outbuf) + 4;
-
        ok = srv_send_smb(req.sconn,
                          (char *)outbuf,
                          true, seqnum+1,
index 557a32f0541dd42e1ce04ba32f3a3c63ab961a7f..b026d34c671559e328463bde6391471a77321ce2 100644 (file)
@@ -3525,10 +3525,8 @@ static int setup_readX_header(struct smb_request *req, char *outbuf,
                              size_t smb_maxcnt)
 {
        int outsize;
-       char *data;
 
        outsize = srv_set_message(outbuf,12,smb_maxcnt,False);
-       data = smb_buf(outbuf);
 
        memset(outbuf+smb_vwv0,'\0',24); /* valgrind init. */
 
index ffe08cc8ac31a1a52ae8d23c2ac59cfeec66b9e7..2cc8266fe171d87f85cf2490acbe7fd03825488f 100644 (file)
@@ -32,7 +32,6 @@ NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
 {
        const uint8_t *inbody;
        int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        uint16_t in_flags;
        uint64_t in_file_id_persistent;
@@ -68,7 +67,6 @@ NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
                return smbd_smb2_request_error(req, status);
        }
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
        return smbd_smb2_request_done(req, outbody, NULL);
 }
 
index c637adbb619139d5571474658cc3edbf2d99930c..3e5b81d5c8d8891799d00c623cf3d63711d22212 100644 (file)
@@ -264,8 +264,6 @@ static void smbd_smb2_request_create_done(struct tevent_req *tsubreq)
 {
        struct smbd_smb2_request *smb2req = tevent_req_callback_data(tsubreq,
                                        struct smbd_smb2_request);
-       int i = smb2req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint8_t out_oplock_level = 0;
@@ -337,8 +335,6 @@ static void smbd_smb2_request_create_done(struct tevent_req *tsubreq)
                out_context_buffer_offset = SMB2_HDR_BODY + 0x58;
        }
 
-       outhdr = (uint8_t *)smb2req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(smb2req->out.vector, NULL, 0x58);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(smb2req, NT_STATUS_NO_MEMORY);
index 671b5f5a75ce2d15f7f1aff311c2df37523401fa..7c19d7538a87fa9e1755b3d6ce639b1668c4b659 100644 (file)
@@ -142,8 +142,6 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq)
 {
        struct smbd_smb2_request *req = tevent_req_callback_data(subreq,
                                        struct smbd_smb2_request);
-       int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint16_t out_output_buffer_offset;
@@ -167,8 +165,6 @@ static void smbd_smb2_request_find_done(struct tevent_req *subreq)
 
        out_output_buffer_offset = SMB2_HDR_BODY + 0x08;
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x08);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 340130e2a5b9a996ed920794f52cb02bd88b8b77..7d0f9468982b533526fefad59be154487b34c14a 100644 (file)
@@ -125,8 +125,6 @@ static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq)
 {
        struct smbd_smb2_request *req = tevent_req_callback_data(subreq,
                                        struct smbd_smb2_request);
-       int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint16_t out_output_buffer_offset;
@@ -166,8 +164,6 @@ static void smbd_smb2_request_getinfo_done(struct tevent_req *subreq)
 
        out_output_buffer_offset = SMB2_HDR_BODY + 0x08;
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x08);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 56d9a3267f6dc541db696430cfc3f6cac01e1732..d537a8798cf04ceb46028a8a94656774d88d3002 100644 (file)
@@ -119,7 +119,6 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq)
                                        struct smbd_smb2_request);
        const uint8_t *inbody;
        int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint32_t in_ctl_code;
@@ -160,8 +159,6 @@ static void smbd_smb2_request_ioctl_done(struct tevent_req *subreq)
        in_file_id_persistent   = BVAL(inbody, 0x08);
        in_file_id_volatile     = BVAL(inbody, 0x10);
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x30);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 0ea0b096364be9df9b252a05cdca9a105238d942..49051bfe62a440c6ca1a3964c336abfbe8340145 100644 (file)
@@ -103,7 +103,6 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq)
        struct smbd_smb2_request *req = tevent_req_callback_data(subreq,
                                        struct smbd_smb2_request);
        int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint16_t out_output_buffer_offset;
@@ -145,8 +144,6 @@ static void smbd_smb2_request_notify_done(struct tevent_req *subreq)
 
        out_output_buffer_offset = SMB2_HDR_BODY + 0x08;
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x08);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index 358d3074275b79d9f7b8491afc21b69a860edffe..13bcbdfd19b8b03d15b6d6af09498889d1c72db6 100644 (file)
@@ -107,8 +107,6 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq)
 {
        struct smbd_smb2_request *req = tevent_req_callback_data(subreq,
                                        struct smbd_smb2_request);
-       int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint8_t out_data_offset;
@@ -134,8 +132,6 @@ static void smbd_smb2_request_read_done(struct tevent_req *subreq)
 
        out_data_offset = SMB2_HDR_BODY + 0x10;
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x10);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index a51e26ddb9bc294518ee34c96a022d91280c0fc9..899de07c2350673b4663a5aeeb11fc30f022f1b2 100644 (file)
@@ -554,7 +554,6 @@ static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req)
 
        for (idx=1; idx < count; idx += 3) {
                const uint8_t *inhdr = NULL;
-               uint32_t in_flags;
                uint8_t *outhdr = NULL;
                uint8_t *outbody = NULL;
                uint32_t next_command_ofs = 0;
@@ -567,7 +566,6 @@ static NTSTATUS smbd_smb2_request_setup_out(struct smbd_smb2_request *req)
                }
 
                inhdr = (const uint8_t *)req->in.vector[idx].iov_base;
-               in_flags = IVAL(inhdr, SMB2_HDR_FLAGS);
 
                outhdr = talloc_zero_array(vector, uint8_t,
                                      OUTVEC_ALLOC_SIZE);
index 23e344f6a0eb4535384d2522f3ca51191335e102..49a77e63a90434da1990fe23a754a0c62fce75de 100644 (file)
@@ -114,8 +114,6 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq)
 {
        struct smbd_smb2_request *req = tevent_req_callback_data(subreq,
                                        struct smbd_smb2_request);
-       int i = req->current_idx;
-       uint8_t *outhdr;
        DATA_BLOB outbody;
        DATA_BLOB outdyn;
        uint32_t out_count = 0;
@@ -134,8 +132,6 @@ static void smbd_smb2_request_write_done(struct tevent_req *subreq)
                return;
        }
 
-       outhdr = (uint8_t *)req->out.vector[i].iov_base;
-
        outbody = data_blob_talloc(req->out.vector, NULL, 0x10);
        if (outbody.data == NULL) {
                error = smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);
index cee6c35189002d4a7a1136df59238130b3bb7f9f..336e76e481afb687cafdf3bdd5ee2323d0ba0044 100644 (file)
@@ -1539,7 +1539,6 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
        uint32_t len;
        struct timespec mdate_ts, adate_ts, cdate_ts, create_date_ts;
        time_t mdate = (time_t)0, adate = (time_t)0, create_date = (time_t)0;
-       time_t c_date = (time_t)0;
        char *nameptr;
        char *last_entry_ptr;
        bool was_8_3;
@@ -1575,7 +1574,6 @@ static bool smbd_marshall_dir_entry(TALLOC_CTX *ctx,
        create_date = convert_timespec_to_time_t(create_date_ts);
        mdate = convert_timespec_to_time_t(mdate_ts);
        adate = convert_timespec_to_time_t(adate_ts);
-       c_date = convert_timespec_to_time_t(cdate_ts);
 
        /* align the record */
        SMB_ASSERT(align >= 1);
index 8776a8c7dda9d82b5be234da90d1b21bb70368f1..e4b4c0ac33930afee46faa5979a684b63623b49f 100644 (file)
@@ -355,7 +355,7 @@ static void wb_group_members_done(struct tevent_req *subreq)
                subreq, struct tevent_req);
        struct wb_group_members_state *state = tevent_req_data(
                req, struct wb_group_members_state);
-       int i, num_groups, new_users, new_groups;
+       int i, num_groups, new_groups;
        int num_members = 0;
        struct wbint_Principal *members = NULL;
        NTSTATUS status;
@@ -366,7 +366,7 @@ static void wb_group_members_done(struct tevent_req *subreq)
                return;
        }
 
-       new_users = new_groups = 0;
+       new_groups = 0;
        for (i=0; i<num_members; i++) {
                switch (members[i].type) {
                case SID_NAME_DOM_GRP:
index ffe3f389685d7188d86735d2ce570d35b99ff7ed..315202d618163b99499b41782c3a60bd2f9719a5 100644 (file)
@@ -1293,7 +1293,6 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
        struct winbind_cache *cache = get_cache(domain);
        struct cache_entry *centry = NULL;
        NTSTATUS status;
-       time_t t;
        uint32 rid;
        fstring tmp;
 
@@ -1324,8 +1323,6 @@ NTSTATUS wcache_get_creds(struct winbindd_domain *domain,
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
-       t = centry_time(centry);
-
        /* In the salted case this isn't actually the nt_hash itself,
           but the MD5 of the salt + nt_hash. Let the caller
           sort this out. It can tell as we only return the cached_salt
index e91148732422a89e21381c035f40b5364a9909f5..8a11cb24207222907eb0f6512e809e2e554eb2ea 100644 (file)
@@ -972,7 +972,6 @@ NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx,
 
        do {
                struct lsa_DomainList dom_list;
-               uint32_t start_idx;
                uint32_t i;
 
                /*
@@ -995,7 +994,6 @@ NTSTATUS rpc_trusted_domains(TALLOC_CTX *mem_ctx,
                        }
                }
 
-               start_idx = count;
                count += dom_list.count;
 
                array = talloc_realloc(mem_ctx,