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;
}
* 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;
* 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 {
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",
{
int fd;
char pidstr[20];
- uint_t ret;
+ pid_t ret;
char *pidFile;
asprintf(&pidFile, "%s/%s.pid", lp_piddir(), name);
goto noproc;
}
- ret = atoi(pidstr);
+ ret = (pid_t)atoi(pidstr);
- if (!process_exists((pid_t)ret)) {
+ if (!process_exists(ret)) {
goto noproc;
}
close(fd);
SAFE_FREE(pidFile);
- return (pid_t)ret;
+ return ret;
noproc:
close(fd);
}
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)));
Sleep for a specified number of milliseconds.
**/
-_PUBLIC_ void msleep(uint_t t)
+_PUBLIC_ void msleep(unsigned int t)
{
struct timeval tval;
* 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;
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;
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;
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;
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;
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;
*/
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;
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;
/* 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
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;
/*
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 ||
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
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)) { \
@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
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
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;
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;
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;
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;