summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/blocking.c24
-rw-r--r--source3/smbd/dfree.c34
-rw-r--r--source3/smbd/noquotas.c6
-rw-r--r--source3/smbd/ntquotas.c26
-rw-r--r--source3/smbd/nttrans.c50
-rw-r--r--source3/smbd/open.c6
-rw-r--r--source3/smbd/process.c2
-rw-r--r--source3/smbd/quotas.c106
-rw-r--r--source3/smbd/reply.c92
-rw-r--r--source3/smbd/statvfs.c2
-rw-r--r--source3/smbd/trans2.c114
-rw-r--r--source3/smbd/vfs.c12
12 files changed, 237 insertions, 237 deletions
diff --git a/source3/smbd/blocking.c b/source3/smbd/blocking.c
index 9b9aa1697e..4374b50eac 100644
--- a/source3/smbd/blocking.c
+++ b/source3/smbd/blocking.c
@@ -33,10 +33,10 @@ typedef struct _blocking_lock_record {
files_struct *fsp;
struct timeval expire_time;
int lock_num;
- SMB_BIG_UINT offset;
- SMB_BIG_UINT count;
- uint32 lock_pid;
- uint32 blocking_pid; /* PID that blocks us. */
+ uint64_t offset;
+ uint64_t count;
+ uint32_t lock_pid;
+ uint32_t blocking_pid; /* PID that blocks us. */
enum brl_flavour lock_flav;
enum brl_type lock_type;
char *inbuf;
@@ -154,12 +154,12 @@ bool push_blocking_lock_request( struct byte_range_lock *br_lck,
files_struct *fsp,
int lock_timeout,
int lock_num,
- uint32 lock_pid,
+ uint32_t lock_pid,
enum brl_type lock_type,
enum brl_flavour lock_flav,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
- uint32 blocking_pid)
+ uint64_t offset,
+ uint64_t count,
+ uint32_t blocking_pid)
{
static bool set_lock_msg;
size_t length = smb_len(req->inbuf)+4;
@@ -331,7 +331,7 @@ static void reply_lockingX_error(blocking_lock_record *blr, NTSTATUS status)
char *inbuf = blr->inbuf;
files_struct *fsp = blr->fsp;
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
- SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT) 0;
+ uint64_t count = (uint64_t)0, offset = (uint64_t) 0;
uint32 lock_pid;
unsigned char locktype = CVAL(inbuf,smb_vwv3);
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
@@ -420,7 +420,7 @@ static bool process_lockingX(blocking_lock_record *blr)
files_struct *fsp = blr->fsp;
uint16 num_ulocks = SVAL(inbuf,smb_vwv6);
uint16 num_locks = SVAL(inbuf,smb_vwv7);
- SMB_BIG_UINT count = (SMB_BIG_UINT)0, offset = (SMB_BIG_UINT)0;
+ uint64_t count = (uint64_t)0, offset = (uint64_t)0;
uint32 lock_pid;
bool large_file_format = (locktype & LOCKING_ANDX_LARGE_FILES);
char *data;
@@ -874,8 +874,8 @@ static void process_blocking_lock_cancel_message(struct messaging_context *ctx,
bool blocking_lock_cancel(files_struct *fsp,
uint32 lock_pid,
- SMB_BIG_UINT offset,
- SMB_BIG_UINT count,
+ uint64_t offset,
+ uint64_t count,
enum brl_flavour lock_flav,
unsigned char locktype,
NTSTATUS err)
diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c
index 282027ee5a..cd09d73923 100644
--- a/source3/smbd/dfree.c
+++ b/source3/smbd/dfree.c
@@ -23,10 +23,10 @@
Normalise for DOS usage.
****************************************************************************/
-static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+static void disk_norm(bool small_query, uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
/* check if the disk is beyond the max disk size */
- SMB_BIG_UINT maxdisksize = lp_maxdisksize();
+ uint64_t maxdisksize = lp_maxdisksize();
if (maxdisksize) {
/* convert to blocks - and don't overflow */
maxdisksize = ((maxdisksize*1024)/(*bsize))*1024;
@@ -62,13 +62,13 @@ static void disk_norm(bool small_query, SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,
Return number of 1K blocks available on a path and total number.
****************************************************************************/
-SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small_query,
- SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+uint64_t sys_disk_free(connection_struct *conn, const char *path, bool small_query,
+ uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
- SMB_BIG_UINT dfree_retval;
- SMB_BIG_UINT dfree_q = 0;
- SMB_BIG_UINT bsize_q = 0;
- SMB_BIG_UINT dsize_q = 0;
+ uint64_t dfree_retval;
+ uint64_t dfree_q = 0;
+ uint64_t bsize_q = 0;
+ uint64_t dsize_q = 0;
const char *dfree_command;
(*dfree) = (*dsize) = 0;
@@ -90,7 +90,7 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
path);
if (!syscmd) {
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
DEBUG (3, ("disk_free: Running command %s\n", syscmd));
@@ -126,14 +126,14 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
if (sys_fsusage(path, dfree, dsize) != 0) {
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
strerror(errno) ));
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
}
} else {
if (sys_fsusage(path, dfree, dsize) != 0) {
DEBUG (0, ("disk_free: sys_fsusage() failed. Error was : %s\n",
strerror(errno) ));
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
}
@@ -174,16 +174,16 @@ SMB_BIG_UINT sys_disk_free(connection_struct *conn, const char *path, bool small
Potentially returned cached dfree info.
****************************************************************************/
-SMB_BIG_UINT get_dfree_info(connection_struct *conn,
+uint64_t get_dfree_info(connection_struct *conn,
const char *path,
bool small_query,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize)
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize)
{
int dfree_cache_time = lp_dfree_cache_time(SNUM(conn));
struct dfree_cached_info *dfc = conn->dfree_info;
- SMB_BIG_UINT dfree_ret;
+ uint64_t dfree_ret;
if (!dfree_cache_time) {
return SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
@@ -199,7 +199,7 @@ SMB_BIG_UINT get_dfree_info(connection_struct *conn,
dfree_ret = SMB_VFS_DISK_FREE(conn,path,small_query,bsize,dfree,dsize);
- if (dfree_ret == (SMB_BIG_UINT)-1) {
+ if (dfree_ret == (uint64_t)-1) {
/* Don't cache bad data. */
return dfree_ret;
}
diff --git a/source3/smbd/noquotas.c b/source3/smbd/noquotas.c
index c8ff8edf62..392b32437a 100644
--- a/source3/smbd/noquotas.c
+++ b/source3/smbd/noquotas.c
@@ -23,14 +23,14 @@
* Needed for auto generation of proto.h.
*/
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
(*bsize) = 512; /* This value should be ignored */
/* And just to be sure we set some values that hopefully */
/* will be larger that any possible real-world value */
- (*dfree) = (SMB_BIG_UINT)-1;
- (*dsize) = (SMB_BIG_UINT)-1;
+ (*dfree) = (uint64_t)-1;
+ (*dsize) = (uint64_t)-1;
/* As we have select not to use quotas, allways fail */
return False;
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c
index c616c494dc..ae7034011e 100644
--- a/source3/smbd/ntquotas.c
+++ b/source3/smbd/ntquotas.c
@@ -22,14 +22,14 @@
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_QUOTA
-static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
+static uint64_t limit_nt2unix(uint64_t in, uint64_t bsize)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in/bsize);
+ ret = (uint64_t)(in/bsize);
if (in>0 && ret==0) {
/* we have to make sure that a overflow didn't set NO_LIMIT */
- ret = (SMB_BIG_UINT)1;
+ ret = (uint64_t)1;
}
if (in == SMB_NTQUOTAS_NO_LIMIT)
@@ -42,11 +42,11 @@ static SMB_BIG_UINT limit_nt2unix(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
return ret;
}
-static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
+static uint64_t limit_unix2nt(uint64_t in, uint64_t bsize)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in*bsize);
+ ret = (uint64_t)(in*bsize);
if (ret < in) {
/* we overflow */
@@ -59,14 +59,14 @@ static SMB_BIG_UINT limit_unix2nt(SMB_BIG_UINT in, SMB_BIG_UINT bsize)
return ret;
}
-static SMB_BIG_UINT limit_blk2inodes(SMB_BIG_UINT in)
+static uint64_t limit_blk2inodes(uint64_t in)
{
- SMB_BIG_UINT ret = (SMB_BIG_UINT)0;
+ uint64_t ret = (uint64_t)0;
- ret = (SMB_BIG_UINT)(in/2);
+ ret = (uint64_t)(in/2);
if (ret == 0 && in != 0)
- ret = (SMB_BIG_UINT)1;
+ ret = (uint64_t)1;
return ret;
}
@@ -100,7 +100,7 @@ int vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
return ret;
}
- qt->usedspace = (SMB_BIG_UINT)D.curblocks*D.bsize;
+ qt->usedspace = (uint64_t)D.curblocks*D.bsize;
qt->softlim = limit_unix2nt(D.softlimit, D.bsize);
qt->hardlim = limit_unix2nt(D.hardlimit, D.bsize);
qt->qflags = D.qflags;
@@ -121,7 +121,7 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
id.uid = -1;
- D.bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
+ D.bsize = (uint64_t)QUOTABLOCK_SIZE;
D.softlimit = limit_nt2unix(qt->softlim,D.bsize);
D.hardlimit = limit_nt2unix(qt->hardlim,D.bsize);
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index c5e4dc3dfb..69ddcdae8d 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -386,7 +386,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
uint32 create_disposition;
uint32 create_options;
uint16 root_dir_fid;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
/* Breakout the oplock request bits so we can set the
reply bits separately. */
uint32 fattr=0;
@@ -418,10 +418,10 @@ void reply_ntcreate_and_X(struct smb_request *req)
create_options = IVAL(req->inbuf,smb_ntcreate_CreateOptions);
root_dir_fid = (uint16)IVAL(req->inbuf,smb_ntcreate_RootDirectoryFid);
- allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,
+ allocation_size = (uint64_t)IVAL(req->inbuf,
smb_ntcreate_AllocationSize);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(
+ allocation_size |= (((uint64_t)IVAL(
req->inbuf,
smb_ntcreate_AllocationSize + 4)) << 32);
#endif
@@ -814,7 +814,7 @@ static void call_nt_transact_create(connection_struct *conn,
struct ea_list *ea_list = NULL;
NTSTATUS status;
size_t param_len;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
int oplock_request;
uint8_t oplock_granted;
TALLOC_CTX *ctx = talloc_tos();
@@ -857,9 +857,9 @@ static void call_nt_transact_create(connection_struct *conn,
sd_len = IVAL(params,36);
ea_len = IVAL(params,40);
root_dir_fid = (uint16)IVAL(params,4);
- allocation_size = (SMB_BIG_UINT)IVAL(params,12);
+ allocation_size = (uint64_t)IVAL(params,12);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(params,16)) << 32);
+ allocation_size |= (((uint64_t)IVAL(params,16)) << 32);
#endif
/*
@@ -2127,16 +2127,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
/* then the len of the SID 4 bytes */
SIVAL(entry,4,sid_len);
- /* unknown data 8 bytes SMB_BIG_UINT */
- SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-metze*/
+ /* unknown data 8 bytes uint64_t */
+ SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-metze*/
- /* the used disk space 8 bytes SMB_BIG_UINT */
+ /* the used disk space 8 bytes uint64_t */
SBIG_UINT(entry,16,tmp_list->quotas->usedspace);
- /* the soft quotas 8 bytes SMB_BIG_UINT */
+ /* the soft quotas 8 bytes uint64_t */
SBIG_UINT(entry,24,tmp_list->quotas->softlim);
- /* the hard quotas 8 bytes SMB_BIG_UINT */
+ /* the hard quotas 8 bytes uint64_t */
SBIG_UINT(entry,32,tmp_list->quotas->hardlim);
/* and now the SID */
@@ -2225,16 +2225,16 @@ static void call_nt_transact_get_user_quota(connection_struct *conn,
/* then the len of the SID 4 bytes */
SIVAL(entry,4,sid_len);
- /* unknown data 8 bytes SMB_BIG_UINT */
- SBIG_UINT(entry,8,(SMB_BIG_UINT)0); /* this is not 0 in windows...-mezte*/
+ /* unknown data 8 bytes uint64_t */
+ SBIG_UINT(entry,8,(uint64_t)0); /* this is not 0 in windows...-mezte*/
- /* the used disk space 8 bytes SMB_BIG_UINT */
+ /* the used disk space 8 bytes uint64_t */
SBIG_UINT(entry,16,qt.usedspace);
- /* the soft quotas 8 bytes SMB_BIG_UINT */
+ /* the soft quotas 8 bytes uint64_t */
SBIG_UINT(entry,24,qt.softlim);
- /* the hard quotas 8 bytes SMB_BIG_UINT */
+ /* the hard quotas 8 bytes uint64_t */
SBIG_UINT(entry,32,qt.hardlim);
/* and now the SID */
@@ -2328,10 +2328,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
* maybe its the change time in NTTIME
*/
- /* the used space 8 bytes (SMB_BIG_UINT)*/
- qt.usedspace = (SMB_BIG_UINT)IVAL(pdata,16);
+ /* the used space 8 bytes (uint64_t)*/
+ qt.usedspace = (uint64_t)IVAL(pdata,16);
#ifdef LARGE_SMB_OFF_T
- qt.usedspace |= (((SMB_BIG_UINT)IVAL(pdata,20)) << 32);
+ qt.usedspace |= (((uint64_t)IVAL(pdata,20)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,20) != 0)&&
((qt.usedspace != 0xFFFFFFFF)||
@@ -2342,10 +2342,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
}
#endif /* LARGE_SMB_OFF_T */
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- qt.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ qt.softlim = (uint64_t)IVAL(pdata,24);
#ifdef LARGE_SMB_OFF_T
- qt.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
+ qt.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,28) != 0)&&
((qt.softlim != 0xFFFFFFFF)||
@@ -2356,10 +2356,10 @@ static void call_nt_transact_set_user_quota(connection_struct *conn,
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- qt.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ qt.hardlim = (uint64_t)IVAL(pdata,32);
#ifdef LARGE_SMB_OFF_T
- qt.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
+ qt.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,36) != 0)&&
((qt.hardlim != 0xFFFFFFFF)||
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 209ad4d587..d858fb969f 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2533,7 +2533,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
@@ -2809,7 +2809,7 @@ NTSTATUS create_file_unixpath(connection_struct *conn,
}
} else {
fsp->initial_allocation_size = smb_roundup(
- fsp->conn, (SMB_BIG_UINT)sbuf.st_size);
+ fsp->conn, (uint64_t)sbuf.st_size);
}
}
@@ -2863,7 +2863,7 @@ NTSTATUS create_file(connection_struct *conn,
uint32_t create_options,
uint32_t file_attributes,
uint32_t oplock_request,
- SMB_BIG_UINT allocation_size,
+ uint64_t allocation_size,
struct security_descriptor *sd,
struct ea_list *ea_list,
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index ba3b45d522..ceffd6f46c 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -743,7 +743,7 @@ static NTSTATUS receive_message_or_smb(TALLOC_CTX *mem_ctx, char **buffer,
pop_message = True;
} else {
struct timeval tv;
- SMB_BIG_INT tdif;
+ int64_t tdif;
GetTimeOfDay(&tv);
tdif = usec_time_diff(&msg->end_time, &tv);
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index b6f748da33..3aa4652508 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -45,7 +45,7 @@
* Declare here, define at end: reduces likely "include" interaction problems.
* David Lee <T.D.Lee@durham.ac.uk>
*/
-bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize);
#endif /* VXFS_QUOTA */
@@ -63,13 +63,13 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
#include "samba_linux_quota.h"
typedef struct _LINUX_SMB_DISK_QUOTA {
- SMB_BIG_UINT bsize;
- SMB_BIG_UINT hardlimit; /* In bsize units. */
- SMB_BIG_UINT softlimit; /* In bsize units. */
- SMB_BIG_UINT curblocks; /* In bsize units. */
- SMB_BIG_UINT ihardlimit; /* inode hard limit. */
- SMB_BIG_UINT isoftlimit; /* inode soft limit. */
- SMB_BIG_UINT curinodes; /* Current used inodes. */
+ uint64_t bsize;
+ uint64_t hardlimit; /* In bsize units. */
+ uint64_t softlimit; /* In bsize units. */
+ uint64_t curblocks; /* In bsize units. */
+ uint64_t ihardlimit; /* inode hard limit. */
+ uint64_t isoftlimit; /* inode soft limit. */
+ uint64_t curinodes; /* Current used inodes. */
} LINUX_SMB_DISK_QUOTA;
@@ -95,13 +95,13 @@ static int get_smb_linux_xfs_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
if (ret)
return ret;
- dp->bsize = (SMB_BIG_UINT)512;
- dp->softlimit = (SMB_BIG_UINT)D.d_blk_softlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.d_blk_hardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.d_ino_hardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.d_ino_softlimit;
- dp->curinodes = (SMB_BIG_UINT)D.d_icount;
- dp->curblocks = (SMB_BIG_UINT)D.d_bcount;
+ dp->bsize = (uint64_t)512;
+ dp->softlimit = (uint64_t)D.d_blk_softlimit;
+ dp->hardlimit = (uint64_t)D.d_blk_hardlimit;
+ dp->ihardlimit = (uint64_t)D.d_ino_hardlimit;
+ dp->isoftlimit = (uint64_t)D.d_ino_softlimit;
+ dp->curinodes = (uint64_t)D.d_icount;
+ dp->curblocks = (uint64_t)D.d_bcount;
return ret;
}
@@ -134,13 +134,13 @@ static int get_smb_linux_v1_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = (SMB_BIG_UINT)D.dqb_curblocks;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = (uint64_t)D.dqb_curblocks;
return ret;
}
@@ -160,13 +160,13 @@ static int get_smb_linux_v2_quota(char *path, uid_t euser_id, gid_t egrp_id, LIN
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
return ret;
}
@@ -190,13 +190,13 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
if (ret && errno != EDQUOT)
return ret;
- dp->bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
- dp->softlimit = (SMB_BIG_UINT)D.dqb_bsoftlimit;
- dp->hardlimit = (SMB_BIG_UINT)D.dqb_bhardlimit;
- dp->ihardlimit = (SMB_BIG_UINT)D.dqb_ihardlimit;
- dp->isoftlimit = (SMB_BIG_UINT)D.dqb_isoftlimit;
- dp->curinodes = (SMB_BIG_UINT)D.dqb_curinodes;
- dp->curblocks = ((SMB_BIG_UINT)D.dqb_curspace) / dp->bsize;
+ dp->bsize = (uint64_t)QUOTABLOCK_SIZE;
+ dp->softlimit = (uint64_t)D.dqb_bsoftlimit;
+ dp->hardlimit = (uint64_t)D.dqb_bhardlimit;
+ dp->ihardlimit = (uint64_t)D.dqb_ihardlimit;
+ dp->isoftlimit = (uint64_t)D.dqb_isoftlimit;
+ dp->curinodes = (uint64_t)D.dqb_curinodes;
+ dp->curblocks = ((uint64_t)D.dqb_curspace) / dp->bsize;
return ret;
}
@@ -205,7 +205,7 @@ static int get_smb_linux_gen_quota(char *path, uid_t euser_id, gid_t egrp_id, LI
Try to get the disk space from disk quotas (LINUX version).
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r;
SMB_STRUCT_STAT S;
@@ -306,7 +306,7 @@ bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB
try to get the disk space from disk quotas (CRAY VERSION)
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
struct mntent *mnt;
FILE *fd;
@@ -454,7 +454,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Restricted to SUNOS5 for the moment, I haven`t access to others to test. */
-static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -468,7 +468,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
enum clnt_stat clnt_stat;
bool ret = True;
- *bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
+ *bsize = *dfree = *dsize = (uint64_t)0;
len=strcspn(mnttype, ":");
pathname=strstr(mnttype, ":");
@@ -575,9 +575,9 @@ Quota code by Peter Urbanec (amiga@cse.unsw.edu.au).
****************************************************************************/
bool disk_quotas(const char *path,
- SMB_BIG_UINT *bsize,
- SMB_BIG_UINT *dfree,
- SMB_BIG_UINT *dsize)
+ uint64_t *bsize,
+ uint64_t *dfree,
+ uint64_t *dsize)
{
uid_t euser_id;
int ret;
@@ -750,7 +750,7 @@ bool disk_quotas(const char *path,
try to get the disk space from disk quotas - OSF1 version
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r, save_errno;
struct dqblk D;
@@ -816,7 +816,7 @@ try to get the disk space from disk quotas (IRIX 6.2 version)
#include <sys/quota.h>
#include <mntent.h>
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t euser_id;
int r;
@@ -1009,7 +1009,7 @@ static int my_xdr_getquota_rslt(XDR *xdrsp, struct getquota_rslt *gqr)
}
/* Works on FreeBSD, too. :-) */
-static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t uid = euser_id;
struct dqblk D;
@@ -1023,7 +1023,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
enum clnt_stat clnt_stat;
bool ret = True;
- *bsize = *dfree = *dsize = (SMB_BIG_UINT)0;
+ *bsize = *dfree = *dsize = (uint64_t)0;
len=strcspn(mnttype, ":");
pathname=strstr(mnttype, ":");
@@ -1134,7 +1134,7 @@ static bool nfs_quotas(char *nfspath, uid_t euser_id, SMB_BIG_UINT *bsize, SMB_B
try to get the disk space from disk quotas - default version
****************************************************************************/
-bool disk_quotas(const char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
int r;
struct dqblk D;
@@ -1353,7 +1353,7 @@ Hints for porting:
#include <sys/fs/vx_aioctl.h>
#include <sys/fs/vx_ioctl.h>
-bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize, uint64_t *dfree, uint64_t *dsize)
{
uid_t user_id, euser_id;
int ret;
@@ -1437,14 +1437,14 @@ bool disk_quotas_vxfs(const char *name, char *path, SMB_BIG_UINT *bsize, SMB_BIG
#else /* WITH_QUOTAS */
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
(*bsize) = 512; /* This value should be ignored */
/* And just to be sure we set some values that hopefully */
/* will be larger that any possible real-world value */
- (*dfree) = (SMB_BIG_UINT)-1;
- (*dsize) = (SMB_BIG_UINT)-1;
+ (*dfree) = (uint64_t)-1;
+ (*dsize) = (uint64_t)-1;
/* As we have select not to use quotas, allways fail */
return false;
@@ -1455,7 +1455,7 @@ bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BI
/* wrapper to the new sys_quota interface
this file should be removed later
*/
-bool disk_quotas(const char *path,SMB_BIG_UINT *bsize,SMB_BIG_UINT *dfree,SMB_BIG_UINT *dsize)
+bool disk_quotas(const char *path,uint64_t *bsize,uint64_t *dfree,uint64_t *dsize)
{
int r;
SMB_DISK_QUOTA D;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 368fc808e8..9ccfaa7bcb 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1178,10 +1178,10 @@ void reply_setatr(struct smb_request *req)
void reply_dskattr(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT dfree,dsize,bsize;
+ uint64_t dfree,dsize,bsize;
START_PROFILE(SMBdskattr);
- if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",True,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
END_PROFILE(SMBdskattr);
return;
@@ -1200,8 +1200,8 @@ void reply_dskattr(struct smb_request *req)
total_space = dsize * (double)bsize;
free_space = dfree * (double)bsize;
- dsize = (SMB_BIG_UINT)((total_space+63*512) / (64*512));
- dfree = (SMB_BIG_UINT)((free_space+63*512) / (64*512));
+ dsize = (uint64_t)((total_space+63*512) / (64*512));
+ dfree = (uint64_t)((free_space+63*512) / (64*512));
if (dsize > 0xFFFF) dsize = 0xFFFF;
if (dfree > 0xFFFF) dfree = 0xFFFF;
@@ -1744,7 +1744,7 @@ void reply_open_and_X(struct smb_request *req)
int smb_action = 0;
files_struct *fsp;
NTSTATUS status;
- SMB_BIG_UINT allocation_size;
+ uint64_t allocation_size;
ssize_t retval = -1;
uint32 access_mask;
uint32 share_mode;
@@ -1767,7 +1767,7 @@ void reply_open_and_X(struct smb_request *req)
core_oplock_request = CORE_OPLOCK_REQUEST(req->inbuf);
oplock_request = ex_oplock_request | core_oplock_request;
smb_ofun = SVAL(req->inbuf,smb_vwv8);
- allocation_size = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv9);
+ allocation_size = (uint64_t)IVAL(req->inbuf,smb_vwv9);
/* If it's an IPC, pass off the pipe handler. */
if (IS_IPC(conn)) {
@@ -2887,8 +2887,8 @@ void reply_readbraw(struct smb_request *req)
maxcount = MIN(65535,maxcount);
if (is_locked(fsp,(uint32)req->smbpid,
- (SMB_BIG_UINT)maxcount,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)maxcount,
+ (uint64_t)startpos,
READ_LOCK)) {
reply_readbraw_error();
END_PROFILE(SMBreadbraw);
@@ -2985,8 +2985,8 @@ void reply_lockread(struct smb_request *req)
br_lck = do_lock(smbd_messaging_context(),
fsp,
req->smbpid,
- (SMB_BIG_UINT)numtoread,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)numtoread,
+ (uint64_t)startpos,
WRITE_LOCK,
WINDOWS_LOCK,
False, /* Non-blocking lock. */
@@ -3090,8 +3090,8 @@ Returning short read of maximum allowed for compatibility with Windows 2000.\n",
data = smb_buf(req->outbuf) + 3;
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtoread,
- (SMB_BIG_UINT)startpos, READ_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtoread,
+ (uint64_t)startpos, READ_LOCK)) {
reply_doserror(req, ERRDOS,ERRlock);
END_PROFILE(SMBread);
return;
@@ -3377,8 +3377,8 @@ void reply_read_and_X(struct smb_request *req)
}
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)smb_maxcnt,
- (SMB_BIG_UINT)startpos, READ_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)smb_maxcnt,
+ (uint64_t)startpos, READ_LOCK)) {
END_PROFILE(SMBreadX);
reply_doserror(req, ERRDOS, ERRlock);
return;
@@ -3487,8 +3487,8 @@ void reply_writebraw(struct smb_request *req)
return;
}
- if (is_locked(fsp,(uint32)req->smbpid,(SMB_BIG_UINT)tcount,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ if (is_locked(fsp,(uint32)req->smbpid,(uint64_t)tcount,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
error_to_writebrawerr(req);
END_PROFILE(SMBwritebraw);
@@ -3673,8 +3673,8 @@ void reply_writeunlock(struct smb_request *req)
data = smb_buf(req->inbuf) + 3;
if (numtowrite
- && is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ && is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwriteunlock);
return;
@@ -3708,8 +3708,8 @@ void reply_writeunlock(struct smb_request *req)
status = do_unlock(smbd_messaging_context(),
fsp,
req->smbpid,
- (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos,
+ (uint64_t)numtowrite,
+ (uint64_t)startpos,
WINDOWS_LOCK);
if (NT_STATUS_V(status)) {
@@ -3779,8 +3779,8 @@ void reply_write(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->inbuf,smb_vwv2);
data = smb_buf(req->inbuf) + 3;
- if (is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ if (is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwrite);
return;
@@ -4035,8 +4035,8 @@ void reply_write_and_X(struct smb_request *req)
}
if (is_locked(fsp,(uint32)req->smbpid,
- (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS, ERRlock);
END_PROFILE(SMBwriteX);
return;
@@ -4358,8 +4358,8 @@ void reply_writeclose(struct smb_request *req)
data = smb_buf(req->inbuf) + 1;
if (numtowrite
- && is_locked(fsp, (uint32)req->smbpid, (SMB_BIG_UINT)numtowrite,
- (SMB_BIG_UINT)startpos, WRITE_LOCK)) {
+ && is_locked(fsp, (uint32)req->smbpid, (uint64_t)numtowrite,
+ (uint64_t)startpos, WRITE_LOCK)) {
reply_doserror(req, ERRDOS,ERRlock);
END_PROFILE(SMBwriteclose);
return;
@@ -4413,7 +4413,7 @@ void reply_writeclose(struct smb_request *req)
void reply_lock(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT count,offset;
+ uint64_t count,offset;
NTSTATUS status;
files_struct *fsp;
struct byte_range_lock *br_lck = NULL;
@@ -4435,8 +4435,8 @@ void reply_lock(struct smb_request *req)
release_level_2_oplocks_on_change(fsp);
- count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
- offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
+ count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
+ offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
DEBUG(3,("lock fd=%d fnum=%d offset=%.0f count=%.0f\n",
fsp->fh->fd, fsp->fnum, (double)offset, (double)count));
@@ -4473,7 +4473,7 @@ void reply_lock(struct smb_request *req)
void reply_unlock(struct smb_request *req)
{
connection_struct *conn = req->conn;
- SMB_BIG_UINT count,offset;
+ uint64_t count,offset;
NTSTATUS status;
files_struct *fsp;
@@ -4492,8 +4492,8 @@ void reply_unlock(struct smb_request *req)
return;
}
- count = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv1);
- offset = (SMB_BIG_UINT)IVAL(req->inbuf,smb_vwv3);
+ count = (uint64_t)IVAL(req->inbuf,smb_vwv1);
+ offset = (uint64_t)IVAL(req->inbuf,smb_vwv3);
status = do_unlock(smbd_messaging_context(),
fsp,
@@ -6491,17 +6491,17 @@ uint32 get_lock_pid( char *data, int data_offset, bool large_file_format)
Get a lock count, dealing with large count requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format)
+uint64_t get_lock_count( char *data, int data_offset, bool large_file_format)
{
- SMB_BIG_UINT count = 0;
+ uint64_t count = 0;
if(!large_file_format) {
- count = (SMB_BIG_UINT)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
+ count = (uint64_t)IVAL(data,SMB_LKLEN_OFFSET(data_offset));
} else {
#if defined(HAVE_LONGLONG)
- count = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
- ((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
+ count = (((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset))) << 32) |
+ ((uint64_t) IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset)));
#else /* HAVE_LONGLONG */
/*
@@ -6518,7 +6518,7 @@ SMB_BIG_UINT get_lock_count( char *data, int data_offset, bool large_file_format
SIVAL(data,SMB_LARGE_LKLEN_OFFSET_HIGH(data_offset),0);
}
- count = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
+ count = (uint64_t)IVAL(data,SMB_LARGE_LKLEN_OFFSET_LOW(data_offset));
#endif /* HAVE_LONGLONG */
}
@@ -6563,19 +6563,19 @@ static uint32 map_lock_offset(uint32 high, uint32 low)
Get a lock offset, dealing with large offset requests.
****************************************************************************/
-SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
+uint64_t get_lock_offset( char *data, int data_offset, bool large_file_format, bool *err)
{
- SMB_BIG_UINT offset = 0;
+ uint64_t offset = 0;
*err = False;
if(!large_file_format) {
- offset = (SMB_BIG_UINT)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
+ offset = (uint64_t)IVAL(data,SMB_LKOFF_OFFSET(data_offset));
} else {
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
- ((SMB_BIG_UINT) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
+ offset = (((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_HIGH(data_offset))) << 32) |
+ ((uint64_t) IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset)));
#else /* HAVE_LONGLONG */
/*
@@ -6592,7 +6592,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
if((new_low = map_lock_offset(high, low)) == 0) {
*err = True;
- return (SMB_BIG_UINT)-1;
+ return (uint64_t)-1;
}
DEBUG(3,("get_lock_offset: truncating lock offset (high)0x%x (low)0x%x to offset 0x%x.\n",
@@ -6601,7 +6601,7 @@ SMB_BIG_UINT get_lock_offset( char *data, int data_offset, bool large_file_forma
SIVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset),new_low);
}
- offset = (SMB_BIG_UINT)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
+ offset = (uint64_t)IVAL(data,SMB_LARGE_LKOFF_OFFSET_LOW(data_offset));
#endif /* HAVE_LONGLONG */
}
@@ -6620,7 +6620,7 @@ void reply_lockingX(struct smb_request *req)
unsigned char oplocklevel;
uint16 num_ulocks;
uint16 num_locks;
- SMB_BIG_UINT count = 0, offset = 0;
+ uint64_t count = 0, offset = 0;
uint32 lock_pid;
int32 lock_timeout;
int i;
diff --git a/source3/smbd/statvfs.c b/source3/smbd/statvfs.c
index 0e9a2c2ebe..ee33e13a48 100644
--- a/source3/smbd/statvfs.c
+++ b/source3/smbd/statvfs.c
@@ -118,7 +118,7 @@ static int darwin_statvfs(const char *path, vfs_statvfs_struct *statbuf)
statbuf->UserBlocksAvail = sbuf.f_bavail;
statbuf->TotalFileNodes = sbuf.f_files;
statbuf->FreeFileNodes = sbuf.f_ffree;
- statbuf->FsIdentifier = *(SMB_BIG_UINT *)(&sbuf.f_fsid); /* Ick. */
+ statbuf->FsIdentifier = *(uint64_t *)(&sbuf.f_fsid); /* Ick. */
statbuf->FsCapabilities = darwin_fs_capabilities(sbuf.f_mntonname);
return 0;
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 124171ae10..00fee0d34d 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -47,9 +47,9 @@ static char *store_file_unix_basic_info2(connection_struct *conn,
Only do this for Windows clients.
********************************************************************/
-SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
+uint64_t smb_roundup(connection_struct *conn, uint64_t val)
{
- SMB_BIG_UINT rval = lp_allocation_roundup_size(SNUM(conn));
+ uint64_t rval = lp_allocation_roundup_size(SNUM(conn));
/* Only roundup for Windows clients. */
enum remote_arch_types ra_type = get_remote_arch();
@@ -64,18 +64,18 @@ SMB_BIG_UINT smb_roundup(connection_struct *conn, SMB_BIG_UINT val)
account sparse files.
********************************************************************/
-SMB_BIG_UINT get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
+uint64_t get_allocation_size(connection_struct *conn, files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
{
- SMB_BIG_UINT ret;
+ uint64_t ret;
if(S_ISDIR(sbuf->st_mode)) {
return 0;
}
#if defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
- ret = (SMB_BIG_UINT)STAT_ST_BLOCKSIZE * (SMB_BIG_UINT)sbuf->st_blocks;
+ ret = (uint64_t)STAT_ST_BLOCKSIZE * (uint64_t)sbuf->st_blocks;
#else
- ret = (SMB_BIG_UINT)get_file_size(*sbuf);
+ ret = (uint64_t)get_file_size(*sbuf);
#endif
if (fsp && fsp->initial_allocation_size)
@@ -1264,7 +1264,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
long prev_dirpos=0;
uint32 mode=0;
SMB_OFF_T file_size = 0;
- SMB_BIG_UINT allocation_size = 0;
+ uint64_t allocation_size = 0;
uint32 len;
struct timespec mdate_ts, adate_ts, create_date_ts;
time_t mdate = (time_t)0, adate = (time_t)0, create_date = (time_t)0;
@@ -2613,22 +2613,22 @@ static void call_trans2qfsinfo(connection_struct *conn,
switch (info_level) {
case SMB_INFO_ALLOCATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 18;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2733,21 +2733,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi
case SMB_QUERY_FS_SIZE_INFO:
case SMB_FS_SIZE_INFORMATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 24;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2766,21 +2766,21 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
case SMB_FS_FULL_SIZE_INFORMATION:
{
- SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
+ uint64_t dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 32;
- if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ if (get_dfree_info(conn,".",False,&bsize,&dfree,&dsize) == (uint64_t)-1) {
reply_unixerror(req, ERRHRD, ERRgeneral);
return;
}
block_size = lp_block_size(snum);
if (bsize < block_size) {
- SMB_BIG_UINT factor = block_size/bsize;
+ uint64_t factor = block_size/bsize;
bsize = block_size;
dsize /= factor;
dfree /= factor;
}
if (bsize > block_size) {
- SMB_BIG_UINT factor = bsize/block_size;
+ uint64_t factor = bsize/block_size;
bsize = block_size;
dsize *= factor;
dfree *= factor;
@@ -2811,8 +2811,8 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
* what we have to send --metze:
*
* Unknown1: 24 NULL bytes
- * Soft Quota Treshold: 8 bytes seems like SMB_BIG_UINT or so
- * Hard Quota Limit: 8 bytes seems like SMB_BIG_UINT or so
+ * Soft Quota Treshold: 8 bytes seems like uint64_t or so
+ * Hard Quota Limit: 8 bytes seems like uint64_t or so
* Quota Flags: 2 byte :
* Unknown3: 6 NULL bytes
*
@@ -2860,9 +2860,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
DEBUG(10,("SMB_FS_QUOTA_INFORMATION: for service [%s]\n",lp_servicename(SNUM(conn))));
/* Unknown1 24 NULL bytes*/
- SBIG_UINT(pdata,0,(SMB_BIG_UINT)0);
- SBIG_UINT(pdata,8,(SMB_BIG_UINT)0);
- SBIG_UINT(pdata,16,(SMB_BIG_UINT)0);
+ SBIG_UINT(pdata,0,(uint64_t)0);
+ SBIG_UINT(pdata,8,(uint64_t)0);
+ SBIG_UINT(pdata,16,(uint64_t)0);
/* Default Soft Quota 8 bytes */
SBIG_UINT(pdata,24,quotas.softlim);
@@ -2935,7 +2935,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
/* We have POSIX ACLs, pathname, encryption,
* large read/write, and locking capability. */
- SBIG_UINT(pdata,4,((SMB_BIG_UINT)(
+ SBIG_UINT(pdata,4,((uint64_t)(
CIFS_UNIX_POSIX_ACLS_CAP|
CIFS_UNIX_POSIX_PATHNAMES_CAP|
CIFS_UNIX_FCNTL_LOCKS_CAP|
@@ -3037,9 +3037,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
SIVAL(pdata, 0, flags);
SIVAL(pdata, 4, SMB_WHOAMI_MASK);
SBIG_UINT(pdata, 8,
- (SMB_BIG_UINT)conn->server_info->utok.uid);
+ (uint64_t)conn->server_info->utok.uid);
SBIG_UINT(pdata, 16,
- (SMB_BIG_UINT)conn->server_info->utok.gid);
+ (uint64_t)conn->server_info->utok.gid);
if (data_len >= max_data_bytes) {
@@ -3078,7 +3078,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
/* GID list */
for (i = 0; i < conn->server_info->utok.ngroups; ++i) {
SBIG_UINT(pdata, data_len,
- (SMB_BIG_UINT)conn->server_info->utok.groups[i]);
+ (uint64_t)conn->server_info->utok.groups[i]);
data_len += 8;
}
@@ -3319,10 +3319,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
/* unknown_1 24 NULL bytes in pdata*/
- /* the soft quotas 8 bytes (SMB_BIG_UINT)*/
- quotas.softlim = (SMB_BIG_UINT)IVAL(pdata,24);
+ /* the soft quotas 8 bytes (uint64_t)*/
+ quotas.softlim = (uint64_t)IVAL(pdata,24);
#ifdef LARGE_SMB_OFF_T
- quotas.softlim |= (((SMB_BIG_UINT)IVAL(pdata,28)) << 32);
+ quotas.softlim |= (((uint64_t)IVAL(pdata,28)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,28) != 0)&&
((quotas.softlim != 0xFFFFFFFF)||
@@ -3335,10 +3335,10 @@ cap_low = 0x%x, cap_high = 0x%x\n",
}
#endif /* LARGE_SMB_OFF_T */
- /* the hard quotas 8 bytes (SMB_BIG_UINT)*/
- quotas.hardlim = (SMB_BIG_UINT)IVAL(pdata,32);
+ /* the hard quotas 8 bytes (uint64_t)*/
+ quotas.hardlim = (uint64_t)IVAL(pdata,32);
#ifdef LARGE_SMB_OFF_T
- quotas.hardlim |= (((SMB_BIG_UINT)IVAL(pdata,36)) << 32);
+ quotas.hardlim |= (((uint64_t)IVAL(pdata,36)) << 32);
#else /* LARGE_SMB_OFF_T */
if ((IVAL(pdata,36) != 0)&&
((quotas.hardlim != 0xFFFFFFFF)||
@@ -3828,7 +3828,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
int mode=0;
int nlink;
SMB_OFF_T file_size=0;
- SMB_BIG_UINT allocation_size=0;
+ uint64_t allocation_size=0;
unsigned int data_size = 0;
unsigned int param_size = 2;
SMB_STRUCT_STAT sbuf;
@@ -4682,8 +4682,8 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
case SMB_QUERY_POSIX_LOCK:
{
NTSTATUS status = NT_STATUS_INVALID_LEVEL;
- SMB_BIG_UINT count;
- SMB_BIG_UINT offset;
+ uint64_t count;
+ uint64_t offset;
uint32 lock_pid;
enum brl_type lock_type;
@@ -4711,13 +4711,13 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
- count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
+ offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
+ count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
#else /* HAVE_LONGLONG */
- offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
- count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
+ offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
+ count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
#endif /* HAVE_LONGLONG */
status = query_lock(fsp,
@@ -5123,7 +5123,7 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
int total_data,
files_struct *fsp)
{
- SMB_BIG_UINT position_information;
+ uint64_t position_information;
if (total_data < 8) {
return NT_STATUS_INVALID_PARAMETER;
@@ -5134,9 +5134,9 @@ static NTSTATUS smb_file_position_information(connection_struct *conn,
return NT_STATUS_OK;
}
- position_information = (SMB_BIG_UINT)IVAL(pdata,0);
+ position_information = (uint64_t)IVAL(pdata,0);
#ifdef LARGE_SMB_OFF_T
- position_information |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
+ position_information |= (((uint64_t)IVAL(pdata,4)) << 32);
#else /* LARGE_SMB_OFF_T */
if (IVAL(pdata,4) != 0) {
/* more than 32 bits? */
@@ -5475,8 +5475,8 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
int total_data,
files_struct *fsp)
{
- SMB_BIG_UINT count;
- SMB_BIG_UINT offset;
+ uint64_t count;
+ uint64_t offset;
uint32 lock_pid;
bool blocking_lock = False;
enum brl_type lock_type;
@@ -5523,13 +5523,13 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
lock_pid = IVAL(pdata, POSIX_LOCK_PID_OFFSET);
#if defined(HAVE_LONGLONG)
- offset = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_START_OFFSET));
- count = (((SMB_BIG_UINT) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
- ((SMB_BIG_UINT) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
+ offset = (((uint64_t) IVAL(pdata,(POSIX_LOCK_START_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_START_OFFSET));
+ count = (((uint64_t) IVAL(pdata,(POSIX_LOCK_LEN_OFFSET+4))) << 32) |
+ ((uint64_t) IVAL(pdata,POSIX_LOCK_LEN_OFFSET));
#else /* HAVE_LONGLONG */
- offset = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_START_OFFSET);
- count = (SMB_BIG_UINT)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
+ offset = (uint64_t)IVAL(pdata,POSIX_LOCK_START_OFFSET);
+ count = (uint64_t)IVAL(pdata,POSIX_LOCK_LEN_OFFSET);
#endif /* HAVE_LONGLONG */
DEBUG(10,("smb_set_posix_lock: file %s, lock_type = %u,"
@@ -5702,7 +5702,7 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
const char *fname,
SMB_STRUCT_STAT *psbuf)
{
- SMB_BIG_UINT allocation_size = 0;
+ uint64_t allocation_size = 0;
NTSTATUS status = NT_STATUS_OK;
files_struct *new_fsp = NULL;
@@ -5714,9 +5714,9 @@ static NTSTATUS smb_set_file_allocation_info(connection_struct *conn,
return NT_STATUS_INVALID_PARAMETER;
}
- allocation_size = (SMB_BIG_UINT)IVAL(pdata,0);
+ allocation_size = (uint64_t)IVAL(pdata,0);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
+ allocation_size |= (((uint64_t)IVAL(pdata,4)) << 32);
#else /* LARGE_SMB_OFF_T */
if (IVAL(pdata,4) != 0) {
/* more than 32 bits? */
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 1e137dd908..011f31dd24 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -501,13 +501,13 @@ ssize_t vfs_pwrite_data(struct smb_request *req,
Returns 0 on success, -1 on failure.
****************************************************************************/
-int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
+int vfs_allocate_file_space(files_struct *fsp, uint64_t len)
{
int ret;
SMB_STRUCT_STAT st;
connection_struct *conn = fsp->conn;
- SMB_BIG_UINT space_avail;
- SMB_BIG_UINT bsize,dfree,dsize;
+ uint64_t space_avail;
+ uint64_t bsize,dfree,dsize;
release_level_2_oplocks_on_change(fsp);
@@ -527,10 +527,10 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
if (ret == -1)
return ret;
- if (len == (SMB_BIG_UINT)st.st_size)
+ if (len == (uint64_t)st.st_size)
return 0;
- if (len < (SMB_BIG_UINT)st.st_size) {
+ if (len < (uint64_t)st.st_size) {
/* Shrink - use ftruncate. */
DEBUG(10,("vfs_allocate_file_space: file %s, shrink. Current size %.0f\n",
@@ -551,7 +551,7 @@ int vfs_allocate_file_space(files_struct *fsp, SMB_BIG_UINT len)
len -= st.st_size;
len /= 1024; /* Len is now number of 1k blocks needed. */
space_avail = get_dfree_info(conn,fsp->fsp_name,False,&bsize,&dfree,&dsize);
- if (space_avail == (SMB_BIG_UINT)-1) {
+ if (space_avail == (uint64_t)-1) {
return -1;
}