summaryrefslogtreecommitdiffstats
path: root/source/smbd
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2003-05-14 14:38:11 +0000
committerAlexander Bokovoy <ab@samba.org>2003-05-14 14:38:11 +0000
commit3786695c72e6ff6a52a527382ac77142e236971b (patch)
tree55e79c0e4bb9d8e2028c978102d5f854ec6618cd /source/smbd
parentc2689ed118b490e49497a76ed6a2251262018769 (diff)
downloadsamba-3786695c72e6ff6a52a527382ac77142e236971b.tar.gz
samba-3786695c72e6ff6a52a527382ac77142e236971b.tar.xz
samba-3786695c72e6ff6a52a527382ac77142e236971b.zip
Evolve quotas configure check more. Patch from Stefan (metze) Metzemacher. Now we are defaulting to --with-quotas=no but anyway trying to test them in configure. This is done to get information about as much quota API variations as possible -- when --with-quotas=no this does not affect build but provides us with more detailed information on build farm.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/ntquotas.c5
-rw-r--r--source/smbd/nttrans.c12
-rw-r--r--source/smbd/quotas.c5
-rw-r--r--source/smbd/trans2.c10
-rw-r--r--source/smbd/vfs-wrap.c14
5 files changed, 29 insertions, 17 deletions
diff --git a/source/smbd/ntquotas.c b/source/smbd/ntquotas.c
index f6f14794816..86855608971 100644
--- a/source/smbd/ntquotas.c
+++ b/source/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/source/smbd/nttrans.c b/source/smbd/nttrans.c
index 3ddf191ef60..3bf162f7634 100644
--- a/source/smbd/nttrans.c
+++ b/source/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/source/smbd/quotas.c b/source/smbd/quotas.c
index 0163120ee58..91c952aa902 100644
--- a/source/smbd/quotas.c
+++ b/source/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/source/smbd/trans2.c b/source/smbd/trans2.c
index 731fb9643bb..0bf9580798b 100644
--- a/source/smbd/trans2.c
+++ b/source/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/source/smbd/vfs-wrap.c b/source/smbd/vfs-wrap.c
index 64e29bbe436..2160bca9f7d 100644
--- a/source/smbd/vfs-wrap.c
+++ b/source/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
}