mirror of
https://github.com/samba-team/samba.git
synced 2025-01-22 22:04:08 +03:00
r15191: Avoid uint_t as it's not standard.
(This used to be commit 7af59357b94e3819415b3a9257be0ced745ce130)
This commit is contained in:
parent
e26eea9787
commit
0eddf14b30
@ -2186,7 +2186,7 @@ static int cmd_chmod(struct smbclient_context *ctx, const char **args)
|
||||
|
||||
if (NT_STATUS_IS_ERR(smbcli_unix_chmod(ctx->cli->tree, src, mode))) {
|
||||
d_printf("%s chmod file %s 0%o\n",
|
||||
smbcli_errstr(ctx->cli->tree), src, (uint_t)mode);
|
||||
smbcli_errstr(ctx->cli->tree), src, (mode_t)mode);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ _PUBLIC_ void MD5Init(struct MD5Context *ctx)
|
||||
* Update context to reflect the concatenation of another buffer full
|
||||
* of bytes.
|
||||
*/
|
||||
_PUBLIC_ void MD5Update(struct MD5Context *ctx, const uint8_t *buf, uint_t len)
|
||||
_PUBLIC_ void MD5Update(struct MD5Context *ctx, const uint8_t *buf, size_t len)
|
||||
{
|
||||
register uint32_t t;
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
* the keys and the RGDB contains the actual data.
|
||||
*/
|
||||
|
||||
typedef uint_t DWORD;
|
||||
typedef uint32_t DWORD;
|
||||
typedef unsigned short WORD;
|
||||
|
||||
typedef struct creg_block {
|
||||
|
@ -182,7 +182,7 @@ _PUBLIC_ void setup_logging(const char *prog_name, enum debug_logtype new_logtyp
|
||||
return a string constant containing n tabs
|
||||
no more than 10 tabs are returned
|
||||
*/
|
||||
_PUBLIC_ const char *do_debug_tab(uint_t n)
|
||||
_PUBLIC_ const char *do_debug_tab(int n)
|
||||
{
|
||||
const char *tabs[] = {"", "\t", "\t\t", "\t\t\t", "\t\t\t\t", "\t\t\t\t\t",
|
||||
"\t\t\t\t\t\t", "\t\t\t\t\t\t\t", "\t\t\t\t\t\t\t\t",
|
||||
|
@ -40,7 +40,7 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
|
||||
{
|
||||
int fd;
|
||||
char pidstr[20];
|
||||
uint_t ret;
|
||||
pid_t ret;
|
||||
char *pidFile;
|
||||
|
||||
asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
|
||||
@ -58,9 +58,9 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
|
||||
goto noproc;
|
||||
}
|
||||
|
||||
ret = atoi(pidstr);
|
||||
ret = (pid_t)atoi(pidstr);
|
||||
|
||||
if (!process_exists((pid_t)ret)) {
|
||||
if (!process_exists(ret)) {
|
||||
goto noproc;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ _PUBLIC_ pid_t pidfile_pid(const char *name)
|
||||
|
||||
close(fd);
|
||||
SAFE_FREE(pidFile);
|
||||
return (pid_t)ret;
|
||||
return ret;
|
||||
|
||||
noproc:
|
||||
close(fd);
|
||||
@ -113,7 +113,7 @@ void pidfile_create(const char *name)
|
||||
}
|
||||
|
||||
memset(buf, 0, sizeof(buf));
|
||||
slprintf(buf, sizeof(buf) - 1, "%u\n", (uint_t) getpid());
|
||||
slprintf(buf, sizeof(buf) - 1, "%u\n", (unsigned int) getpid());
|
||||
if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
|
||||
DEBUG(0,("ERROR: can't write to file %s: %s\n",
|
||||
pidFile, strerror(errno)));
|
||||
|
@ -212,7 +212,7 @@ _PUBLIC_ int set_blocking(int fd, BOOL set)
|
||||
Sleep for a specified number of milliseconds.
|
||||
**/
|
||||
|
||||
_PUBLIC_ void msleep(uint_t t)
|
||||
_PUBLIC_ void msleep(unsigned int t)
|
||||
{
|
||||
struct timeval tval;
|
||||
|
||||
@ -581,7 +581,7 @@ _PUBLIC_ void dump_data_pw(const char *msg, const uint8_t * data, size_t len)
|
||||
* see if a range of memory is all zero. A NULL pointer is considered
|
||||
* to be all zero
|
||||
*/
|
||||
_PUBLIC_ BOOL all_zero(const uint8_t *ptr, uint_t size)
|
||||
_PUBLIC_ BOOL all_zero(const uint8_t *ptr, size_t size)
|
||||
{
|
||||
int i;
|
||||
if (!ptr) return True;
|
||||
|
@ -26,7 +26,7 @@
|
||||
This assumes the names are strict ascii, which should be a
|
||||
reasonable assumption
|
||||
*/
|
||||
uint_t ea_list_size(uint_t num_eas, struct ea_struct *eas)
|
||||
size_t ea_list_size(uint_t num_eas, struct ea_struct *eas)
|
||||
{
|
||||
uint_t total = 4;
|
||||
int i;
|
||||
@ -54,7 +54,7 @@ static uint_t ea_name_list_size(uint_t num_names, struct ea_name *eas)
|
||||
This assumes the names are strict ascii, which should be a
|
||||
reasonable assumption
|
||||
*/
|
||||
uint_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
|
||||
size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
|
||||
{
|
||||
uint_t total = 0;
|
||||
int i;
|
||||
|
@ -96,7 +96,7 @@ NTSTATUS smb_raw_changenotify_recv(struct smbcli_request *req,
|
||||
we need to do find out to what request the reply belongs
|
||||
****************************************************************************/
|
||||
struct smbcli_request *smbcli_handle_ntcancel_reply(struct smbcli_request *req,
|
||||
uint_t len, const uint8_t *hdr)
|
||||
size_t len, const uint8_t *hdr)
|
||||
{
|
||||
struct smbcli_request *ntcancel;
|
||||
|
||||
|
@ -64,7 +64,7 @@ NTSTATUS smbcli_request_destroy(struct smbcli_request *req)
|
||||
low-level function to setup a request buffer for a non-SMB packet
|
||||
at the transport level
|
||||
*/
|
||||
struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *transport, uint_t size)
|
||||
struct smbcli_request *smbcli_request_setup_nonsmb(struct smbcli_transport *transport, size_t size)
|
||||
{
|
||||
struct smbcli_request *req;
|
||||
|
||||
@ -147,7 +147,7 @@ struct smbcli_request *smbcli_request_setup_transport(struct smbcli_transport *t
|
||||
way. This interface is used before a session is setup.
|
||||
*/
|
||||
struct smbcli_request *smbcli_request_setup_session(struct smbcli_session *session,
|
||||
uint8_t command, uint_t wct, uint_t buflen)
|
||||
uint8_t command, uint_t wct, size_t buflen)
|
||||
{
|
||||
struct smbcli_request *req;
|
||||
|
||||
@ -254,7 +254,7 @@ static void smbcli_req_grow_data(struct smbcli_request *req, uint_t new_size)
|
||||
*/
|
||||
NTSTATUS smbcli_chained_request_setup(struct smbcli_request *req,
|
||||
uint8_t command,
|
||||
uint_t wct, uint_t buflen)
|
||||
uint_t wct, size_t buflen)
|
||||
{
|
||||
uint_t new_size = 1 + (wct*2) + 2 + buflen;
|
||||
|
||||
|
@ -32,12 +32,12 @@ struct request_buffer {
|
||||
uint8_t *buffer;
|
||||
|
||||
/* the size of the raw buffer, including 4 byte header */
|
||||
uint_t size;
|
||||
size_t size;
|
||||
|
||||
/* how much has been allocated - on reply the buffer is over-allocated to
|
||||
prevent too many realloc() calls
|
||||
*/
|
||||
uint_t allocated;
|
||||
size_t allocated;
|
||||
|
||||
/* the start of the SMB header - this is always buffer+4 */
|
||||
uint8_t *hdr;
|
||||
@ -45,11 +45,11 @@ struct request_buffer {
|
||||
/* the command words and command word count. vwv points
|
||||
into the raw buffer */
|
||||
uint8_t *vwv;
|
||||
uint_t wct;
|
||||
size_t wct;
|
||||
|
||||
/* the data buffer and size. data points into the raw buffer */
|
||||
uint8_t *data;
|
||||
uint_t data_size;
|
||||
size_t data_size;
|
||||
|
||||
/* ptr is used as a moving pointer into the data area
|
||||
* of the packet. The reason its here and not a local
|
||||
|
@ -101,7 +101,7 @@ BOOL signing_good(struct smb_signing_context *sign_info,
|
||||
return True;
|
||||
}
|
||||
|
||||
void sign_outgoing_message(struct request_buffer *out, DATA_BLOB *mac_key, uint_t seq_num)
|
||||
void sign_outgoing_message(struct request_buffer *out, DATA_BLOB *mac_key, unsigned int seq_num)
|
||||
{
|
||||
uint8_t calc_md5_mac[16];
|
||||
struct MD5Context md5_ctx;
|
||||
|
@ -168,7 +168,7 @@ BOOL smb2_request_is_ok(struct smb2_request *req)
|
||||
/*
|
||||
check if a range in the reply body is out of bounds
|
||||
*/
|
||||
BOOL smb2_oob(struct smb2_request_buffer *buf, const uint8_t *ptr, uint_t size)
|
||||
BOOL smb2_oob(struct smb2_request_buffer *buf, const uint8_t *ptr, size_t size)
|
||||
{
|
||||
/* be careful with wraparound! */
|
||||
if (ptr < buf->body ||
|
||||
|
@ -75,19 +75,19 @@ struct smb2_request_buffer {
|
||||
uint8_t *buffer;
|
||||
|
||||
/* the size of the raw buffer, including 4 byte header */
|
||||
uint_t size;
|
||||
size_t size;
|
||||
|
||||
/* how much has been allocated - on reply the buffer is over-allocated to
|
||||
prevent too many realloc() calls
|
||||
*/
|
||||
uint_t allocated;
|
||||
size_t allocated;
|
||||
|
||||
/* the start of the SMB2 header - this is always buffer+4 */
|
||||
uint8_t *hdr;
|
||||
|
||||
/* the packet body */
|
||||
uint8_t *body;
|
||||
uint_t body_size;
|
||||
size_t body_size;
|
||||
|
||||
/* this point to the next dynamic byte that can be used
|
||||
* this will be moved when some dynamic data is pushed
|
||||
@ -183,7 +183,7 @@ struct smb2_request {
|
||||
check that a body has the expected size
|
||||
*/
|
||||
#define SMB2_CHECK_PACKET_RECV(req, size, dynamic) do { \
|
||||
uint_t is_size = req->in.body_size; \
|
||||
size_t is_size = req->in.body_size; \
|
||||
uint16_t field_size = SVAL(req->in.body, 0); \
|
||||
uint16_t want_size = ((dynamic)?(size)+1:(size)); \
|
||||
if (is_size < (size)) { \
|
||||
|
@ -224,8 +224,9 @@ include/config.h:
|
||||
@echo "You need to rerun ./autogen.sh and ./configure"
|
||||
@/bin/false
|
||||
|
||||
clean_pch:
|
||||
-rm -f include/includes.h.gch
|
||||
clean_pch:
|
||||
@echo "Removing precompiled headers"
|
||||
@-rm -f include/includes.h.gch
|
||||
|
||||
pch: clean_pch include/includes.h.gch
|
||||
|
||||
|
@ -20,7 +20,8 @@ SWIG_INCLUDES = librpc/gen_ndr/samr.i librpc/gen_ndr/lsa.i librpc/gen_ndr/spools
|
||||
scripting/swig/dcerpc_wrap.c: scripting/swig/dcerpc.i scripting/swig/samba.i scripting/swig/status_codes.i $(SWIG_INCLUDES)
|
||||
|
||||
clean::
|
||||
-rm -f scripting/swig/tdb.pyc scripting/swig/tdb.py
|
||||
@echo "Removing SWIG output files"
|
||||
@-rm -f scripting/swig/tdb.pyc scripting/swig/tdb.py
|
||||
|
||||
# Swig testing
|
||||
|
||||
|
@ -89,7 +89,7 @@ static void req_setup_chain_reply(struct smbsrv_request *req, uint_t wct, uint_t
|
||||
the caller will then fill in the command words and data before calling req_send_reply() to
|
||||
send the reply on its way
|
||||
*/
|
||||
void smbsrv_setup_reply(struct smbsrv_request *req, uint_t wct, uint_t buflen)
|
||||
void smbsrv_setup_reply(struct smbsrv_request *req, uint_t wct, size_t buflen)
|
||||
{
|
||||
uint16_t flags2;
|
||||
|
||||
@ -248,7 +248,7 @@ static void req_grow_allocation(struct smbsrv_request *req, uint_t new_size)
|
||||
To cope with this req->out.ptr is supplied. This will be updated to
|
||||
point at the same offset into the packet as before this call
|
||||
*/
|
||||
void req_grow_data(struct smbsrv_request *req, uint_t new_size)
|
||||
void req_grow_data(struct smbsrv_request *req, size_t new_size)
|
||||
{
|
||||
int delta;
|
||||
|
||||
@ -364,7 +364,7 @@ void smbsrv_send_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, uint8_t *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, size_t flags)
|
||||
{
|
||||
size_t len;
|
||||
uint_t grow_size;
|
||||
|
@ -40,7 +40,7 @@ static struct smb2srv_request *smb2srv_init_request(struct smbsrv_connection *sm
|
||||
return req;
|
||||
}
|
||||
|
||||
NTSTATUS smb2srv_setup_reply(struct smb2srv_request *req, uint_t body_fixed_size, uint_t body_dynamic_size)
|
||||
NTSTATUS smb2srv_setup_reply(struct smb2srv_request *req, uint_t body_fixed_size, size_t body_dynamic_size)
|
||||
{
|
||||
req->out.size = SMB2_HDR_BODY+NBT_HDR_SIZE+body_fixed_size;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user