summaryrefslogtreecommitdiffstats
path: root/source3/smbd/vfs.c
Commit message (Collapse)AuthorAgeFilesLines
* vfs: remove unused function vfs_pread_data()Michael Adam2014-06-131-22/+0
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: Performance optimization for RECVFILE.Jeremy Allison2014-04-101-13/+43
| | | | | | | | | | | | | | | | | | | | | Based on work proposed by Jones <jones.kstw@gmail.com>. Removes set_blocking()/set_unblocking() fcntl calls around RECVFILE on the non-blocking socket. Instead uses RECVFILE in a loop, and only drops back to set_blocking()/set_unblocking() once RECVFILE returns -1/EAGAIN/EWOULDBLOCK. From the samba-technical list: ------------------------------------------------ The iometer 512b sequential write shows following result, Before applying this patch: 75333 IOps After applying this patch: 82691 IOps ------------------------------------------------ Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* param: rename lp function and variable from "symlinks" to "follow_symlinks"Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Avoid pointless strcsequal callsVolker Lendecke2013-12-141-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* vfs: add [GET/SET]_COMPRESSION hooksDavid Disseldorp2013-11-221-0/+21
| | | | | | | | | | | | | | | 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>
* Rename the profile enums with a SAMBA_ prefix to avoid conflict with system ↵Jeremy Allison2013-11-221-3/+3
| | | | | | | | | files. WRITE_FLUSH is defined in fs.h in Linux. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbd: Fix breaking level2 on allocateVolker Lendecke2013-09-051-6/+7
| | | | | | | | This needs doing even if we don't have strct allocate set. The client should not know that we lied. Fixes smb2.oplock.batch12. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Ensure the RECVFILE path in vfs_pwrite_data() operates on a blocking socket.Jeremy Allison2013-04-201-1/+12
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 20 01:04:05 CEST 2013 on sn-devel-104
* Ensure the RECVFILE path in vfs_write_data() operates on a blocking socket.Jeremy Allison2013-04-191-1/+12
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
* smbd: Convert vfs_lstat_smb_fname to synthetic_smb_fnameVolker Lendecke2013-04-171-6/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert vfs_stat_smb_fname to synthetic_smb_fnameVolker Lendecke2013-04-171-6/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert check_reduced_name_with_privilege to synthetic_smb_fnameVolker Lendecke2013-04-171-4/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert vfs_GetWd to synthetic_smb_fnameVolker Lendecke2013-04-171-9/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-vfs: add copy_chunk vfs hooksDavid Disseldorp2013-01-161-2/+24
| | | | | | | | | | | | | | | | | | 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>
* vfs: Remove type parameter from sys_acl_blob_get_{fd,file}Andrew Bartlett2012-10-111-2/+1
| | | | | | | | | 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
* smbd: Add mem_ctx to {f,}get_nt_acl VFS callAndrew Bartlett2012-10-111-2/+4
| | | | | | | | | | | 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
* smbd: Add mem_ctx to sys_acl_init() and all callersAndrew Bartlett2012-10-111-4/+6
| | | | | | | | | | 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
* Sigh :-(. Removing optimization prematurely is the root of all evil :-(.Jeremy Allison2012-09-131-0/+13
| | | | | | | | | | | | | | | | | Sorry for the mistake, but the LastDir singleton cache in vfs_ChDir() actually plays an important role. When we're processing a stream of SMB1/SMB2/SMB3 requests we don't want to add a chdir()/getcwd() system call pair on every request if they're all on the same connection and dealing with the same base path. I did some testing with a program that times 1,000,000 chdir() requests vs. 1,000,000 strcmp requests and it's a penalty of 10x doing the system calls. Just because it's old code, doesn't mean it's bad :-(. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Sep 13 21:31:42 CEST 2012 on sn-devel-104
* Move cached cwd onto conn struct.Jeremy Allison2012-09-121-1/+9
| | | | | This enables us to make VFS modules safe for use in root called code when we've changed directory under conn->connectpath.
* Remove ancient "optimization" global LastDir.Jeremy Allison2012-09-121-16/+3
|
* smbd: Add extra VFS hooks to get the posix ACL as a blobAndrew Bartlett2012-09-121-0/+21
| | | | | | | | | | | 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
* s3:vfs: add durable VFS operationsMichael Adam2012-09-081-0/+34
| | | | | | This allows a VFS module to implement durable handles in different ways. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
* s3-vfs: Indicate the symlink destination when failing check_reduced_nameAndrew Bartlett2012-08-281-2/+2
|
* s3-smbd: Remove sys_acl_*() VFS wrapper functionsAndrew Bartlett2012-08-151-129/+0
| | | | | | | | | | | | | | | | | | | | | | | 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 3bb219161a270f12c27c3bc7e1220829c6e9f284. Andrew Bartlett
* s3: skip loading vfs modules for printer connectionsBjörn Jacke2012-08-121-0/+6
| | | | | Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Sun Aug 12 23:40:23 CEST 2012 on sn-devel-104
* s3: Fix Coverity ID 710827 Resource leakVolker Lendecke2012-07-311-0/+1
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3-vfs: async fsyncVolker Lendecke2012-07-181-0/+62
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-aio: Remove unused VFS functions and moreVolker Lendecke2012-07-181-54/+0
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async preadVolker Lendecke2012-07-181-0/+64
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3-vfs: async pwriteVolker Lendecke2012-07-181-0/+65
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Fix Coverity ID 703869 Logically dead codeVolker Lendecke2012-06-111-10/+6
| | | | | | | | | | | | We "TALLOC_FREE(curr)" and assign prev=curr in the for-loop header. This will lead to "prev"==NULL always. In this loop, we do not need to correctly re-shuffle the linked list, we delete all from the beginning anyway. Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Jun 11 17:26:53 CEST 2012 on sn-devel-104
* s3:smbd: make struct vfs_fsp_data private to vfs.cStefan Metzmacher2012-06-061-0/+10
| | | | metze
* s3:smbd: add vfs_remove_all_fsp_extensions()Stefan Metzmacher2012-06-061-0/+21
| | | | metze
* Add an audit file VFS routine so we can handle auditing with SACLs.Richard Sharpe2012-04-281-0/+14
| | | | | Autobuild-User: Richard Sharpe <sharpe@samba.org> Autobuild-Date: Sat Apr 28 08:05:00 CEST 2012 on sn-devel-104
* s3: Simplify check_reduced_name a bitVolker Lendecke2012-04-241-9/+5
| | | | | | | | It's pointless to do a talloc_asprintf with a SMB_STRDUP on the result. Use asprintf directly. Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Tue Apr 24 18:18:05 CEST 2012 on sn-devel-104
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-19/+19
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* s3-vfs: Remove unused lremovexattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-7/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to removexattr. Andrew Bartlett
* s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-9/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused llistxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-7/+0
| | | | | | | If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
* s3-vfs: Remove unused lgetxattr call from VFS modules, system.c and configureAndrew Bartlett2012-04-051-8/+0
|
* build: Remove SMB_STRUCT_DIR defineAndrew Bartlett2012-04-051-9/+9
|
* build: Remove SMB_STRUCT_DIRENT defineAndrew Bartlett2012-04-051-2/+2
|
* s3-vfs: Use new smb_load_module for better diagnosticsAndrew Bartlett2012-04-031-1/+1
|
* s3: Pass filters explicitly through vfs notify watchVolker Lendecke2012-03-261-2/+4
| | | | | | | | | This removes a dependency on "struct notify_entry" and makes the nature of the API more explicit. We depend upon the VFS module to mask out elements from e->filter and e->subdir_filter that it took over to handle. Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Mon Mar 26 17:45:44 CEST 2012 on sn-devel-104
* s3: Pass "path" through vfs_notify_watchVolker Lendecke2012-03-211-1/+2
|
* Add the implementation of check_reduced_name_with_privilege(). Now to plumb intoJeremy Allison2012-02-291-3/+157
| | | | SMB1 requests.
* Add check_reduced_name_with_privilege(), filename_convert_with_privilege() ↵Jeremy Allison2012-02-291-0/+15
| | | | | | (currently unimplemented) in order to prepare for adding SeBackup/SeRestore code to the main fileserver. Not yet plumbed into the main SMB1/SMB2 code.
* vfs: Make function pointer names consistent. They all end in _fnRichard Sharpe2011-12-121-136/+141
| | | | | Autobuild-User: Richard Sharpe <sharpe@samba.org> Autobuild-Date: Mon Dec 12 04:58:40 CET 2011 on sn-devel-104
* First part of fix for bug #8419 - Make VFS op "streaminfo" stackable.Frank Lahm2011-10-171-0/+15
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Oct 17 21:39:32 CEST 2011 on sn-devel-104
* s3:vfs: add SMB_VFS_GET_DFS_REFERRAL() hooksStefan Metzmacher2011-10-081-0/+7
| | | | metze