r3322: fixed a bunch of warnings in the build, including one case where it was a...
authorAndrew Tridgell <tridge@samba.org>
Thu, 28 Oct 2004 12:46:59 +0000 (12:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:04:55 +0000 (13:04 -0500)
(This used to be commit 02d5d0f685e44bd66aff4a007f0bf34c8f915574)

source4/lib/iconv.c
source4/libcli/auth/clikrb5.c
source4/libcli/auth/ntlmssp_parse.c
source4/libcli/auth/spnego.c
source4/libcli/auth/spnego.h
source4/libcli/raw/rawrequest.c
source4/libcli/raw/rawsearch.c
source4/libcli/util/asn1.c
source4/librpc/idl/epmapper.idl
source4/librpc/ndr/ndr.c
source4/librpc/rpc/dcerpc_smb.c

index f4f7660bcd19ad4fbfb96d802a481fd2f78e87f4..3cca734d7bc9026acc579146432b338175ee1c51 100644 (file)
@@ -131,7 +131,6 @@ size_t smb_iconv(smb_iconv_t cd,
                 char **outbuf, size_t *outbytesleft)
 {
        char cvtbuf[2048];
-       char *bufp = cvtbuf;
        size_t bufsize;
 
        /* in many cases we can go direct */
@@ -143,18 +142,19 @@ size_t smb_iconv(smb_iconv_t cd,
 
        /* otherwise we have to do it chunks at a time */
        while (*inbytesleft > 0) {
-               bufp = cvtbuf;
+               char *bufp1 = cvtbuf;
+               const char *bufp2 = cvtbuf;
+
                bufsize = sizeof(cvtbuf);
                
                if (cd->pull(cd->cd_pull, 
-                            inbuf, inbytesleft, &bufp, &bufsize) == -1
+                            inbuf, inbytesleft, &bufp1, &bufsize) == -1
                    && errno != E2BIG) return -1;
 
-               bufp = cvtbuf;
                bufsize = sizeof(cvtbuf) - bufsize;
 
                if (cd->push(cd->cd_push, 
-                            &bufp, &bufsize, 
+                            &bufp2, &bufsize, 
                             outbuf, outbytesleft) == -1) return -1;
        }
 
index 78492d23526ff96858e5672c3ab5f0f9863c3ab9..c3ea33aaecae82eba54e302cc3857d79d47f2ac9 100644 (file)
@@ -386,7 +386,7 @@ cleanup_princ:
 {
        static krb5_data kdata;
 
-       kdata.data = krb5_principal_get_comp_string(context, principal, i);
+       kdata.data = discard_const(krb5_principal_get_comp_string(context, principal, i));
        kdata.length = strlen(kdata.data);
        return &kdata;
 }
index 22ed783666375c07d7ed7afe1032a596a5471727..c36bb6a4fc157d5e20213afd8fa924ed0e21fba6 100644 (file)
@@ -64,7 +64,7 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
                case 'U':
                        s = va_arg(ap, char *);
                        head_size += 8;
-                       n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+                       n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
                        if (n == -1) {
                                return False;
                        }
@@ -87,7 +87,7 @@ BOOL msrpc_gen(TALLOC_CTX *mem_ctx, DATA_BLOB *blob,
                        n = va_arg(ap, int);
                        intargs[i] = n;
                        s = va_arg(ap, char *);
-                       n = push_ucs2_talloc(pointers, &pointers[i].data, s);
+                       n = push_ucs2_talloc(pointers, (void **)&pointers[i].data, s);
                        if (n == -1) {
                                return False;
                        }
index 85d77992fa919a99c0f326d3fe06691ef444e2cb..2779f47474fcbeb8072a9cff361712025ab914d0 100644 (file)
@@ -483,7 +483,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
        {
                /* The server offers a list of mechanisms */
                
-               char *my_mechs[] = {NULL, NULL};
+               const char *my_mechs[] = {NULL, NULL};
                NTSTATUS nt_status = NT_STATUS_INVALID_PARAMETER;
 
                if (!in.length) {
index 926cb7f88d5ca6d1c6ba932ae4414e2335fcb26c..3b9d148c67840f54bc4ec8f8f3e9b4381a72d61b 100644 (file)
@@ -41,7 +41,7 @@ enum spnego_negResult {
 };
 
 struct spnego_negTokenInit {
-       char **mechTypes;
+       const char **mechTypes;
        int reqFlags;
        DATA_BLOB mechToken;
        DATA_BLOB mechListMIC;
index 89155451da1b84be0381e7de206c78fa7520c21c..dd21eb89eaf1c2aa537590089219cf69d2c3c209 100644 (file)
@@ -548,7 +548,7 @@ static size_t smbcli_req_pull_ucs2(struct smbcli_request *req, TALLOC_CTX *mem_c
   of bytes consumed in the packet is returned
 */
 size_t smbcli_req_pull_ascii(struct smbcli_request *req, TALLOC_CTX *mem_ctx,
-                         char **dest, const char *src, int byte_len, uint_t flags)
+                            char **dest, const char *src, int byte_len, uint_t flags)
 {
        int src_len, src_len2;
        ssize_t ret;
index df44dbffa4fee84d4661e7b624908f29153e249d..dd8904dfd1857b09231069d727fe3307e9f6341d 100644 (file)
@@ -42,6 +42,8 @@ static void smb_raw_search_backend(struct smbcli_request *req,
        p = req->in.data + 3;
 
        for (i=0; i < count; i++) {
+               char *name;
+
                search_data.search.id.reserved      = CVAL(p, 0);
                memcpy(search_data.search.id.name,    p+1, 11);
                search_data.search.id.handle        = CVAL(p, 12);
@@ -51,7 +53,8 @@ static void smb_raw_search_backend(struct smbcli_request *req,
                search_data.search.write_time       = raw_pull_dos_date(req->transport,
                                                                        p + 22);
                search_data.search.size             = IVAL(p, 26);
-               smbcli_req_pull_ascii(req, mem_ctx, &search_data.search.name, p+30, 13, STR_ASCII);
+               smbcli_req_pull_ascii(req, mem_ctx, &name, p+30, 13, STR_ASCII);
+               search_data.search.name = name;
                if (!callback(private, &search_data)) {
                        break;
                }
index 15d9243acd669daee7182693e386b684c15c595b..e03b1d5f3917784a6a51bfcd4af892ba2fd9c81f 100644 (file)
@@ -494,7 +494,7 @@ int asn1_tag_remaining(ASN1_DATA *data)
 }
 
 /* read an object ID from a ASN1 buffer */
-BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
+BOOL asn1_read_OID(ASN1_DATA *data, const char **OID)
 {
        uint8_t b;
        char *tmp_oid = NULL;
@@ -525,7 +525,7 @@ BOOL asn1_read_OID(ASN1_DATA *data, char **OID)
 /* check that the next object ID is correct */
 BOOL asn1_check_OID(ASN1_DATA *data, const char *OID)
 {
-       char *id;
+       const char *id;
 
        if (!asn1_read_OID(data, &id)) return False;
 
index 6a60c7c47b255f6bc63ba80a77beafcb58a19211..ce1776f34ea539b1f364b889fe090287fee0b84b 100644 (file)
@@ -222,12 +222,12 @@ interface epmapper
           non-aligned. I wonder what sort of wicked substance these
           guys were smoking?
        */
-       typedef [flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
+       typedef [gensize,flag(NDR_NOALIGN|NDR_LITTLE_ENDIAN)] struct {
                uint16 num_floors;
                epm_floor floors[num_floors];
        } epm_tower;
 
-       typedef [gensize] struct {
+       typedef struct {
                [value(ndr_size_epm_tower(0, &r->tower,ndr->flags))] uint32  tower_length;
                [subcontext(4)] epm_tower tower;
        } epm_twr_t;
index 02eb3e95baeaf2c4887be0e7590a58b13fa22416..3462fb20c9c6c2d8d4f5b8a6e1bd8f3a1f07baa1 100644 (file)
@@ -390,6 +390,8 @@ static NTSTATUS ndr_map_error(enum ndr_err_code err)
                return NT_STATUS_BUFFER_TOO_SMALL;
        case NDR_ERR_ALLOC:
                return NT_STATUS_NO_MEMORY;
+       default:
+               break;
        }
 
        /* we should all error codes to different status codes */
index cfb02680e22445072b52c46392290f9e8753b9d5..a6307a94131879d5120a09510ded29b56aa65ddf 100644 (file)
@@ -394,7 +394,7 @@ NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe **p,
        io.ntcreatex.in.security_flags = 0;
        io.ntcreatex.in.fname = pipe_name;
 
-       status = smb_raw_open(tree, pipe_name, &io);
+       status = smb_raw_open(tree, tree, &io);
 
        if (!NT_STATUS_IS_OK(status)) {
                 return status;