summaryrefslogtreecommitdiff
path: root/source3/smbd/quotas.c
Commit message (Collapse)AuthorAgeFilesLines
* quotas: Check group quota for directory when SGID is setChristof Schmitt2019-08-141-4/+19
| | | | | | | | | | On directories with the "set group id" (SGID) bit is set, new files and subfolders will be created with the group of the directory, and not with the primary group of the user. Checking for free space in this case should query the group quota for the gid of the directory. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* quotas: remove legacy AIX quota code that is covered by sysquotas nowBjoern Jacke2019-02-171-122/+0
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* s3: VFS: Change SMB_VFS_GET_QUOTA to use const struct smb_filename * instead ↵Jeremy Allison2017-06-181-5/+5
| | | | | | | | | | of const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* smbd: use owner uid for free disk calculation if owner is inheritedUri Simchoni2016-08-131-2/+19
| | | | | | | | | | | | If "inherit owner" is enabled, then new files created under a directory shall consume the quota of the directory's owner, so the free disk calculation should take that quota into account, not the quota of the user creating the file. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: get a valid file stat to disk_quotasUri Simchoni2016-08-131-18/+20
| | | | | | | | | | | | Most calls to disk_quotas originate at a state with an open file descriptor. Pass the file's stat info down to disk_quota, so that we can avoid extra stat's and the related error handling. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-dfree-quota: remove special handling of EDQUOTUri Simchoni2016-06-011-18/+4
| | | | | | | | | | It is no longer part of the quota VFS interface to return an EDQUOT error as an indication that getting quota succeeded but the user/group is over-quota. A VFS module implementing quota interface always returns 0 on success. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: dfree - ignore quota if not enforcedUri Simchoni2016-05-281-1/+31
| | | | | | | | | | | | | | | | | | | | | | When calculating free disk space, do not take user quota into account if quota is globally not enforced on the file system. This is meant to fix a specific problem with XFS. One might say "why don't you fix the XFS-specific code instead?". The reason for that is that getting and setting quota must not be affected by whether quota is actually enforced. NTFS has the same notion of separating quota accounting (and being able to configure / retrieve configured quota), from quota enforcement. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11937 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat May 28 00:09:05 CEST 2016 on sn-devel-144
* smbd: remove quota support for some ancient OSsUri Simchoni2016-03-171-197/+3
| | | | | | | Remove quota support for SunOS4 and VxFS on Solaris 2 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* disk_quotas: style fixUri Simchoni2016-01-261-2/+4
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: refactor disk_free handlingUri Simchoni2016-01-261-9/+10
| | | | | | | | | | | Move most of the logic that handles determination of disk size and free space from default VFS handler to the SMB layer - letting the VFS handle the basic task of querying the file system for general stats and quota. Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd/quotas: Remove invalid quota status switch caseAnoop C S2015-10-241-10/+7
| | | | | | | | | | | | | | getquota_rslt structure from rquota.h defines the enum named status whose values start from 1. But in quotas.c we have an invalid check for status 0. This change is to remove that particular switch case. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Oct 24 01:31:21 CEST 2015 on sn-devel-104
* quota: move function again to its belonging ifdef blockBjörn Jacke2012-09-111-11/+9
| | | | | Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Tue Sep 11 04:44:28 CEST 2012 on sn-devel-104
* s3-smbd: Remove OSF1 support from old (pre-sysquotas) codeBjörn Jacke2012-09-071-65/+0
| | | | "recent" Tru64 releases had QUOTACTL_4B support
* s3:quota: don't force the block size to 512Björn Jacke2012-09-061-3/+0
| | | | | there is no point in forcing the block size to 512 when curblocks is 1. This will only lead to false quota reporting. See bug #3272
* s3-smbd: Remove remaining references to removed OS support in old-style ↵Andrew Bartlett2012-09-061-6/+6
| | | | | | | | | quota code Signed-off-by: Björn Jacke <bj@sernet.de> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Thu Sep 6 10:47:18 CEST 2012 on sn-devel-104
* s3-smbd: Remove IRIX support from old (pre-sysquotas) codeAndrew Bartlett2012-09-061-129/+0
| | | | | | | | This should be essentially dead code, as while it is possible to disable sysquotas, the sysquotas has since 2003 supported the 4A varient used on IRIX. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
* s3-smbd: Remove HPUX support from old (pre-sysquotas) codeAndrew Bartlett2012-09-061-19/+0
| | | | | | | | This should be essentially dead code, as while it is possible to disable sysquotas, the sysquotas has since 2003 supported the 4A varient used on HPUX. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
* s3-smbd: Remove BSD support from old (pre-sysquotas) codeAndrew Bartlett2012-09-061-226/+3
| | | | | | | | | | | | This is essentially dead code, as while it is possible to disable sysquotas, the default for BSD is now to use sysquotas with the addition of 4B support via the recent Darwin patch by James Peach. NFS support has been in sysquotas for quite some time now. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
* s3-smbd: Remove Linux support from old (pre-sysquotas) codeAndrew Bartlett2012-09-061-438/+1
| | | | | | | | | This is essentially dead code, as while it is possible to disable sysquotas, the default for Linux has been to use sysquotas for quite some time now. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
* build: Remove Unicos support (quota in particular)Andrew Bartlett2012-09-061-89/+0
| | | | | | | | | Unicos machines are long gone now (Cray now make Linux compute nodes), so remove the quota support. Andrew Bartlett Signed-off-by: Björn Jacke <bj@sernet.de>
* s3: remove some duplicate quota codeBjörn Jacke2012-09-021-27/+12
|
* build: Remove sys_fopen wrapperAndrew Bartlett2012-04-051-1/+1
|
* build: Remove sys_open wrapperAndrew Bartlett2012-04-051-2/+2
|
* s3:smbd/quotas: add #include "system/filesys.h" (bug #8224)Stefan Metzmacher2011-06-141-0/+1
| | | | | | | | | This should fix the build on FreeBSD metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Jun 14 09:38:49 CEST 2011 on sn-devel-104
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3:smbd: add nfs quota support to the linux-non-sysquota codeMichael Adam2010-08-251-0/+198
| | | | | | This is based on the implementation for solaris and FreeBSD. It makes rpc calls out to the nfs server to retrieve quota information.
* s3: Fix a very embarrassing build failureVolker Lendecke2009-12-121-2/+2
|
* s3: "disk_quotas" only looks at the devicenumberVolker Lendecke2009-11-291-17/+13
|
* s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke2009-11-291-13/+19
| | | | Step 0 to restore it as a per-share paramter
* s3:fix build of old linux quota system and other unixes' quota implementationMichael Adam2009-06-291-14/+14
| | | | | | By fixing the use of struct stat_ex. Michael
* s3:smbd: remove stupid static variables for the nfs quota codeStefan Metzmacher2009-01-081-16/+20
| | | | metze
* Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij2008-10-141-53/+53
|
* Fix cut and paste error in quota code.Timur2008-09-151-2/+2
|
* Remove last pstring from smbd/*.cJeremy Allison2007-11-131-180/+185
| | | | | Jeremy. (This used to be commit f1680bada913af4eaf5c0d686983018d6c8b3e5f)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-17/+17
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* r25311: Patch from Heinrich Mislik <Heinrich.Mislik@univie.ac.at> to fix AIXVolker Lendecke2007-10-101-0/+3
| | | | | | | | | quotas. Heinrich, I trust you on that, I don't even have compiled this :-) Volker (This used to be commit a8312a1d7b7e3ad00265279dd0640261beaa287d)
* r23786: Use linux/dqblk_xfs.h rather than a private copy of this header in theAndrew Tridgell2007-10-101-1/+13
| | | | | | | | | | | Samba3 tree. This is neater, plus it avoids the need to get legal approval from SGI to use their GPLv2-only code under GPLv3. If/when SGI legal sort things out, we could consider adding back this header for very old systems where linux/dqblk_xfs.h is not available. (This used to be commit cb435543f84955be75368a3294bc6b627414d876)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r22149: BUG 4500: patch from Jorge Santos <jorge_a_santos@hotmail.com>Gerald Carter2007-10-101-1/+1
| | | | | to fix compile bug ni quotas.c (typo calling unbecome_root()). (This used to be commit 22d550d62b5834e2c5155550756d3462a1bd6561)
* r22096: become_root_uid_only() is unneeded - it's only used inJeremy Allison2007-10-101-15/+15
| | | | | | | messages.c. Refactor to use become_root() instead and make it local to messages.c Jeremy. (This used to be commit f3ffb3f98472b69b476b702dfe5c0575b32da018)
* r22060: Fix for AIX quotas from Heinrich Mislik <Heinrich.Mislik@univie.ac.at>.Jeremy Allison2007-10-101-0/+30
| | | | | Jeremy. (This used to be commit 8d95cdf8c0a46abc6b5cbcec3fd8bf246d49ee4b)
* r19260: Fix for bug #3524 from tiamat@komi.mts.ru - Solaris quotas.Jeremy Allison2007-10-101-7/+9
| | | | | Jeremy. (This used to be commit ac510a90f3adf72b64a8e2a764b0500dcd223b3f)
* r17296: Replace the understandable parts of the quotaJeremy Allison2007-10-101-17/+13
| | | | | | | code with become_root_uid_only()/unbecome_root_uid_only() pairs. This code needs working on..... Jeremy. (This used to be commit 0661d4e26614180636bc57de0c48adf8b9ce7a21)
* r12477: Remove a gcc -O6 warningVolker Lendecke2007-10-101-0/+2
| | | | (This used to be commit dd39a37f8e6ab7dad46b180959636f5e402c136d)
* r12076: Ensure setmntent() returns with != NULL in the disk_quotas() LinuxLars Müller2007-10-101-1/+3
| | | | | | | | version. The IRIX 6.2 version is still without this check as I'm not sure if setmntent() is implemented in the same way. (This used to be commit 519ed7ca0ecffbc341c7516758a678af59f98586)
* r10901: BUG 3145: Fix build issue regarding quota support on SolarisGerald Carter2007-10-101-3/+3
| | | | (This used to be commit b7de9a6c6963e7d3bb1a05ed15600dd50a8f4a08)
* r6712: BUG 2362: fix quota support on DragonFly (Joerg Sonnenberger ↵Gerald Carter2007-10-101-14/+14
| | | | | | <joerg@leaf.dragonflybsd.org>) (This used to be commit 0644a2abf646be35b345665558ca173004beedde)
* r5958: BUG 1843: patch from james peach to fix quotas (with no soft limits) ↵Gerald Carter2007-10-101-5/+10
| | | | | | on IRIX (This used to be commit aeb3cea54ea2e050aef38e38fd8519510a14a184)
* r5157: BUG 2266: conditionally include rpc/nettype.h to work around missing ↵Gerald Carter2007-10-101-0/+2
| | | | | | header onf FreeBSD4 (This used to be commit 314da604735696da4cf350f35d84592356e31861)