diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-12-04 13:56:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:06:21 -0500 |
commit | 9112a632f6791ffc3c3c1aadd214cbaba8fe816e (patch) | |
tree | 129b941d550b15e919461dedcde286f1697ba94d /source4/smb_server | |
parent | 4127edc1afd702ac3bcb77893ba864eb98729451 (diff) | |
download | samba-9112a632f6791ffc3c3c1aadd214cbaba8fe816e.tar.gz samba-9112a632f6791ffc3c3c1aadd214cbaba8fe816e.tar.bz2 samba-9112a632f6791ffc3c3c1aadd214cbaba8fe816e.zip |
r4063: - change char * -> uint8_t in struct request_buffer
- change smbcli_read/write to take void * for the buffers to match read(2)/write(2)
all this fixes a lot of gcc-4 warnings
metze
(This used to be commit b94f92bc6637f748d6f7049f4f9a30b0b8d18a7a)
Diffstat (limited to 'source4/smb_server')
-rw-r--r-- | source4/smb_server/negprot.c | 12 | ||||
-rw-r--r-- | source4/smb_server/nttrans.c | 2 | ||||
-rw-r--r-- | source4/smb_server/reply.c | 20 | ||||
-rw-r--r-- | source4/smb_server/request.c | 22 | ||||
-rw-r--r-- | source4/smb_server/search.c | 6 | ||||
-rw-r--r-- | source4/smb_server/smb_server.c | 4 | ||||
-rw-r--r-- | source4/smb_server/srvtime.c | 4 |
7 files changed, 35 insertions, 35 deletions
diff --git a/source4/smb_server/negprot.c b/source4/smb_server/negprot.c index bd1d8249d9..2cbdb9fcca 100644 --- a/source4/smb_server/negprot.c +++ b/source4/smb_server/negprot.c @@ -25,7 +25,7 @@ /* initialise the auth_context for this server and return the cryptkey */ -static void get_challenge(struct smbsrv_connection *smb_conn, char buff[8]) +static void get_challenge(struct smbsrv_connection *smb_conn, uint8_t buff[8]) { NTSTATUS nt_status; const uint8_t *cryptkey; @@ -386,7 +386,7 @@ void reply_negprot(struct smbsrv_request *req) int Index=0; int choice = -1; int protocol; - char *p; + uint8_t *p; if (req->smb_conn->negotiate.done_negprot) { smbsrv_terminate_connection(req->smb_conn, "multiple negprot's are not permitted"); @@ -398,8 +398,8 @@ void reply_negprot(struct smbsrv_request *req) while (p < req->in.data + req->in.data_size) { Index++; - DEBUG(3,("Requested protocol [%s]\n",p)); - p += strlen(p) + 2; + DEBUG(3,("Requested protocol [%s]\n",(const char *)p)); + p += strlen((const char *)p) + 2; } /* Check for protocols, most desirable first */ @@ -409,10 +409,10 @@ void reply_negprot(struct smbsrv_request *req) if ((supported_protocols[protocol].protocol_level <= lp_maxprotocol()) && (supported_protocols[protocol].protocol_level >= lp_minprotocol())) while (p < (req->in.data + req->in.data_size)) { - if (strequal(p,supported_protocols[protocol].proto_name)) + if (strequal((const char *)p,supported_protocols[protocol].proto_name)) choice = Index; Index++; - p += strlen(p) + 2; + p += strlen((const char *)p) + 2; } if(choice != -1) break; diff --git a/source4/smb_server/nttrans.c b/source4/smb_server/nttrans.c index 31391b88c1..0ab9c9ce2e 100644 --- a/source4/smb_server/nttrans.c +++ b/source4/smb_server/nttrans.c @@ -92,7 +92,7 @@ static NTSTATUS nttrans_create(struct smbsrv_request *req, io->ntcreatex.in.ea_list = NULL; req_pull_string(req, &io->ntcreatex.in.fname, - (const char *)(params + 54), + params + 54, trans->in.params.length - 54, STR_NO_RANGE_CHECK | STR_TERMINATE); if (!io->ntcreatex.in.fname) { diff --git a/source4/smb_server/reply.c b/source4/smb_server/reply.c index 31616b9435..3f1ddd26c7 100644 --- a/source4/smb_server/reply.c +++ b/source4/smb_server/reply.c @@ -83,7 +83,7 @@ void reply_tcon(struct smbsrv_request *req) { union smb_tcon con; NTSTATUS status; - char *p; + uint8_t *p; /* parse request */ REQ_CHECK_WCT(req, 0); @@ -126,7 +126,7 @@ void reply_tcon_and_X(struct smbsrv_request *req) { NTSTATUS status; union smb_tcon con; - char *p; + uint8_t *p; uint16_t passlen; con.tconx.level = RAW_TCON_TCONX; @@ -1625,7 +1625,7 @@ void reply_rmdir(struct smbsrv_request *req) void reply_mv(struct smbsrv_request *req) { union smb_rename *io; - char *p; + uint8_t *p; /* parse the request */ REQ_CHECK_WCT(req, 1); @@ -1659,7 +1659,7 @@ void reply_mv(struct smbsrv_request *req) void reply_ntrename(struct smbsrv_request *req) { union smb_rename *io; - char *p; + uint8_t *p; /* parse the request */ REQ_CHECK_WCT(req, 4); @@ -1711,7 +1711,7 @@ static void reply_copy_send(struct smbsrv_request *req) void reply_copy(struct smbsrv_request *req) { struct smb_copy *cp; - char *p; + uint8_t *p; /* parse request */ REQ_CHECK_WCT(req, 3); @@ -1774,7 +1774,7 @@ void reply_lockingX(struct smbsrv_request *req) union smb_lock *lck; uint_t total_locks, i; uint_t lck_size; - char *p; + uint8_t *p; /* parse request */ REQ_CHECK_WCT(req, 8); @@ -1953,7 +1953,7 @@ static void reply_sesssetup_old(struct smbsrv_request *req) { NTSTATUS status; union smb_sesssetup sess; - char *p; + uint8_t *p; uint16_t passlen; sess.old.level = RAW_SESSSETUP_OLD; @@ -2011,7 +2011,7 @@ static void reply_sesssetup_nt1(struct smbsrv_request *req) { NTSTATUS status; union smb_sesssetup sess; - char *p; + uint8_t *p; uint16_t passlen1, passlen2; sess.nt1.level = RAW_SESSSETUP_NT1; @@ -2081,7 +2081,7 @@ static void reply_sesssetup_spnego(struct smbsrv_request *req) { NTSTATUS status; union smb_sesssetup sess; - char *p; + uint8_t *p; uint16_t blob_len; sess.spnego.level = RAW_SESSSETUP_SPNEGO; @@ -2371,7 +2371,7 @@ void reply_sendtxt(struct smbsrv_request *req) void reply_special(struct smbsrv_request *req) { uint8_t msg_type; - char *buf = talloc_zero_array_p(req, char, 4); + uint8_t *buf = talloc_zero_array_p(req, uint8_t, 4); msg_type = CVAL(req->in.buffer,0); diff --git a/source4/smb_server/request.c b/source4/smb_server/request.c index 8e83ea31b3..4e63acdd92 100644 --- a/source4/smb_server/request.c +++ b/source4/smb_server/request.c @@ -218,7 +218,7 @@ int req_max_data(struct smbsrv_request *req) static void req_grow_allocation(struct smbsrv_request *req, uint_t new_size) { int delta; - char *buf2; + uint8_t *buf2; delta = new_size - req->out.data_size; if (delta + req->out.size <= req->out.allocated) { @@ -378,11 +378,11 @@ void req_reply_error(struct smbsrv_request *req, NTSTATUS status) if dest_len is -1 then no limit applies */ -size_t req_push_str(struct smbsrv_request *req, char *dest, const char *str, int dest_len, uint_t flags) +size_t req_push_str(struct smbsrv_request *req, uint8_t *dest, const char *str, int dest_len, uint_t flags) { size_t len; uint_t grow_size; - char *buf0; + uint8_t *buf0; const int max_bytes_per_char = 3; if (!(flags & (STR_ASCII|STR_UNICODE))) { @@ -460,7 +460,7 @@ size_t req_append_var_block(struct smbsrv_request *req, on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) +static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const uint8_t *src, int byte_len, uint_t flags) { int src_len, src_len2, alignment=0; ssize_t ret; @@ -518,7 +518,7 @@ static size_t req_pull_ucs2(struct smbsrv_request *req, const char **dest, const on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) +static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, const uint8_t *src, int byte_len, uint_t flags) { int src_len, src_len2; ssize_t ret; @@ -537,7 +537,7 @@ static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, cons } } - src_len2 = strnlen(src, src_len); + src_len2 = strnlen((const char *)src, src_len); if (src_len2 <= src_len - 1) { /* include the termination if we didn't reach the end of the packet */ src_len2++; @@ -567,7 +567,7 @@ static size_t req_pull_ascii(struct smbsrv_request *req, const char **dest, cons on failure zero is returned and *dest is set to NULL, otherwise the number of bytes consumed in the packet is returned */ -size_t req_pull_string(struct smbsrv_request *req, const char **dest, const char *src, int byte_len, uint_t flags) +size_t req_pull_string(struct smbsrv_request *req, const char **dest, const uint8_t *src, int byte_len, uint_t flags) { if (!(flags & STR_ASCII) && (((flags & STR_UNICODE) || (req->flags2 & FLAGS2_UNICODE_STRINGS)))) { @@ -587,7 +587,7 @@ size_t req_pull_string(struct smbsrv_request *req, const char **dest, const char on failure *dest is set to the zero length string. This seems to match win2000 behaviour */ -size_t req_pull_ascii4(struct smbsrv_request *req, const char **dest, const char *src, uint_t flags) +size_t req_pull_ascii4(struct smbsrv_request *req, const char **dest, const uint8_t *src, uint_t flags) { ssize_t ret; @@ -616,7 +616,7 @@ size_t req_pull_ascii4(struct smbsrv_request *req, const char **dest, const char return False if any part is outside the data portion of the packet */ -BOOL req_pull_blob(struct smbsrv_request *req, const char *src, int len, DATA_BLOB *blob) +BOOL req_pull_blob(struct smbsrv_request *req, const uint8_t *src, int len, DATA_BLOB *blob) { if (len != 0 && req_data_oob(req, src, len)) { return False; @@ -629,7 +629,7 @@ BOOL req_pull_blob(struct smbsrv_request *req, const char *src, int len, DATA_BL /* check that a lump of data in a request is within the bounds of the data section of the packet */ -BOOL req_data_oob(struct smbsrv_request *req, const char *ptr, uint32_t count) +BOOL req_data_oob(struct smbsrv_request *req, const uint8_t *ptr, uint32_t count) { if (count == 0) { return False; @@ -649,7 +649,7 @@ BOOL req_data_oob(struct smbsrv_request *req, const char *ptr, uint32_t count) /* pull an open file handle from a packet, taking account of the chained_fnum */ -uint16_t req_fnum(struct smbsrv_request *req, const char *base, uint_t offset) +uint16_t req_fnum(struct smbsrv_request *req, const uint8_t *base, uint_t offset) { if (req->chained_fnum != -1) { return req->chained_fnum; diff --git a/source4/smb_server/search.c b/source4/smb_server/search.c index a0bc5b764b..b017c996ef 100644 --- a/source4/smb_server/search.c +++ b/source4/smb_server/search.c @@ -70,7 +70,7 @@ struct search_state { static BOOL find_fill_info(struct smbsrv_request *req, union smb_search_data *file) { - char *p; + uint8_t *p; if (req->out.data_size + 43 > req_max_data(req)) { return False; @@ -111,7 +111,7 @@ void reply_search(struct smbsrv_request *req) union smb_search_next *sn; uint16_t resume_key_length; struct search_state state; - char *p; + uint8_t *p; NTSTATUS status; enum smb_search_level level = RAW_SEARCH_SEARCH; uint8_t op = CVAL(req->in.hdr,HDR_COM); @@ -225,7 +225,7 @@ void reply_fclose(struct smbsrv_request *req) { union smb_search_close *sc; uint16_t resume_key_length; - char *p; + uint8_t *p; const char *pattern; REQ_TALLOC(sc); diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index 24d1c7eeb6..d9fa226c8b 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -80,7 +80,7 @@ static NTSTATUS receive_smb_request(struct smbsrv_connection *smb_conn, struct t return NT_STATUS_NO_MEMORY; } - req->in.buffer = talloc_array_p(req, char, NBT_HDR_SIZE); + req->in.buffer = talloc_array_p(req, uint8_t, NBT_HDR_SIZE); if (req->in.buffer == NULL) { talloc_free(req); return NT_STATUS_NO_MEMORY; @@ -576,7 +576,7 @@ static void construct_reply(struct smbsrv_request *req) void chain_reply(struct smbsrv_request *req) { uint16_t chain_cmd, chain_offset; - char *vwv, *data; + uint8_t *vwv, *data; uint16_t wct; uint16_t data_size; diff --git a/source4/smb_server/srvtime.c b/source4/smb_server/srvtime.c index 999ffc3ee1..faeda6faf6 100644 --- a/source4/smb_server/srvtime.c +++ b/source4/smb_server/srvtime.c @@ -39,7 +39,7 @@ put a dos date into a buffer (date/time format) This takes GMT time and puts local time in the buffer ********************************************************************/ void srv_push_dos_date2(struct smbsrv_connection *smb_server, - char *buf, int offset, time_t unixdate) + uint8_t *buf, int offset, time_t unixdate) { push_dos_date2(buf, offset, unixdate, smb_server->negotiate.zone_offset); } @@ -49,7 +49,7 @@ put a dos 32 bit "unix like" date into a buffer. This routine takes GMT and converts it to LOCAL time in zone_offset before putting it ********************************************************************/ void srv_push_dos_date3(struct smbsrv_connection *smb_server, - char *buf, int offset, time_t unixdate) + uint8_t *buf, int offset, time_t unixdate) { push_dos_date3(buf, offset, unixdate, smb_server->negotiate.zone_offset); } |