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

220 Commits

Author SHA1 Message Date
Volker Lendecke
1057240733 brlock: Do auto-cleanup at conflict time
This avoids the need to do sweeping validate_lock_entries calls

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-23 00:24:18 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
Stefan Metzmacher
6669a84ad0 s3:smbd: remember smbXsrv_connection for each smb_request
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:12 +02:00
Volker Lendecke
6f8fd3d5ab smbd: Remove unused blocking_lock_record* from VFS_BRL_CANCEL_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Volker Lendecke
b08fe2d98d smbd: Remove unused blocking_lock_record* from VFS_BRL_LOCK_WINDOWS
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
David Disseldorp
d8d5d4c742 vfs: add [GET/SET]_COMPRESSION hooks
The VFS interfaces are sychronous, as the operations only modify
meta-data.
These hooks are dependent on support for transparent compression by the
underlying filesystem - vfs_default returns INVALID_DEVICE_REQUEST.
Support for other filesystems providing transparent comression, such as
Btrfs and ZFS, can be added in future.

The get_compression function takes fsp and smb_fname arguments. The
smb_fname argument is needed due to the current dosmode() code-path.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-11-22 08:56:45 -08:00
Volker Lendecke
f52a3c3cd1 smbd: Remove the unused fsp->pending_break_messages array
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-26 15:17:22 -07:00
Stefan Metzmacher
ae1cb5ca04 s3:smbd: s/struct timed_event/struct tevent_timer
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:56 +01:00
David Disseldorp
ef00eb90e5 s3-vfs: add copy_chunk vfs hooks
copy_chunk copies n bytes from a source file at a specific offset to a
destination file at a given offset. This interface will be used in
handling smb2 FSCTL_SRV_COPYCHUNK ioctl requests.

Use a pread/pwrite loop in vfs_default, so that requests referring to
the same src and dest file are possible.

Provide send and receive hooks for copy chunk VFS interface, allowing
asynchronous behaviour.

Check whether the request source offset + length exceeds the current
size. Return STATUS_INVALID_VIEW_SIZE under such a condition, matching
Windows server behaviour.

Reviewed by: Jeremy Allison <jra@samba.org>
2013-01-16 23:15:06 +01:00
Jeremy Allison
4983d5838a Add uint32_t share_access to vuid_cache_entry.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:48 +11:00
Jeremy Allison
7d90ae123a Clean up struct connection_struct, make struct vuid_cache a pointer not inline.
Change VFS ABI to 31 for 4.1.0.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 15:28:45 +11:00
Andrew Bartlett
1f36ec1293 vfs: Remove type parameter from sys_acl_blob_get_{fd,file}
This interface actually needs to match the get_nt_acl interface in
that the system ACL implmenetation may not be posix ACLs, and the blob
is not meant to be enforced to be of a particular system ACL
structure.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
c8ade07760 smbd: Add mem_ctx to {f,}get_nt_acl VFS call
This makes it clear which context the returned SD is allocated on, as
a number of callers do not want it on talloc_tos().

As the ACL transformation allocates and then no longer needs a great
deal of memory, a talloc_stackframe() call is used to contain the
memory that is not returned further up the stack.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Andrew Bartlett
9158974540 smbd: Add mem_ctx to sys_acl_init() and all callers
This changes from allocation on NULL to allocation on the supplied
memory context.

Currently that supplied context is talloc_tos() at the the final consumer of
the ACL.

Andrew Bartlett
2012-10-11 12:25:11 +11:00
Jeremy Allison
b6636affaf Move cached cwd onto conn struct.
This enables us to make VFS modules safe for use in root called
code when we've changed directory under conn->connectpath.
2012-09-12 22:06:06 +02:00
Andrew Bartlett
e8375ddf2d smbd: Add extra VFS hooks to get the posix ACL as a blob
This will allow us to hash this, rather than the NT ACL it maps to.
This will in turn allow us to know if the NT ACL is valid even if we
have to change the mapping code.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 12 07:06:01 CEST 2012 on sn-devel-104
2012-09-12 07:06:01 +02:00
Christian Ambach
624e51a21a s3:smbd Bump the smbd vfs interface version to 30
that is what Samba 4.0.0 will ship with

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Mon Sep 10 19:40:01 CEST 2012 on sn-devel-104
2012-09-10 19:40:01 +02:00
Michael Adam
35260ae89e s3:vfs: add durable VFS operations
This allows a VFS module to implement durable handles in different ways.

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-09-08 03:39:06 +02:00
Jeremy Allison
43d619b2bb Add "backup_intent" bool to files_struct.
Not used right now but I need this in the VFS to implement open for
backup/restore later and don't want to break the ABI once 4.0.0
ships.
2012-09-05 20:43:31 +02:00
Andrew Bartlett
e25830dcd8 s3-smbd: Remove sys_acl_*() VFS wrapper functions
We no longer do struct smb_acl_t manipuations via the VFS layer,
which is now reduced to handling the get/set functions.

The only backend that implemented these functions (aside from audit)
was the vfs_default module calling the sys_acl code.  The various ACL
implementation modules either worked on the fully initilaised
smb_acl_t object or on NT ACLs.

This not only makes the operation of the posix ACL code more efficient
(as allocation and free is not put via the VFS), it makes it easier to
test and removes the fantasy that a module could safely redefine this
structure or the behaviour here.

The smb_acls.idl now defines the structure, and it is now allocated
with talloc.

These operations were originally added to the VFS in commit
3bb219161a.

Andrew Bartlett
2012-08-15 11:44:50 +10:00
Volker Lendecke
3e9f58be7e s3-smb1: Postpone close_file until all aio is handled
Thanks to Jeremy for this simple idea

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:57:53 -07:00
Volker Lendecke
5d09cec6fe s3-vfs: async fsync
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:48:04 -07:00
Volker Lendecke
9dc78c90f3 s3-aio: Remove unused VFS functions and more
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:45:58 -07:00
Volker Lendecke
f9df073a31 s3: Make smbd/aio.c not depend on aio.h anymore
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:40:35 -07:00
Volker Lendecke
f5dc8837d9 s3: Properly handle shutdown with the _send/_recv based aio
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:37:28 -07:00
Volker Lendecke
e24aed15fa s3-vfs: async pread
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 15:11:56 -07:00
Volker Lendecke
c6e456d9c0 s3-vfs: async pwrite
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-07-18 13:49:21 -07:00
Michael Adam
3e6d8acc9b s3:vfs: use smbXsrv_open instead of smbXsrv_open0 in files_struct 2012-07-03 13:39:41 +02:00
Michael Adam
f2e8409c4e s3:vfs: use smbXsrv_tcon instead of smbXsrv_tcon0 in connection_struct. 2012-07-03 13:39:41 +02:00
Jeremy Allison
34bb743ce3 Add uint64_t mid field to the files_struct.
Ensure it is initialized so we know what mid created this file.
2012-06-30 02:23:39 +02:00
Stefan Metzmacher
7d1395536b s3:smbd: make use of smbXsrv_open for smb1/2/3
This makes sure we generate unique persistent file ids,
which are stored in smbXsrv_open_global.tdb.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 29 21:01:11 CEST 2012 on sn-devel-104
2012-06-29 21:01:11 +02:00
Stefan Metzmacher
faa8edccef s3:smbd: make use of smbXsrv_tcon for smb1
Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
463b308f16 s3:smbd: make use of smbXsrv_tcon and smbXsrv_session for smb2
The removes the protocol specific smbd_smb2_session and
smbd_smb2_tcon.

Pair-Programmed-With: Michael Adam <obnox@samba.org>

metze
2012-06-25 20:55:06 +02:00
Stefan Metzmacher
d8b3687fcb s3:smbd: remember the request_time on an incoming request
metze
2012-06-15 07:18:00 +02:00
Michael Adam
b27f88898a s3:vfs: change files_struct.fnum from int to uint64_t
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 15 05:22:41 CEST 2012 on sn-devel-104
2012-06-15 05:22:41 +02:00
Michael Adam
4389097294 s3:include: change connection_struct->cnum to uint32_t
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02:00
Michael Adam
86f621488a s3:include: change smb_request->tid to uint32_t
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-06-06 19:37:14 +02:00
Stefan Metzmacher
d4aa494654 s3:include: change smb_request->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
d45e0ddfcd s3:include: move struct smb_request to vfs.h
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
37bfadf4a3 s3:include: change files_struct->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
5a260a1d58 s3:include: change connection_struct->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
defebd9e49 s3:includes: change vuid_cache_entry->vuid to uint64_t
metze
2012-06-06 10:18:40 +02:00
Stefan Metzmacher
9b5c2ca14c s3:include: move some prototypes (e.g. smb_register_vfs) to vfs.h
These are called from vfs modules, which should not depend on smbd/proto.h

metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
4a22dd61c0 s3:include: move struct smb_filename to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
22cfc8eca8 s3:include: move struct smb_file_time to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
5fc502c624 s3:include: move struct connection_struct (and sub structs) to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
f88d13b16f s3:include: move struct stream_struct to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
b9500bd988 s3:include: move struct fd_handle/files_struct to vfs.h
metze
2012-06-06 10:18:38 +02:00
Stefan Metzmacher
f78cc3aca7 s3:includes: move union unid_t to vfs.h
metze
2012-06-06 10:18:38 +02:00
Christian Ambach
a9c981ec0b s3:vfs fix compiler warning
vfs_default.c:1875:10: warning: no previous prototype for 'vfswrap_audit_file'
2012-05-03 21:34:05 +02:00