summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/ntquotas.c5
-rw-r--r--source3/smbd/nttrans.c12
-rw-r--r--source3/smbd/quotas.c5
-rw-r--r--source3/smbd/trans2.c10
-rw-r--r--source3/smbd/vfs-wrap.c14
5 files changed, 29 insertions, 17 deletions
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c
index f6f1479481..8685560897 100644
--- a/source3/smbd/ntquotas.c
+++ b/source3/smbd/ntquotas.c
@@ -119,11 +119,8 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, DOM_SID *psid,
id.uid = -1;
-#if defined(QUOTABLOCK_SIZE)
D.bsize = (SMB_BIG_UINT)QUOTABLOCK_SIZE;
-#else
- D.bsize = (SMB_BIG_UINT)1024;
-#endif
+
D.softlimit = limit_nt2unix(qt->softlim,D.bsize);
D.hardlimit = limit_nt2unix(qt->hardlim,D.bsize);
D.qflags = qt->qflags;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 3ddf191ef6..3bf162f763 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -691,7 +691,7 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib
if( strchr_m(fname, ':')) {
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
if ((fake_file_type=is_fake_file(fname))!=0) {
/*
* here we go! support for changing the disk quotas --metze
@@ -706,7 +706,7 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib
#endif
END_PROFILE(SMBntcreateX);
return ERROR_NT(NT_STATUS_OBJECT_PATH_NOT_FOUND);
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
}
#endif
}
@@ -1830,7 +1830,7 @@ static int call_nt_transact_ioctl(connection_struct *conn,
}
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
/****************************************************************************
Reply to get user quota
****************************************************************************/
@@ -2200,7 +2200,7 @@ static int call_nt_transact_set_user_quota(connection_struct *conn,
return -1;
}
-#endif /* WITH_QUOTAS */
+#endif /* HAVE_SYS_QUOTAS */
/****************************************************************************
Reply to a SMBNTtrans.
@@ -2445,7 +2445,7 @@ due to being in oplock break state.\n", (unsigned int)function_code ));
&setup, &params, &data);
END_PROFILE_NESTED(NT_transact_query_security_desc);
break;
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
case NT_TRANSACT_GET_USER_QUOTA:
START_PROFILE_NESTED(NT_transact_get_user_quota);
outsize = call_nt_transact_get_user_quota(conn, inbuf, outbuf,
@@ -2464,7 +2464,7 @@ due to being in oplock break state.\n", (unsigned int)function_code ));
&data, data_count);
END_PROFILE_NESTED(NT_transact_set_user_quota);
break;
-#endif /* WITH_QUOTAS */
+#endif /* HAVE_SYS_QUOTAS */
default:
/* Error in request */
DEBUG(0,("reply_nttrans: Unknown request %d in nttrans call\n", function_code));
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 0163120ee5..91c952aa90 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -29,6 +29,11 @@
#ifndef HAVE_SYS_QUOTAS
+/* just a quick hack because sysquotas.h is included before linux/quota.h */
+#ifdef QUOTABLOCK_SIZE
+#undef QUOTABLOCK_SIZE
+#endif
+
#ifdef WITH_QUOTAS
#if defined(VXFS_QUOTA)
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 731fb9643b..0bf9580798 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1480,7 +1480,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
SIVAL(pdata,4,0); /* characteristics */
break;
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
case SMB_FS_QUOTA_INFORMATION:
/*
* what we have to send --metze:
@@ -1551,7 +1551,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
break;
}
-#endif /* WITH_QUOTAS */
+#endif /* HAVE_SYS_QUOTAS */
case SMB_FS_OBJECTID_INFORMATION:
data_len = 64;
break;
@@ -1593,7 +1593,7 @@ cBytesSector=%u, cUnitTotal=%u, cUnitAvail=%d\n", (unsigned int)bsize, (unsigned
return -1;
}
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
/****************************************************************************
Reply to a TRANS2_SETFSINFO (set filesystem info).
****************************************************************************/
@@ -1705,7 +1705,7 @@ static int call_trans2setfsinfo(connection_struct *conn,
return outsize;
}
-#endif /* WITH_QUOTAS */
+#endif /* HAVE_SYS_QUOTAS */
/****************************************************************************
* Utility function to set bad path error.
@@ -3492,7 +3492,7 @@ int reply_trans2(connection_struct *conn,
END_PROFILE_NESTED(Trans2_qfsinfo);
break;
-#ifdef WITH_QUOTAS
+#ifdef HAVE_SYS_QUOTAS
case TRANSACT2_SETFSINFO:
START_PROFILE_NESTED(Trans2_setfsinfo);
outsize = call_trans2setfsinfo(conn, inbuf, outbuf, length, bufsize,
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index 64e29bbe43..2160bca9f7 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -758,20 +758,30 @@ int vfswrap_sys_acl_free_qualifier(vfs_handle_struct *handle, connection_struct
int vfswrap_get_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt)
{
+#ifdef HAVE_SYS_QUOTAS
int result;
START_PROFILE(syscall_get_quota);
result = sys_get_quota(conn->connectpath, qtype, id, qt);
END_PROFILE(syscall_get_quota);
- return result;
+ return result;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}
int vfswrap_set_quota(struct vfs_handle_struct *handle, struct connection_struct *conn, enum SMB_QUOTA_TYPE qtype, unid_t id, SMB_DISK_QUOTA *qt)
{
+#ifdef HAVE_SYS_QUOTAS
int result;
START_PROFILE(syscall_set_quota);
result = sys_set_quota(conn->connectpath, qtype, id, qt);
END_PROFILE(syscall_set_quota);
- return result;
+ return result;
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
}