summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/dfree.c15
-rw-r--r--source3/smbd/reply.c5
-rw-r--r--source3/smbd/trans2.c13
3 files changed, 26 insertions, 7 deletions
diff --git a/source3/smbd/dfree.c b/source3/smbd/dfree.c
index c556c8c8ab..81a48b94fc 100644
--- a/source3/smbd/dfree.c
+++ b/source3/smbd/dfree.c
@@ -115,10 +115,19 @@ static SMB_BIG_UINT disk_free(const char *path, BOOL small_query,
} else {
DEBUG (0, ("disk_free: sys_popen() failed for command %s. Error was : %s\n",
syscmd, strerror(errno) ));
- sys_fsusage(path, dfree, dsize);
+ 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;
+ }
+ }
+ } 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;
}
- } else
- sys_fsusage(path, dfree, dsize);
+ }
if (disk_quotas(path, &bsize_q, &dfree_q, &dsize_q)) {
(*bsize) = bsize_q;
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 326dafd678..e8ee9ffe92 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -751,7 +751,10 @@ int reply_dskattr(connection_struct *conn, char *inbuf,char *outbuf, int dum_siz
SMB_BIG_UINT dfree,dsize,bsize;
START_PROFILE(SMBdskattr);
- SMB_VFS_DISK_FREE(conn,".",True,&bsize,&dfree,&dsize);
+ if (SMB_VFS_DISK_FREE(conn,".",True,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ END_PROFILE(SMBdskattr);
+ return(UNIXERROR(ERRHRD,ERRgeneral));
+ }
outsize = set_message(outbuf,5,0,True);
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 54234deb35..e4e1243d68 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1785,7 +1785,10 @@ static int call_trans2qfsinfo(connection_struct *conn, char *inbuf, char *outbuf
{
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 18;
- SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize);
+ if (SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ return(UNIXERROR(ERRHRD,ERRgeneral));
+ }
+
block_size = lp_block_size(snum);
if (bsize < block_size) {
SMB_BIG_UINT factor = block_size/bsize;
@@ -1877,7 +1880,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)st.st_dev, (unsi
{
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 24;
- SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize);
+ if (SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ return(UNIXERROR(ERRHRD,ERRgeneral));
+ }
block_size = lp_block_size(snum);
if (bsize < block_size) {
SMB_BIG_UINT factor = block_size/bsize;
@@ -1907,7 +1912,9 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
{
SMB_BIG_UINT dfree,dsize,bsize,block_size,sectors_per_unit,bytes_per_sector;
data_len = 32;
- SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize);
+ if (SMB_VFS_DISK_FREE(conn,".",False,&bsize,&dfree,&dsize) == (SMB_BIG_UINT)-1) {
+ return(UNIXERROR(ERRHRD,ERRgeneral));
+ }
block_size = lp_block_size(snum);
if (bsize < block_size) {
SMB_BIG_UINT factor = block_size/bsize;