1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

36 Commits

Author SHA1 Message Date
Uri Simchoni
b3d938c9c0 s3-sysquotas: correctly restore path when finding mount point
When traversing the path backwards to find the mount point, if the
root '/' is reached, then the character to be restored is not a '/'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12273

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 Oct  8 05:22:25 CEST 2016 on sn-devel-144
2016-10-08 05:22:25 +02:00
Uri Simchoni
b79ea7d3fb s3-sysquotas: remove special handling of EDQUOT
The sysquotas module has several supported backends for
getting/setting user/group quota. This patch removes a check
by the common code, to see if the backend has returned EDQUOT.

Before this patch, it was OK for a backend to return with error
and errno set to EDQUOT, and that meant success, but with a warning
that the user/group is over quota. This is the system behavior on
some Unices. This patch removes this from the protocol between the
sysquota module and its backend drivers - it's the responsibility
of the backend to return 0 iff it has fulfilled the request to get or
set quota.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2016-06-01 00:57:32 +02:00
Volker Lendecke
3a1685db0b lib: Remove "includes.h" from util_file.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-23 22:03:17 +01:00
Volker Lendecke
3de5d8fdfd lib: Add "mem_ctx" to file_lines_pload
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2016-02-23 22:03:17 +01:00
Uri Simchoni
465c3d9a4e smbd quotas: avoid stat of foreign file systems
When determining the block device of our file system, avoid
stat'ing paths which are definitely not the mount point of
our file system. This is done to avoid stalling smbd due to
unresponsive network file systems (e.g. NFS) which are not
related to the SMB shares.

See discussion in samba-technical for vfs_fileid:
https://lists.samba.org/archive/samba-technical/2016-January/111553.html

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): Wed Jan 27 03:35:48 CET 2016 on sn-devel-144
2016-01-27 03:35:47 +01:00
Björn Jacke
0b57d1c075 quota: add supprt for gfs2
gfs2 uses the same generic quota interface as xfs and it has the same base
block/quota block size ratio and seems to work nice with the xfs quota module.

(People using gfs should be aware that quota reporting is lagging quite a bit
on gfs.  If you copy a file on a gfs volume the quota values are being updated
with a delay of 30s here with kernel 3.5. This reporting can lead to data
corruption if a client thinks he can write but actually he suddently can't.)
2012-09-18 14:30:25 +02:00
Björn Jacke
b53c5bcf5b quota: also log which fs type we found
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Sep 15 02:18:16 CEST 2012 on sn-devel-104
2012-09-15 02:18:16 +02:00
Björn Jacke
c853b68229 s3:quota: don't add the string '"' into the argument list
this is not used to quote or anything else. This is mainly
causing work for the script writer who has to remove the
quote stings again :-)

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sat Sep  8 03:13:13 CEST 2012 on sn-devel-104
2012-09-08 03:13:13 +02:00
Björn Jacke
ee2d6ae148 s3:quota: clean up and consolidate the xfs quota checks and defines
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Sep  7 15:59:46 CEST 2012 on sn-devel-104
2012-09-07 15:59:46 +02:00
Björn Jacke
3810ee4e87 s3:sysquota_xfs: fix logic so that we actually use this module on Linux 2012-09-07 14:15:57 +02:00
Björn Jacke
44fd8e7208 fileserver:sysquotas: remove wrong cast
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Sep  6 17:16:30 CEST 2012 on sn-devel-104
2012-09-06 17:16:30 +02:00
Björn Jacke
a6df44b3ae sysquota: we need to list nfs4 as a separate fs name for the sys_get_nfs_quota backend
at least the Linux kernel up to 3.5.0 lists NFSv4 aѕ nfs4 and not as nfs
2012-09-06 09:08:57 +02:00
Björn Jacke
d392485919 s3: add sysquotas_4B support
this is from James Peach's darwin patch, that exists since a couple of years
already.

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Sep  2 01:00:41 CEST 2012 on sn-devel-104
2012-09-02 01:00:40 +02:00
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Stefan Metzmacher
5186209277 s3:lib/sysquota: remove ugly LARGE_SMB_OFF_T ifdef's
We rely on uint64_t for a long time now...

metze
2011-04-23 10:44:16 +02:00
Michael Adam
3add3aa17d s3:smbd: add a nfs backend for sysquotas.
This module is based on the Solaris/FreeBSD implementation
of NFS quotas in the quotas.c module.

It implements the SMB_USER_QUOTA_TYPE query of the
get_quotas call. The other types and the set_quota call
are not implemented.
2010-08-25 14:05:51 +02:00
Volker Lendecke
66e6439b7b s3: "sys_path_to_bdev" only looks at the devicenumber 2009-11-29 11:22:04 +01:00
Volker Lendecke
44ce5603dd s3: Pass the "fake dir create times" parameter to sys_*stat
Step 0 to restore it as a per-share paramter
2009-11-29 11:22:01 +01:00
Michael Adam
3650143712 s3:lib/sysquotas: fix usage of SMB_STRUCT_STAT (struct stat_ex).
This fixes the build with quotas / configure time detection
of sys_quota interface.

Michael
2009-06-29 16:51:53 +02:00
Jelmer Vernooij
1b99d8fbb5 Use common util_file code. 2008-10-12 17:34:43 +02:00
Jeremy Allison
68be9a8200 More pstring removal. This one was tricky. I had to add
one horror (pstring_clean_name()) which will have to
remain until I've removed all pstrings from the client code.
Jeremy.
(This used to be commit 1ea3ac8014)
2007-11-15 14:19:52 -08:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
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 f35a266b3c)
2007-10-18 17:40:25 -07:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Jeremy Allison
ca9be7c92b r14342: Fix coverity #68, resource leak on error path.
Jeremy.
(This used to be commit 7520a8d2a1)
2007-10-10 11:15:26 -05:00
Jeremy Allison
90230ac962 r11560: Fix core dump if setmntent returns NULL.
Pointed out by Jay Fanlason @ Red Hat.
Jeremy.
(This used to be commit e8136ae746)
2007-10-10 11:05:20 -05:00
Herb Lewis
1c4bbe0654 r6586: get rid of a few more compiler warnings
(This used to be commit 173375f8d8)
2007-10-10 10:56:46 -05:00
Jeremy Allison
54fdd5c7dc r4236: More *alloc fixes.
Jeremy.
(This used to be commit 6b25a6e088)
2007-10-10 10:53:39 -05:00
Stefan Metzmacher
9343c89cb4 * Fix XFS quotas: XFS_USER_QUOTA -> USRQUOTA
XFS_GROUP_QUOTA -> GRPQUOTA
* Fix disk_free calculation with group quotas.
* Add debug class 'quota' and a lot of DEBUG()'s
  to the quota code.

metze
(This used to be commit e9e5e2036f)
2004-01-15 08:49:30 +00:00
Stefan Metzmacher
2c1f07b66a fix XFS quotas the macro changed from HAVE_XFS_QUOTA -> HAVE_XFS_QUOTAS
metze
(This used to be commit c73e845055)
2004-01-14 02:51:41 +00:00
Jeremy Allison
31876a8478 Patch from Stefan (metze) Metzmacher <metze at metzemix.de> to revert to 2.2.x quota methods.
:-).

"here's a patch which ports the samba 2.2 samba_linux_quota.h stuff to 3_0.

This is needed because of so many broken quota files outthere.

Please, test this with old, new kernels
(strucr dqblk, struct mem_dqblk, and struct if_dqblk)
, quota.user, aquota.user formats

what is when a user is over soft quota and over hard quotas..."

Jeremy.
(This used to be commit 4350aa6ce6)
2004-01-05 19:36:02 +00:00
Jelmer Vernooij
9759adc4ff Move sysquotas autoconf tests to a seperate file.
Patch by Stefan Metzmacher <metze@metzemix.de>
(This used to be commit 9f6cd8177d)
2003-10-09 20:58:11 +00:00
Alexander Bokovoy
f86708be99 Return proper error when it is impossible to change quota flags
(This used to be commit 44bae9da9e)
2003-07-31 17:08:38 +00:00
Alexander Bokovoy
428653ef72 Add NT quotas support. Users allowed now to manage quotas on systems with sysquotas interface detected (Linux at least) using native Windows tools. Also move default quota support for NT quotas to VFS module default_quota. Code by Metze
(This used to be commit e856a96c2c)
2003-07-29 18:07:13 +00:00
Alexander Bokovoy
2c01eef4d7 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.
(This used to be commit 3786695c72)
2003-05-14 14:38:11 +00:00
Alexander Bokovoy
e8573c8fa9 Add NT quota support. Patch from Stefan (metze) Metzemacher
1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab
2. Disabled by default and when requested, will be probed and enabled only on Linux where it works
3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far
Documentation to follow
(This used to be commit 4bf022ce9e)
2003-05-12 01:20:17 +00:00