From 6abd986704291b051af5eeb67f670a0e8cf845fd Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Sat, 2 May 2015 21:01:14 -0700 Subject: [PATCH] Convert all uses of uint8/16/32 to _t in source3/smbd. Signed-off-by: Richard Sharpe Reviewed-by: Jeremy Allison --- source3/smbd/blocking.c | 8 ++--- source3/smbd/dir.c | 20 +++++------ source3/smbd/dmapi.c | 6 ++-- source3/smbd/dosmode.c | 18 +++++----- source3/smbd/error.c | 10 +++--- source3/smbd/file_access.c | 2 +- source3/smbd/files.c | 8 ++--- source3/smbd/globals.h | 4 +-- source3/smbd/ipc.c | 8 ++--- source3/smbd/negprot.c | 16 ++++----- source3/smbd/notify.c | 20 +++++------ source3/smbd/open.c | 4 +-- source3/smbd/oplock.c | 8 ++--- source3/smbd/pipes.c | 2 +- source3/smbd/posix_acls.c | 36 +++++++++---------- source3/smbd/process.c | 12 +++---- source3/smbd/proto.h | 86 +++++++++++++++++++++++----------------------- source3/smbd/pysmbd.c | 4 +-- source3/smbd/reply.c | 8 ++--- source3/smbd/server.c | 2 +- source3/smbd/service.c | 2 +- source3/smbd/sesssetup.c | 16 ++++----- source3/smbd/smbd.h | 12 +++---- source3/smbd/srvstr.c | 8 ++--- source3/smbd/trans2.c | 28 +++++++-------- 25 files changed, 174 insertions(+), 174 deletions(-) diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c index 942c4b3192a..4fd8e1da123 100644 --- a/source3/smbd/blocking.c +++ b/source3/smbd/blocking.c @@ -334,7 +334,7 @@ static void generic_blocking_lock_error(struct blocking_lock_record *blr, NTSTAT static void undo_locks_obtained(struct blocking_lock_record *blr) { files_struct *fsp = blr->fsp; - uint16 num_ulocks = SVAL(blr->req->vwv+6, 0); + uint16_t num_ulocks = SVAL(blr->req->vwv+6, 0); uint64_t count = (uint64_t)0, offset = (uint64_t) 0; uint64_t smblctx; unsigned char locktype = CVAL(blr->req->vwv+3, 0); @@ -451,8 +451,8 @@ static bool process_lockingX(struct blocking_lock_record *blr) { unsigned char locktype = CVAL(blr->req->vwv+3, 0); files_struct *fsp = blr->fsp; - uint16 num_ulocks = SVAL(blr->req->vwv+6, 0); - uint16 num_locks = SVAL(blr->req->vwv+7, 0); + uint16_t num_ulocks = SVAL(blr->req->vwv+6, 0); + uint16_t num_locks = SVAL(blr->req->vwv+7, 0); bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES); uint8_t *data; NTSTATUS status = NT_STATUS_OK; @@ -980,7 +980,7 @@ struct blocking_lock_record *blocking_lock_cancel_smb1(files_struct *fsp, messaging_send_buf(sconn->msg_ctx, messaging_server_id(sconn->msg_ctx), MSG_SMB_BLOCKING_LOCK_CANCEL, - (uint8 *)&msg, sizeof(msg)); + (uint8_t *)&msg, sizeof(msg)); return blr; } diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 3cddc4ad101..c700cb7dd12 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -64,12 +64,12 @@ struct smb_Dir { struct dptr_struct { struct dptr_struct *next, *prev; int dnum; - uint16 spid; + uint16_t spid; struct connection_struct *conn; struct smb_Dir *dir_hnd; bool expect_close; char *wcard; - uint32 attr; + uint32_t attr; char *path; bool has_wild; /* Set to true if the wcard entry has MS wildcard characters in it. */ bool did_stat; /* Optimisation for non-wcard searches. */ @@ -81,7 +81,7 @@ struct dptr_struct { static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, const char *mask, - uint32 attr); + uint32_t attr); static void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset); @@ -209,7 +209,7 @@ const char *dptr_wcard(struct smbd_server_connection *sconn, int key) Get the dir attrib for a dir index. ****************************************************************************/ -uint16 dptr_attr(struct smbd_server_connection *sconn, int key) +uint16_t dptr_attr(struct smbd_server_connection *sconn, int key) { struct dptr_struct *dptr = dptr_get(sconn, key, false); if (dptr) @@ -334,7 +334,7 @@ void dptr_idlecnum(connection_struct *conn) ****************************************************************************/ void dptr_closepath(struct smbd_server_connection *sconn, - char *path,uint16 spid) + char *path,uint16_t spid) { struct dptr_struct *dptr, *next; for(dptr = sconn->searches.dirptrs; dptr; dptr = next) { @@ -444,8 +444,8 @@ static struct smb_Dir *open_dir_with_privilege(connection_struct *conn, NTSTATUS dptr_create(connection_struct *conn, struct smb_request *req, files_struct *fsp, - const char *path, bool old_handle, bool expect_close,uint16 spid, - const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret) + const char *path, bool old_handle, bool expect_close,uint16_t spid, + const char *wcard, bool wcard_has_wild, uint32_t attr, struct dptr_struct **dptr_ret) { struct smbd_server_connection *sconn = conn->sconn; struct dptr_struct *dptr = NULL; @@ -1230,7 +1230,7 @@ static bool smbd_dirptr_8_3_match_fn(TALLOC_CTX *ctx, size_t ret_len = 0; size_t len = (strlen(dname) + 2) * 4; /* Allow enough space. */ uint8_t *tmp = talloc_array(talloc_tos(), - uint8, + uint8_t, len); status = srvstr_push(NULL, @@ -1533,7 +1533,7 @@ static int smb_Dir_destructor(struct smb_Dir *dirp) struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn, const char *name, const char *mask, - uint32 attr) + uint32_t attr) { struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir); struct smbd_server_connection *sconn = conn->sconn; @@ -1577,7 +1577,7 @@ struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn, static struct smb_Dir *OpenDir_fsp(TALLOC_CTX *mem_ctx, connection_struct *conn, files_struct *fsp, const char *mask, - uint32 attr) + uint32_t attr) { struct smb_Dir *dirp = talloc_zero(mem_ctx, struct smb_Dir); struct smbd_server_connection *sconn = conn->sconn; diff --git a/source3/smbd/dmapi.c b/source3/smbd/dmapi.c index 90c24bd5de5..7e8244551a8 100644 --- a/source3/smbd/dmapi.c +++ b/source3/smbd/dmapi.c @@ -27,7 +27,7 @@ #ifndef USE_DMAPI -uint32 dmapi_file_flags(const char * const path) { return 0; } +uint32_t dmapi_file_flags(const char * const path) { return 0; } bool dmapi_have_session(void) { return False; } const void * dmapi_get_current_session(void) { return NULL; } @@ -259,7 +259,7 @@ bool dmapi_destroy_session(void) is used in vfs_tsmsm.c will work with other DMAPI-based HSM implementations as well. */ -uint32 dmapi_file_flags(const char * const path) +uint32_t dmapi_file_flags(const char * const path) { int err; dm_eventset_t events = {0}; @@ -271,7 +271,7 @@ uint32 dmapi_file_flags(const char * const path) void *dm_handle = NULL; size_t dm_handle_len = 0; - uint32 flags = 0; + uint32_t flags = 0; _dmapi_session_ptr = dmapi_get_current_session(); if (_dmapi_session_ptr == NULL) { diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 8c0781b19ed..714a7f861f8 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -201,7 +201,7 @@ mode_t unix_mode(connection_struct *conn, int dosmode, Change a unix mode to a dos mode. ****************************************************************************/ -static uint32 dos_mode_from_sbuf(connection_struct *conn, +static uint32_t dos_mode_from_sbuf(connection_struct *conn, const struct smb_filename *smb_fname) { int result = 0; @@ -258,7 +258,7 @@ static uint32 dos_mode_from_sbuf(connection_struct *conn, static bool get_ea_dos_attribute(connection_struct *conn, struct smb_filename *smb_fname, - uint32 *pattr) + uint32_t *pattr) { struct xattr_DOSATTRIB dosattrib; enum ndr_err_code ndr_err; @@ -364,7 +364,7 @@ static bool get_ea_dos_attribute(connection_struct *conn, dosattr |= FILE_ATTRIBUTE_DIRECTORY; } /* FILE_ATTRIBUTE_SPARSE is valid on get but not on set. */ - *pattr = (uint32)(dosattr & (SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE)); + *pattr = (uint32_t)(dosattr & (SAMBA_ATTRIBUTES_MASK|FILE_ATTRIBUTE_SPARSE)); DEBUG(8,("get_ea_dos_attribute returning (0x%x)", dosattr)); @@ -386,7 +386,7 @@ static bool get_ea_dos_attribute(connection_struct *conn, static bool set_ea_dos_attribute(connection_struct *conn, struct smb_filename *smb_fname, - uint32 dosmode) + uint32_t dosmode) { struct xattr_DOSATTRIB dosattrib; enum ndr_err_code ndr_err; @@ -490,10 +490,10 @@ static bool set_ea_dos_attribute(connection_struct *conn, Change a unix mode to a dos mode for an ms dfs link. ****************************************************************************/ -uint32 dos_mode_msdfs(connection_struct *conn, +uint32_t dos_mode_msdfs(connection_struct *conn, const struct smb_filename *smb_fname) { - uint32 result = 0; + uint32_t result = 0; DEBUG(8,("dos_mode_msdfs: %s\n", smb_fname_str_dbg(smb_fname))); @@ -592,9 +592,9 @@ err_out: if "store dos attributes" is true. ****************************************************************************/ -uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname) +uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname) { - uint32 result = 0; + uint32_t result = 0; bool offline; DEBUG(8,("dos_mode: %s\n", smb_fname_str_dbg(smb_fname))); @@ -665,7 +665,7 @@ uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname) ********************************************************************/ int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, - uint32 dosmode, const char *parent_dir, bool newfile) + uint32_t dosmode, const char *parent_dir, bool newfile) { int mask=0; mode_t tmp; diff --git a/source3/smbd/error.c b/source3/smbd/error.c index d038acfe023..c91f5b0daf4 100644 --- a/source3/smbd/error.c +++ b/source3/smbd/error.c @@ -53,12 +53,12 @@ bool use_nt_status(void) server. ****************************************************************************/ -void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file) +void error_packet_set(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file) { bool force_nt_status = False; bool force_dos_status = False; - if (eclass == (uint8)-1) { + if (eclass == (uint8_t)-1) { force_nt_status = True; } else if (NT_STATUS_IS_DOS(ntstatus)) { force_dos_status = True; @@ -105,7 +105,7 @@ void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatu } } -int error_packet(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file) +int error_packet(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file) { int outsize = srv_set_message(outbuf,0,0,True); error_packet_set(outbuf, eclass, ecode, ntstatus, line, file); @@ -124,7 +124,7 @@ void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus, Forces a DOS error on the wire. ****************************************************************************/ -void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode, +void reply_force_dos_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, int line, const char *file) { TALLOC_FREE(req->outbuf); @@ -136,7 +136,7 @@ void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode, file); } -void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode, +void reply_both_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, NTSTATUS status, int line, const char *file) { TALLOC_FREE(req->outbuf); diff --git a/source3/smbd/file_access.c b/source3/smbd/file_access.c index cead1e43015..75fd13f15bd 100644 --- a/source3/smbd/file_access.c +++ b/source3/smbd/file_access.c @@ -178,7 +178,7 @@ bool directory_has_default_acl(connection_struct *conn, const char *fname) Check if setting delete on close is allowed on this fsp. ****************************************************************************/ -NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode) +NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode) { /* * Only allow delete on close for writable files. diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 829423e2e30..8fefddddfa0 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -170,7 +170,7 @@ void file_close_conn(connection_struct *conn) Close all open files for a pid and a vuid. ****************************************************************************/ -void file_close_pid(struct smbd_server_connection *sconn, uint16 smbpid, +void file_close_pid(struct smbd_server_connection *sconn, uint16_t smbpid, uint64_t vuid) { files_struct *fsp, *next; @@ -558,7 +558,7 @@ void file_free(struct smb_request *req, files_struct *fsp) Get an fsp from a packet given a 16 bit fnum. ****************************************************************************/ -files_struct *file_fsp(struct smb_request *req, uint16 fid) +files_struct *file_fsp(struct smb_request *req, uint16_t fid) { struct smbXsrv_open *op; NTSTATUS status; @@ -687,8 +687,8 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req, ****************************************************************************/ NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from, - uint32 access_mask, uint32 share_access, - uint32 create_options, files_struct *to) + uint32_t access_mask, uint32_t share_access, + uint32_t create_options, files_struct *to) { /* this can never happen for print files */ SMB_ASSERT(from->print_file == NULL); diff --git a/source3/smbd/globals.h b/source3/smbd/globals.h index b52c6a99f64..c7e260830ef 100644 --- a/source3/smbd/globals.h +++ b/source3/smbd/globals.h @@ -189,9 +189,9 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx, NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, connection_struct *conn, struct dptr_struct *dirptr, - uint16 flags2, + uint16_t flags2, const char *path_mask, - uint32 dirtype, + uint32_t dirtype, int info_level, int requires_resume_key, bool dont_descend, diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c index 6f4c7e0f11c..f1c8ea0c2ed 100644 --- a/source3/smbd/ipc.c +++ b/source3/smbd/ipc.c @@ -453,7 +453,7 @@ static void api_no_reply(connection_struct *conn, struct smb_request *req) static void api_fd_reply(connection_struct *conn, uint64_t vuid, struct smb_request *req, - uint16 *setup, uint8_t *data, char *params, + uint16_t *setup, uint8_t *data, char *params, int suwcnt, int tdscnt, int tpscnt, int mdrcnt, int mprcnt) { @@ -534,7 +534,7 @@ static void api_fd_reply(connection_struct *conn, uint64_t vuid, static void named_pipe(connection_struct *conn, uint64_t vuid, struct smb_request *req, - const char *name, uint16 *setup, + const char *name, uint16_t *setup, char *data, char *params, int suwcnt, int tdscnt,int tpscnt, int msrcnt, int mdrcnt, int mprcnt) @@ -796,10 +796,10 @@ void reply_trans(struct smb_request *req) } if((state->setup = talloc_array( - state, uint16, state->setup_count)) == NULL) { + state, uint16_t, state->setup_count)) == NULL) { DEBUG(0,("reply_trans: setup malloc fail for %u " "bytes !\n", (unsigned int) - (state->setup_count * sizeof(uint16)))); + (state->setup_count * sizeof(uint16_t)))); SAFE_FREE(state->data); SAFE_FREE(state->param); TALLOC_FREE(state); diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index e6a9bde15e1..fe942c13397 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -31,7 +31,7 @@ extern fstring remote_proto; -static void get_challenge(struct smbXsrv_connection *xconn, uint8 buff[8]) +static void get_challenge(struct smbXsrv_connection *xconn, uint8_t buff[8]) { NTSTATUS nt_status; @@ -60,7 +60,7 @@ static void get_challenge(struct smbXsrv_connection *xconn, uint8 buff[8]) Reply for the lanman 1.0 protocol. ****************************************************************************/ -static void reply_lanman1(struct smb_request *req, uint16 choice) +static void reply_lanman1(struct smb_request *req, uint16_t choice) { int secword=0; time_t t = time(NULL); @@ -85,7 +85,7 @@ static void reply_lanman1(struct smb_request *req, uint16 choice) SSVAL(req->outbuf,smb_vwv1,secword); /* Create a token value and add it to the outgoing packet. */ if (xconn->smb1.negprot.encrypted_passwords) { - get_challenge(xconn, (uint8 *)smb_buf(req->outbuf)); + get_challenge(xconn, (uint8_t *)smb_buf(req->outbuf)); SSVAL(req->outbuf,smb_vwv11, 8); } @@ -110,7 +110,7 @@ static void reply_lanman1(struct smb_request *req, uint16 choice) Reply for the lanman 2.0 protocol. ****************************************************************************/ -static void reply_lanman2(struct smb_request *req, uint16 choice) +static void reply_lanman2(struct smb_request *req, uint16_t choice) { int secword=0; time_t t = time(NULL); @@ -137,7 +137,7 @@ static void reply_lanman2(struct smb_request *req, uint16 choice) /* Create a token value and add it to the outgoing packet. */ if (xconn->smb1.negprot.encrypted_passwords) { - get_challenge(xconn, (uint8 *)smb_buf(req->outbuf)); + get_challenge(xconn, (uint8_t *)smb_buf(req->outbuf)); SSVAL(req->outbuf,smb_vwv11, 8); } @@ -239,7 +239,7 @@ DATA_BLOB negprot_spnego(TALLOC_CTX *ctx, struct smbXsrv_connection *xconn) Reply for the nt protocol. ****************************************************************************/ -static void reply_nt1(struct smb_request *req, uint16 choice) +static void reply_nt1(struct smb_request *req, uint16_t choice) { /* dual names + lock_and_read + nt SMBs + remote API calls */ int capabilities = CAP_NT_FIND|CAP_LOCK_AND_READ| @@ -345,7 +345,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice) if (!negotiate_spnego) { /* Create a token value and add it to the outgoing packet. */ if (xconn->smb1.negprot.encrypted_passwords) { - uint8 chal[8]; + uint8_t chal[8]; /* note that we do not send a challenge at all if we are using plaintext */ get_challenge(xconn, chal); @@ -483,7 +483,7 @@ protocol [LANMAN2.1] static const struct { const char *proto_name; const char *short_name; - void (*proto_reply_fn)(struct smb_request *req, uint16 choice); + void (*proto_reply_fn)(struct smb_request *req, uint16_t choice); int protocol_level; } supported_protocols[] = { {"SMB 2.???", "SMB2_FF", reply_smb20ff, PROTOCOL_SMB2_10}, diff --git a/source3/smbd/notify.c b/source3/smbd/notify.c index 8cb44df3c1d..3f2d07cf667 100644 --- a/source3/smbd/notify.c +++ b/source3/smbd/notify.c @@ -55,8 +55,8 @@ struct notify_change_request { struct notify_change_request *prev, *next; struct files_struct *fsp; /* backpointer for cancel by mid */ struct smb_request *req; - uint32 filter; - uint32 max_param; + uint32_t filter; + uint32_t max_param; void (*reply_fn)(struct smb_request *req, NTSTATUS error_code, uint8_t *buf, size_t len); @@ -65,7 +65,7 @@ struct notify_change_request { }; static void notify_fsp(files_struct *fsp, struct timespec when, - uint32 action, const char *name); + uint32_t action, const char *name); bool change_notify_fsp_has_changes(struct files_struct *fsp) { @@ -115,7 +115,7 @@ static int compare_notify_change_events(const void *p1, const void *p2) } static bool notify_marshall_changes(int num_changes, - uint32 max_offset, + uint32_t max_offset, struct notify_change_event *changes, DATA_BLOB *final_blob) { @@ -245,7 +245,7 @@ static void sys_notify_callback(struct sys_notify_context *ctx, notify_fsp(fsp, timespec_current(), e->action, e->path); } -NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, +NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter, bool recursive) { char *fullpath; @@ -307,8 +307,8 @@ NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, } NTSTATUS change_notify_add_request(struct smb_request *req, - uint32 max_param, - uint32 filter, bool recursive, + uint32_t max_param, + uint32_t filter, bool recursive, struct files_struct *fsp, void (*reply_fn)(struct smb_request *req, NTSTATUS error_code, @@ -481,7 +481,7 @@ void remove_pending_change_notify_requests_by_fid(files_struct *fsp, } } -void notify_fname(connection_struct *conn, uint32 action, uint32 filter, +void notify_fname(connection_struct *conn, uint32_t action, uint32_t filter, const char *path) { struct notify_context *notify_ctx = conn->sconn->notify_ctx; @@ -494,7 +494,7 @@ void notify_fname(connection_struct *conn, uint32 action, uint32 filter, } static void notify_fsp(files_struct *fsp, struct timespec when, - uint32 action, const char *name) + uint32_t action, const char *name) { struct notify_change_event *change, *changes; char *tmp; @@ -594,7 +594,7 @@ static void notify_fsp(files_struct *fsp, struct timespec when, change_notify_remove_request(fsp->conn->sconn, fsp->notify->requests); } -char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32 filter) +char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32_t filter) { char *result = NULL; diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 7a842073cb0..809fa352dfc 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1130,7 +1130,7 @@ static void validate_my_share_entries(struct smbd_server_connection *sconn, "share entry with an open file\n"); } - if (((uint16)fsp->oplock_type) != share_entry->op_type) { + if (((uint16_t)fsp->oplock_type) != share_entry->op_type) { goto panic; } @@ -1261,7 +1261,7 @@ NTSTATUS send_break_message(struct messaging_context *msg_ctx, /* Overload entry->op_type */ /* - * This is a cut from uint32_t to uint16, but so far only the lower 3 + * This is a cut from uint32_t to uint16_t, but so far only the lower 3 * bits (LEASE_WRITE/HANDLE/READ are used anyway. */ SSVAL(msg,OP_BREAK_MSG_OP_TYPE_OFFSET, break_to); diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index e29b5b175fe..2d426f7231f 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -1111,7 +1111,7 @@ static void send_break_to_none(struct messaging_context *msg_ctx, SSVAL(msg, OP_BREAK_MSG_OP_TYPE_OFFSET, NO_OPLOCK); messaging_send_buf(msg_ctx, e->pid, MSG_SMB_BREAK_REQUEST, - (uint8 *)msg, sizeof(msg)); + (uint8_t *)msg, sizeof(msg)); } static void do_break_to_none(struct tevent_context *ctx, @@ -1261,7 +1261,7 @@ void smbd_contend_level2_oplocks_end(files_struct *fsp, void share_mode_entry_to_message(char *msg, const struct share_mode_entry *e) { - SIVAL(msg,OP_BREAK_MSG_PID_OFFSET,(uint32)e->pid.pid); + SIVAL(msg,OP_BREAK_MSG_PID_OFFSET,(uint32_t)e->pid.pid); SBVAL(msg,OP_BREAK_MSG_MID_OFFSET,e->op_mid); SSVAL(msg,OP_BREAK_MSG_OP_TYPE_OFFSET,e->op_type); SIVAL(msg,OP_BREAK_MSG_ACCESS_MASK_OFFSET,e->access_mask); @@ -1293,8 +1293,8 @@ void message_to_share_mode_entry(struct share_mode_entry *e, const char *msg) e->time.tv_usec = (int)IVAL(msg,OP_BREAK_MSG_TIME_USEC_OFFSET); pull_file_id_24(msg+OP_BREAK_MSG_DEV_OFFSET, &e->id); e->share_file_id = (unsigned long)IVAL(msg,OP_BREAK_MSG_FILE_ID_OFFSET); - e->uid = (uint32)IVAL(msg,OP_BREAK_MSG_UID_OFFSET); - e->flags = (uint16)SVAL(msg,OP_BREAK_MSG_FLAGS_OFFSET); + e->uid = (uint32_t)IVAL(msg,OP_BREAK_MSG_UID_OFFSET); + e->flags = (uint16_t)SVAL(msg,OP_BREAK_MSG_FLAGS_OFFSET); e->name_hash = IVAL(msg,OP_BREAK_MSG_NAME_HASH_OFFSET); e->pid.vnn = IVAL(msg,OP_BREAK_MSG_VNN_OFFSET); } diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c index f9390b4b558..455dbf0cf49 100644 --- a/source3/smbd/pipes.c +++ b/source3/smbd/pipes.c @@ -399,7 +399,7 @@ void reply_pipe_read_and_X(struct smb_request *req) is deliberate, instead we always return the next lump of data on the pipe */ #if 0 - uint32 smb_offs = IVAL(req->vwv+3, 0); + uint32_t smb_offs = IVAL(req->vwv+3, 0); #endif if (!fsp_is_np(fsp)) { diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 8b4c7b1c80c..b69e5b49231 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -130,7 +130,7 @@ struct pai_val { }; /************************************************************************ - Return a uint32 of the pai_entry principal. + Return a uint32_t of the pai_entry principal. ************************************************************************/ static uint32_t get_pai_entry_val(struct pai_entry *paie) @@ -150,7 +150,7 @@ static uint32_t get_pai_entry_val(struct pai_entry *paie) } /************************************************************************ - Return a uint32 of the entry principal. + Return a uint32_t of the entry principal. ************************************************************************/ static uint32_t get_entry_val(canon_ace *ace_entry) @@ -338,8 +338,8 @@ static uint16_t get_pai_flags(struct pai_val *pal, canon_ace *ace_entry, bool de static bool check_pai_ok_v1(const char *pai_buf, size_t pai_buf_data_size) { - uint16 num_entries; - uint16 num_def_entries; + uint16_t num_entries; + uint16_t num_def_entries; if (pai_buf_data_size < PAI_V1_ENTRIES_BASE) { /* Corrupted - too small. */ @@ -370,8 +370,8 @@ static bool check_pai_ok_v1(const char *pai_buf, size_t pai_buf_data_size) static bool check_pai_ok_v2(const char *pai_buf, size_t pai_buf_data_size) { - uint16 num_entries; - uint16 num_def_entries; + uint16_t num_entries; + uint16_t num_def_entries; if (pai_buf_data_size < PAI_V2_ENTRIES_BASE) { /* Corrupted - too small. */ @@ -1120,7 +1120,7 @@ uint32_t map_canon_ace_perms(int snum, #define FILE_SPECIFIC_WRITE_BITS (FILE_WRITE_DATA|FILE_APPEND_DATA|FILE_WRITE_EA) #define FILE_SPECIFIC_EXECUTE_BITS (FILE_EXECUTE) -static mode_t map_nt_perms( uint32 *mask, int type) +static mode_t map_nt_perms( uint32_t *mask, int type) { mode_t mode = 0; @@ -1163,7 +1163,7 @@ static mode_t map_nt_perms( uint32 *mask, int type) NTSTATUS unpack_nt_owners(struct connection_struct *conn, uid_t *puser, gid_t *pgrp, - uint32 security_info_sent, const struct + uint32_t security_info_sent, const struct security_descriptor *psd) { *puser = (uid_t)-1; @@ -2447,7 +2447,7 @@ static bool unpack_canon_ace(files_struct *fsp, struct dom_sid *pfile_grp_sid, canon_ace **ppfile_ace, canon_ace **ppdir_ace, - uint32 security_info_sent, + uint32_t security_info_sent, const struct security_descriptor *psd) { canon_ace *file_ace = NULL; @@ -3144,8 +3144,8 @@ static size_t merge_default_aces( struct security_ace *nt_ace_list, size_t num_a for (i = 0; i < num_aces; i++) { for (j = i+1; j < num_aces; j++) { - uint32 i_flags_ni = (nt_ace_list[i].flags & ~SEC_ACE_FLAG_INHERITED_ACE); - uint32 j_flags_ni = (nt_ace_list[j].flags & ~SEC_ACE_FLAG_INHERITED_ACE); + uint32_t i_flags_ni = (nt_ace_list[i].flags & ~SEC_ACE_FLAG_INHERITED_ACE); + uint32_t j_flags_ni = (nt_ace_list[j].flags & ~SEC_ACE_FLAG_INHERITED_ACE); bool i_inh = (nt_ace_list[i].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False; bool j_inh = (nt_ace_list[j].flags & SEC_ACE_FLAG_INHERITED_ACE) ? True : False; @@ -3637,7 +3637,7 @@ NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid) it, even though it's a const pointer. ****************************************************************************/ -NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd_orig) +NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd_orig) { connection_struct *conn = fsp->conn; uid_t user = (uid_t)-1; @@ -4257,7 +4257,7 @@ static bool unix_ex_wire_to_tagtype(unsigned char wire_tt, SMB_ACL_TAG_T *p_tt) ****************************************************************************/ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, - uint16 num_acls, + uint16_t num_acls, const char *pdata, TALLOC_CTX *mem_ctx) { @@ -4313,7 +4313,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, } if (tag_type == SMB_ACL_USER) { - uint32 uidval = IVAL(pdata,(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); + uint32_t uidval = IVAL(pdata,(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); uid_t uid = (uid_t)uidval; if (sys_acl_set_qualifier(the_entry,(void *)&uid) == -1) { DEBUG(0,("create_posix_acl_from_wire: Failed to set uid %u on entry %u. (%s)\n", @@ -4323,7 +4323,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, } if (tag_type == SMB_ACL_GROUP) { - uint32 gidval = IVAL(pdata,(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); + uint32_t gidval = IVAL(pdata,(i*SMB_POSIX_ACL_ENTRY_SIZE)+2); gid_t gid = (uid_t)gidval; if (sys_acl_set_qualifier(the_entry,(void *)&gid) == -1) { DEBUG(0,("create_posix_acl_from_wire: Failed to set gid %u on entry %u. (%s)\n", @@ -4351,7 +4351,7 @@ static SMB_ACL_T create_posix_acl_from_wire(connection_struct *conn, ****************************************************************************/ bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, const SMB_STRUCT_STAT *psbuf, - uint16 num_def_acls, const char *pdata) + uint16_t num_def_acls, const char *pdata) { SMB_ACL_T def_acl = NULL; @@ -4539,7 +4539,7 @@ static bool remove_posix_acl(connection_struct *conn, files_struct *fsp, const c except SMB_ACL_USER_OBJ, SMB_ACL_GROUP_OBJ, SMB_ACL_OTHER. ****************************************************************************/ -bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata) +bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16_t num_acls, const char *pdata) { SMB_ACL_T file_acl = NULL; @@ -4586,7 +4586,7 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char * ********************************************************************/ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname, - uint32 security_info_wanted, + uint32_t security_info_wanted, struct security_descriptor **sd) { TALLOC_CTX *frame = talloc_stackframe(); diff --git a/source3/smbd/process.c b/source3/smbd/process.c index aa7f419a1b2..72135a2c0bf 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -584,7 +584,7 @@ static NTSTATUS receive_smb_talloc(TALLOC_CTX *mem_ctx, static bool init_smb_request(struct smb_request *req, struct smbd_server_connection *sconn, struct smbXsrv_connection *xconn, - const uint8 *inbuf, + const uint8_t *inbuf, size_t unread_bytes, bool encrypted, uint32_t seqnum) { @@ -1382,7 +1382,7 @@ static bool create_outbuf(TALLOC_CTX *mem_ctx, struct smb_request *req, return true; } -void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes) +void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes) { char *outbuf; if (!create_outbuf(req, req, req->inbuf, &outbuf, num_words, @@ -1443,7 +1443,7 @@ static void smb_dump(const char *name, int type, const char *data) find. ****************************************************************************/ -static connection_struct *switch_message(uint8 type, struct smb_request *req) +static connection_struct *switch_message(uint8_t type, struct smb_request *req) { int flags; uint64_t session_tag; @@ -1666,7 +1666,7 @@ static void construct_reply(struct smbXsrv_connection *xconn, smb_panic("could not allocate smb_request"); } - if (!init_smb_request(req, sconn, xconn, (uint8 *)inbuf, unread_bytes, + if (!init_smb_request(req, sconn, xconn, (uint8_t *)inbuf, unread_bytes, encrypted, seqnum)) { exit_server_cleanly("Invalid SMB request"); } @@ -1969,12 +1969,12 @@ const char *smb_fn_name(int type) Helper functions for contruct_reply. ****************************************************************************/ -void add_to_common_flags2(uint32 v) +void add_to_common_flags2(uint32_t v) { common_flags2 |= v; } -void remove_from_common_flags2(uint32 v) +void remove_from_common_flags2(uint32_t v) { common_flags2 &= ~v; } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 09a7371d44c..531b58dc0a6 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -182,17 +182,17 @@ uint64_t get_dfree_info(connection_struct *conn, bool init_dptrs(struct smbd_server_connection *sconn); const char *dptr_path(struct smbd_server_connection *sconn, int key); const char *dptr_wcard(struct smbd_server_connection *sconn, int key); -uint16 dptr_attr(struct smbd_server_connection *sconn, int key); +uint16_t dptr_attr(struct smbd_server_connection *sconn, int key); void dptr_close(struct smbd_server_connection *sconn, int *key); void dptr_closecnum(connection_struct *conn); void dptr_idlecnum(connection_struct *conn); void dptr_closepath(struct smbd_server_connection *sconn, - char *path,uint16 spid); + char *path,uint16_t spid); NTSTATUS dptr_create(connection_struct *conn, struct smb_request *req, files_struct *fsp, - const char *path, bool old_handle, bool expect_close,uint16 spid, - const char *wcard, bool wcard_has_wild, uint32 attr, struct dptr_struct **dptr_ret); + const char *path, bool old_handle, bool expect_close,uint16_t spid, + const char *wcard, bool wcard_has_wild, uint32_t attr, struct dptr_struct **dptr_ret); void dptr_CloseDir(files_struct *fsp); void dptr_SeekDir(struct dptr_struct *dptr, long offset); long dptr_TellDir(struct dptr_struct *dptr); @@ -211,16 +211,16 @@ struct dptr_struct *dptr_fetch_lanman2(struct smbd_server_connection *sconn, bool get_dir_entry(TALLOC_CTX *ctx, struct dptr_struct *dirptr, const char *mask, - uint32 dirtype, + uint32_t dirtype, char **pp_fname_out, off_t *size, - uint32 *mode, + uint32_t *mode, struct timespec *date, bool check_descend, bool ask_sharemode); bool is_visible_file(connection_struct *conn, const char *dir_path, const char *name, SMB_STRUCT_STAT *pst, bool use_veto); struct smb_Dir *OpenDir(TALLOC_CTX *mem_ctx, connection_struct *conn, - const char *name, const char *mask, uint32 attr); + const char *name, const char *mask, uint32_t attr); const char *ReadDirName(struct smb_Dir *dirp, long *poffset, SMB_STRUCT_STAT *sbuf, char **talloced); void RewindDir(struct smb_Dir *dirp, long *poffset); @@ -236,7 +236,7 @@ const void *dmapi_get_current_session(void); bool dmapi_have_session(void); bool dmapi_new_session(void); bool dmapi_destroy_session(void); -uint32 dmapi_file_flags(const char * const path); +uint32_t dmapi_file_flags(const char * const path); /* The following definitions come from smbd/dnsregister.c */ @@ -249,12 +249,12 @@ bool smbd_setup_mdns_registration(struct tevent_context *ev, mode_t unix_mode(connection_struct *conn, int dosmode, const struct smb_filename *smb_fname, const char *inherit_from_dir); -uint32 dos_mode_msdfs(connection_struct *conn, +uint32_t dos_mode_msdfs(connection_struct *conn, const struct smb_filename *smb_fname); int dos_attributes_to_stat_dos_flags(uint32_t dosmode); -uint32 dos_mode(connection_struct *conn, struct smb_filename *smb_fname); +uint32_t dos_mode(connection_struct *conn, struct smb_filename *smb_fname); int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, - uint32 dosmode, const char *parent_dir, bool newfile); + uint32_t dosmode, const char *parent_dir, bool newfile); NTSTATUS file_set_sparse(connection_struct *conn, struct files_struct *fsp, bool sparse); @@ -279,13 +279,13 @@ struct timespec get_change_timespec(connection_struct *conn, /* The following definitions come from smbd/error.c */ bool use_nt_status(void); -void error_packet_set(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file); -int error_packet(char *outbuf, uint8 eclass, uint32 ecode, NTSTATUS ntstatus, int line, const char *file); +void error_packet_set(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file); +int error_packet(char *outbuf, uint8_t eclass, uint32_t ecode, NTSTATUS ntstatus, int line, const char *file); void reply_nt_error(struct smb_request *req, NTSTATUS ntstatus, int line, const char *file); -void reply_force_dos_error(struct smb_request *req, uint8 eclass, uint32 ecode, +void reply_force_dos_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, int line, const char *file); -void reply_both_error(struct smb_request *req, uint8 eclass, uint32 ecode, +void reply_both_error(struct smb_request *req, uint8_t eclass, uint32_t ecode, NTSTATUS status, int line, const char *file); void reply_openerror(struct smb_request *req, NTSTATUS status); @@ -296,7 +296,7 @@ bool can_delete_file_in_directory(connection_struct *conn, bool can_write_to_file(connection_struct *conn, const struct smb_filename *smb_fname); bool directory_has_default_acl(connection_struct *conn, const char *fname); -NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32 dosmode); +NTSTATUS can_set_delete_on_close(files_struct *fsp, uint32_t dosmode); /* The following definitions come from smbd/fileio.c */ @@ -352,7 +352,7 @@ NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx, NTSTATUS file_new(struct smb_request *req, connection_struct *conn, files_struct **result); void file_close_conn(connection_struct *conn); -void file_close_pid(struct smbd_server_connection *sconn, uint16 smbpid, +void file_close_pid(struct smbd_server_connection *sconn, uint16_t smbpid, uint64_t vuid); bool file_init_global(void); bool file_init(struct smbd_server_connection *sconn); @@ -375,7 +375,7 @@ bool file_find_subpath(files_struct *dir_fsp); void file_sync_all(connection_struct *conn); void fsp_free(files_struct *fsp); void file_free(struct smb_request *req, files_struct *fsp); -files_struct *file_fsp(struct smb_request *req, uint16 fid); +files_struct *file_fsp(struct smb_request *req, uint16_t fid); struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req, uint64_t persistent_id, uint64_t volatile_id); @@ -383,8 +383,8 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req, uint64_t persistent_id, uint64_t volatile_id); NTSTATUS dup_file_fsp(struct smb_request *req, files_struct *from, - uint32 access_mask, uint32 share_access, - uint32 create_options, files_struct *to); + uint32_t access_mask, uint32_t share_access, + uint32_t create_options, files_struct *to); NTSTATUS file_name_hash(connection_struct *conn, const char *name, uint32_t *p_name_hash); NTSTATUS fsp_set_smb_fname(struct files_struct *fsp, @@ -508,11 +508,11 @@ void change_notify_reply(struct smb_request *req, void (*reply_fn)(struct smb_request *req, NTSTATUS error_code, uint8_t *buf, size_t len)); -NTSTATUS change_notify_create(struct files_struct *fsp, uint32 filter, +NTSTATUS change_notify_create(struct files_struct *fsp, uint32_t filter, bool recursive); NTSTATUS change_notify_add_request(struct smb_request *req, - uint32 max_param, - uint32 filter, bool recursive, + uint32_t max_param, + uint32_t filter, bool recursive, struct files_struct *fsp, void (*reply_fn)(struct smb_request *req, NTSTATUS error_code, @@ -524,9 +524,9 @@ void remove_pending_change_notify_requests_by_mid( struct smbd_server_connection *sconn, uint64_t mid); void remove_pending_change_notify_requests_by_fid(files_struct *fsp, NTSTATUS status); -void notify_fname(connection_struct *conn, uint32 action, uint32 filter, +void notify_fname(connection_struct *conn, uint32_t action, uint32_t filter, const char *path); -char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32 filter); +char *notify_filter_string(TALLOC_CTX *mem_ctx, uint32_t filter); struct sys_notify_context *sys_notify_context_create(TALLOC_CTX *mem_ctx, struct tevent_context *ev); @@ -618,7 +618,7 @@ NTSTATUS change_dir_owner_to_parent(connection_struct *conn, const char *inherit_from_dir, const char *fname, SMB_STRUCT_STAT *psbuf); -bool is_stat_open(uint32 access_mask); +bool is_stat_open(uint32_t access_mask); NTSTATUS send_break_message(struct messaging_context *msg_ctx, const struct share_mode_entry *exclusive, uint16_t break_to); @@ -731,7 +731,7 @@ uint32_t map_canon_ace_perms(int snum, enum security_ace_type *pacl_type, mode_t perms, bool directory_ace); -NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const struct security_descriptor *psd); +NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32_t security_info_sent, const struct security_descriptor *psd); bool current_user_in_group(connection_struct *conn, gid_t gid); SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl); NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, @@ -742,7 +742,7 @@ NTSTATUS posix_get_nt_acl(struct connection_struct *conn, const char *name, TALLOC_CTX *mem_ctx, struct security_descriptor **ppdesc); NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid); -NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd); +NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd); int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode ); int chmod_acl(connection_struct *conn, const char *name, mode_t mode); int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_dir, @@ -750,10 +750,10 @@ int inherit_access_posix_acl(connection_struct *conn, const char *inherit_from_d int fchmod_acl(files_struct *fsp, mode_t mode); bool set_unix_posix_default_acl(connection_struct *conn, const char *fname, const SMB_STRUCT_STAT *psbuf, - uint16 num_def_acls, const char *pdata); -bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16 num_acls, const char *pdata); + uint16_t num_def_acls, const char *pdata); +bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *fname, uint16_t num_acls, const char *pdata); NTSTATUS get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname, - uint32 security_info_wanted, + uint32_t security_info_wanted, struct security_descriptor **sd); NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx, const char *name, @@ -796,11 +796,11 @@ bool push_deferred_open_message_smb(struct smb_request *req, struct file_id id, struct deferred_open_record *open_rec); NTSTATUS allow_new_trans(struct trans_state *list, uint64_t mid); -void reply_outbuf(struct smb_request *req, uint8 num_words, uint32 num_bytes); +void reply_outbuf(struct smb_request *req, uint8_t num_words, uint32_t num_bytes); void smb_request_done(struct smb_request *req); const char *smb_fn_name(int type); -void add_to_common_flags2(uint32 v); -void remove_from_common_flags2(uint32 v); +void add_to_common_flags2(uint32_t v); +void remove_from_common_flags2(uint32_t v); void construct_reply_common_req(struct smb_request *req, char *outbuf); bool smb1_is_chain(const uint8_t *buf); bool smb1_walk_chain(const uint8_t *buf, @@ -833,7 +833,7 @@ NTSTATUS check_path_syntax_wcard(char *path, bool *p_contains_wcard); NTSTATUS check_path_syntax_posix(char *path); size_t srvstr_get_path_wcard(TALLOC_CTX *ctx, const char *inbuf, - uint16 smb_flags2, + uint16_t smb_flags2, char **pp_dest, const char *src, size_t src_len, @@ -842,7 +842,7 @@ size_t srvstr_get_path_wcard(TALLOC_CTX *ctx, bool *contains_wcard); size_t srvstr_get_path(TALLOC_CTX *ctx, const char *inbuf, - uint16 smb_flags2, + uint16_t smb_flags2, char **pp_dest, const char *src, size_t src_len, @@ -865,7 +865,7 @@ bool check_fsp_ntquota_handle(connection_struct *conn, struct smb_request *req, void reply_special(struct smbXsrv_connection *xconn, char *inbuf, size_t inbuf_size); void reply_tcon(struct smb_request *req); void reply_tcon_and_X(struct smb_request *req); -void reply_unknown_new(struct smb_request *req, uint8 type); +void reply_unknown_new(struct smb_request *req, uint8_t type); void reply_ioctl(struct smb_request *req); void reply_checkpath(struct smb_request *req); void reply_getatr(struct smb_request *req); @@ -879,7 +879,7 @@ void reply_ulogoffX(struct smb_request *req); void reply_mknew(struct smb_request *req); void reply_ctemp(struct smb_request *req); NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req, - uint32 dirtype, struct smb_filename *smb_fname, + uint32_t dirtype, struct smb_filename *smb_fname, bool has_wild); void reply_unlink(struct smb_request *req); ssize_t fake_sendfile(struct smbXsrv_connection *xconn, files_struct *fsp, @@ -918,14 +918,14 @@ void reply_rmdir(struct smb_request *req); NTSTATUS rename_internals_fsp(connection_struct *conn, files_struct *fsp, const struct smb_filename *smb_fname_dst_in, - uint32 attrs, + uint32_t attrs, bool replace_if_exists); NTSTATUS rename_internals(TALLOC_CTX *ctx, connection_struct *conn, struct smb_request *req, struct smb_filename *smb_fname_src, struct smb_filename *smb_fname_dst, - uint32 attrs, + uint32_t attrs, bool replace_if_exists, bool src_has_wild, bool dest_has_wild, @@ -997,7 +997,7 @@ void smbd_exit_server_cleanly(const char *const reason) _NORETURN_; bool set_conn_connectpath(connection_struct *conn, const char *connectpath); NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum); -bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir); +bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir); void load_registry_shares(void); int add_home_service(const char *service, const char *username, const char *homedir); int find_service(TALLOC_CTX *ctx, const char *service, char **p_service_out); @@ -1044,9 +1044,9 @@ bool is_share_read_only_for_token(const char *username, /* The following definitions come from smbd/srvstr.c */ -NTSTATUS srvstr_push_fn(const char *base_ptr, uint16 smb_flags2, void *dest, +NTSTATUS srvstr_push_fn(const char *base_ptr, uint16_t smb_flags2, void *dest, const char *src, int dest_len, int flags, size_t *ret_len); -ssize_t message_push_string(uint8 **outbuf, const char *str, int flags); +ssize_t message_push_string(uint8_t **outbuf, const char *str, int flags); /* The following definitions come from smbd/statcache.c */ diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index df0f43096e0..8a3170454eb 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -98,7 +98,7 @@ static int set_sys_acl_conn(const char *fname, } static NTSTATUS set_nt_acl_conn(const char *fname, - uint32 security_info_sent, const struct security_descriptor *sd, + uint32_t security_info_sent, const struct security_descriptor *sd, connection_struct *conn) { TALLOC_CTX *frame = talloc_stackframe(); @@ -191,7 +191,7 @@ static NTSTATUS set_nt_acl_conn(const char *fname, static NTSTATUS get_nt_acl_conn(TALLOC_CTX *mem_ctx, const char *fname, connection_struct *conn, - uint32 security_info_wanted, + uint32_t security_info_wanted, struct security_descriptor **sd) { TALLOC_CTX *frame = talloc_stackframe(); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index eff9f53b924..6bda633558e 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1333,7 +1333,7 @@ void reply_getatr(struct smb_request *req) } else { srv_put_dos_date3((char *)req->outbuf,smb_vwv1,mtime); } - SIVAL(req->outbuf,smb_vwv3,(uint32)size); + SIVAL(req->outbuf,smb_vwv3,(uint32_t)size); if (get_Protocol() >= PROTOCOL_NT1) { SSVAL(req->outbuf, smb_flg2, @@ -2067,7 +2067,7 @@ void reply_open(struct smb_request *req) } else { srv_put_dos_date3((char *)req->outbuf,smb_vwv2,mtime); } - SIVAL(req->outbuf,smb_vwv4,(uint32)size); + SIVAL(req->outbuf,smb_vwv4,(uint32_t)size); SSVAL(req->outbuf,smb_vwv6,deny_mode); if (oplock_request && lp_fake_oplocks(SNUM(conn))) { @@ -2286,7 +2286,7 @@ void reply_open_and_X(struct smb_request *req) } else { srv_put_dos_date3((char *)req->outbuf,smb_vwv4,mtime); } - SIVAL(req->outbuf,smb_vwv6,(uint32)fsp->fsp_name->st.st_ex_size); + SIVAL(req->outbuf,smb_vwv6,(uint32_t)fsp->fsp_name->st.st_ex_size); SSVAL(req->outbuf,smb_vwv8,GET_OPENX_MODE(deny_mode)); SSVAL(req->outbuf,smb_vwv11,smb_action); @@ -8392,7 +8392,7 @@ void reply_getattrE(struct smb_request *req) SIVAL(req->outbuf, smb_vwv8, 0); } else { uint32_t allocation_size = SMB_VFS_GET_ALLOC_SIZE(conn,fsp, &fsp->fsp_name->st); - SIVAL(req->outbuf, smb_vwv6, (uint32)fsp->fsp_name->st.st_ex_size); + SIVAL(req->outbuf, smb_vwv6, (uint32_t)fsp->fsp_name->st.st_ex_size); SIVAL(req->outbuf, smb_vwv8, allocation_size); } SSVAL(req->outbuf,smb_vwv10, mode); diff --git a/source3/smbd/server.c b/source3/smbd/server.c index 33f6201125c..18334626d2c 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -1251,7 +1251,7 @@ extern void build_options(bool screen); /* Output the build options to the debug log */ build_options(False); - if (sizeof(uint16) < 2 || sizeof(uint32) < 4) { + if (sizeof(uint16_t) < 2 || sizeof(uint32_t) < 4) { DEBUG(0,("ERROR: Samba is not configured correctly for the word size on your machine\n")); exit(1); } diff --git a/source3/smbd/service.c b/source3/smbd/service.c index d11987e63ee..d1148e1bc40 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -178,7 +178,7 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath) Load parameters specific to a connection/service. ****************************************************************************/ -bool set_current_service(connection_struct *conn, uint16 flags, bool do_chdir) +bool set_current_service(connection_struct *conn, uint16_t flags, bool do_chdir) { int snum; diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index f41f8e32362..d68bcb68cc6 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -42,7 +42,7 @@ Add the standard 'Samba' signature to the end of the session setup. ****************************************************************************/ -static int push_signature(uint8 **outbuf) +static int push_signature(uint8_t **outbuf) { char *lanman; int result, tmp; @@ -119,7 +119,7 @@ static NTSTATUS check_guest_password(const struct tsocket_address *remote_addres static void reply_sesssetup_and_X_spnego(struct smb_request *req) { - const uint8 *p; + const uint8_t *p; DATA_BLOB in_blob; DATA_BLOB out_blob = data_blob_null; size_t bufrem; @@ -127,7 +127,7 @@ static void reply_sesssetup_and_X_spnego(struct smb_request *req) const char *native_os; const char *native_lanman; const char *primary_domain; - uint16 data_blob_len = SVAL(req->vwv+7, 0); + uint16_t data_blob_len = SVAL(req->vwv+7, 0); enum remote_arch_types ra_type = get_remote_arch(); uint64_t vuid = req->vuid; NTSTATUS status = NT_STATUS_OK; @@ -590,7 +590,7 @@ void reply_sesssetup_and_X(struct smb_request *req) const char *primary_domain; struct auth_usersupplied_info *user_info = NULL; struct auth_session_info *session_info = NULL; - uint16 smb_flag2 = req->flags2; + uint16_t smb_flag2 = req->flags2; uint16_t action = 0; NTTIME now = timeval_to_nttime(&req->request_time); struct smbXsrv_session *session = NULL; @@ -652,7 +652,7 @@ void reply_sesssetup_and_X(struct smb_request *req) smb_bufsize = SVAL(req->vwv+2, 0); if (get_Protocol() < PROTOCOL_NT1) { - uint16 passlen1 = SVAL(req->vwv+7, 0); + uint16_t passlen1 = SVAL(req->vwv+7, 0); /* Never do NT status codes with protocols before NT1 as we * don't get client caps. */ @@ -680,12 +680,12 @@ void reply_sesssetup_and_X(struct smb_request *req) domain = ""; } else { - uint16 passlen1 = SVAL(req->vwv+7, 0); - uint16 passlen2 = SVAL(req->vwv+8, 0); + uint16_t passlen1 = SVAL(req->vwv+7, 0); + uint16_t passlen2 = SVAL(req->vwv+8, 0); enum remote_arch_types ra_type = get_remote_arch(); const uint8_t *p = req->buf; const uint8_t *save_p = req->buf; - uint16 byte_count; + uint16_t byte_count; if (!xconn->smb1.sessions.done_sesssetup) { global_client_caps = IVAL(req->vwv+11, 0); diff --git a/source3/smbd/smbd.h b/source3/smbd/smbd.h index 5cf88bf0c69..e147bad3f7c 100644 --- a/source3/smbd/smbd.h +++ b/source3/smbd/smbd.h @@ -40,20 +40,20 @@ struct trans_state { uint64_t vuid; /* SMB2 compat */ uint64_t mid; - uint32 max_param_return; - uint32 max_data_return; - uint32 max_setup_return; + uint32_t max_param_return; + uint32_t max_data_return; + uint32_t max_setup_return; - uint8 cmd; /* SMBtrans or SMBtrans2 */ + uint8_t cmd; /* SMBtrans or SMBtrans2 */ char *name; /* for trans requests */ - uint16 call; /* for trans2 and nttrans requests */ + uint16_t call; /* for trans2 and nttrans requests */ bool close_on_completion; bool one_way; unsigned int setup_count; - uint16 *setup; + uint16_t *setup; size_t received_data; size_t received_param; diff --git a/source3/smbd/srvstr.c b/source3/smbd/srvstr.c index e6a85419b8a..56dceba8c6c 100644 --- a/source3/smbd/srvstr.c +++ b/source3/smbd/srvstr.c @@ -24,7 +24,7 @@ /* Make sure we can't write a string past the end of the buffer */ -NTSTATUS srvstr_push_fn(const char *base_ptr, uint16 smb_flags2, void *dest, +NTSTATUS srvstr_push_fn(const char *base_ptr, uint16_t smb_flags2, void *dest, const char *src, int dest_len, int flags, size_t *ret_len) { size_t len; @@ -81,12 +81,12 @@ NTSTATUS srvstr_push_fn(const char *base_ptr, uint16 smb_flags2, void *dest, Return the bytes added ********************************************************************/ -ssize_t message_push_string(uint8 **outbuf, const char *str, int flags) +ssize_t message_push_string(uint8_t **outbuf, const char *str, int flags) { size_t buf_size = smb_len(*outbuf) + 4; size_t grow_size; size_t result = 0; - uint8 *tmp; + uint8_t *tmp; NTSTATUS status; /* @@ -97,7 +97,7 @@ ssize_t message_push_string(uint8 **outbuf, const char *str, int flags) */ grow_size = (strlen(str) + 2) * 4; - if (!(tmp = talloc_realloc(NULL, *outbuf, uint8, + if (!(tmp = talloc_realloc(NULL, *outbuf, uint8_t, buf_size + grow_size))) { DEBUG(0, ("talloc failed\n")); return -1; diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 1ee72b5db64..7dcbe89fcc7 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1261,7 +1261,7 @@ static void call_trans2open(connection_struct *conn, SSVAL(params,0,fsp->fnum); SSVAL(params,2,fattr); srv_put_dos_date2(params,4, mtime); - SIVAL(params,8, (uint32)size); + SIVAL(params,8, (uint32_t)size); SSVAL(params,12,deny_mode); SSVAL(params,14,0); /* open_type - file or directory. */ SSVAL(params,16,0); /* open_state - only valid for IPC device. */ @@ -1478,7 +1478,7 @@ static bool smbd_dirptr_lanman2_match_fn(TALLOC_CTX *ctx, size_t ret_len = 0; size_t len = (strlen(dname) + 2) * 4; /* Allow enough space. */ uint8_t *tmp = talloc_array(talloc_tos(), - uint8, + uint8_t, len); status = srvstr_push(NULL, @@ -1705,8 +1705,8 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, srv_put_dos_date2(p,0,create_date); srv_put_dos_date2(p,4,adate); srv_put_dos_date2(p,8,mdate); - SIVAL(p,12,(uint32)file_size); - SIVAL(p,16,(uint32)allocation_size); + SIVAL(p,12,(uint32_t)file_size); + SIVAL(p,16,(uint32_t)allocation_size); SSVAL(p,20,mode); p += 23; nameptr = p; @@ -1744,8 +1744,8 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, srv_put_dos_date2(p,0,create_date); srv_put_dos_date2(p,4,adate); srv_put_dos_date2(p,8,mdate); - SIVAL(p,12,(uint32)file_size); - SIVAL(p,16,(uint32)allocation_size); + SIVAL(p,12,(uint32_t)file_size); + SIVAL(p,16,(uint32_t)allocation_size); SSVAL(p,20,mode); { unsigned int ea_size = estimate_ea_size(conn, NULL, @@ -1794,8 +1794,8 @@ static NTSTATUS smbd_marshall_dir_entry(TALLOC_CTX *ctx, srv_put_dos_date2(p,0,create_date); srv_put_dos_date2(p,4,adate); srv_put_dos_date2(p,8,mdate); - SIVAL(p,12,(uint32)file_size); - SIVAL(p,16,(uint32)allocation_size); + SIVAL(p,12,(uint32_t)file_size); + SIVAL(p,16,(uint32_t)allocation_size); SSVAL(p,20,mode); p += 22; /* p now points to the EA area. */ @@ -4727,8 +4727,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, srv_put_dos_date2(pdata,l1_fdateCreation,create_time); srv_put_dos_date2(pdata,l1_fdateLastAccess,atime); srv_put_dos_date2(pdata,l1_fdateLastWrite,mtime); /* write time */ - SIVAL(pdata,l1_cbFile,(uint32)file_size); - SIVAL(pdata,l1_cbFileAlloc,(uint32)allocation_size); + SIVAL(pdata,l1_cbFile,(uint32_t)file_size); + SIVAL(pdata,l1_cbFileAlloc,(uint32_t)allocation_size); SSVAL(pdata,l1_attrFile,mode); break; @@ -4742,8 +4742,8 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn, srv_put_dos_date2(pdata,0,create_time); srv_put_dos_date2(pdata,4,atime); srv_put_dos_date2(pdata,8,mtime); /* write time */ - SIVAL(pdata,12,(uint32)file_size); - SIVAL(pdata,16,(uint32)allocation_size); + SIVAL(pdata,12,(uint32_t)file_size); + SIVAL(pdata,16,(uint32_t)allocation_size); SSVAL(pdata,20,mode); SIVAL(pdata,22,ea_size); break; @@ -7561,7 +7561,7 @@ static NTSTATUS smb_posix_mkdir(connection_struct *conn, return status; } - mod_unixmode = (uint32)unixmode | FILE_FLAG_POSIX_SEMANTICS; + mod_unixmode = (uint32_t)unixmode | FILE_FLAG_POSIX_SEMANTICS; DEBUG(10,("smb_posix_mkdir: file %s, mode 0%o\n", smb_fname_str_dbg(smb_fname), (unsigned int)unixmode)); @@ -7773,7 +7773,7 @@ static NTSTATUS smb_posix_open(connection_struct *conn, return status; } - mod_unixmode = (uint32)unixmode | FILE_FLAG_POSIX_SEMANTICS; + mod_unixmode = (uint32_t)unixmode | FILE_FLAG_POSIX_SEMANTICS; if (wire_open_mode & SMB_O_SYNC) { create_options |= FILE_WRITE_THROUGH; -- 2.11.4.GIT